64-bit safe libcore

228 views
Skip to first unread message

Joel Dice

unread,
Feb 25, 2013, 7:26:03 PM2/25/13
to android...@googlegroups.com
Hi all,

I'm in the process of adding support for using Android's Java class
library (e.g. libcore and its dependencies) to a portable JVM which
supports both 32-bit and 64-bit architectures. Since there is a lot of
code in https://android.googlesource.com/platform/libcore which is not
64-bit safe, I spent some time today making it so:

https://github.com/dicej/android-libcore64/commit/625205233730b0a42d172f421a7978f1b09e31fd

Is there any interest in getting this merged upstream?

enh

unread,
Feb 26, 2013, 11:10:23 AM2/26/13
to android...@googlegroups.com
On Mon, Feb 25, 2013 at 4:26 PM, Joel Dice <joel...@gmail.com> wrote:
Hi all,

I'm in the process of adding support for using Android's Java class library (e.g. libcore and its dependencies) to a portable JVM which supports both 32-bit and 64-bit architectures.  

interesting. if that's easy to set up, that might be useful to me (as maintainer of libcore), so i can have a 64-bit continuous build even before there's a 64-bit dalvik.
 
Since there is a lot of code in https://android.googlesource.com/platform/libcore which is not 64-bit safe, I spent some time today making it so:

https://github.com/dicej/android-libcore64/commit/625205233730b0a42d172f421a7978f1b09e31fd

Is there any interest in getting this merged upstream?

definitely. i haven't had any time to work on 64-bit support yet, but i have been using longs in new code that has native peers.

i'm not sure you're up to date wrt the master-dalvik branch; i thought we'd already fixed all the 0/NULL confusion. so you should check that.

we should also break this up into multiple patches. in particular the SSL stuff will be reviewed by a different guy and should stand alone, and the NIO stuff is the one place where i worry about performance, so that will want to be tested independently. and the other stuf should be broken up into meaningful units too --- it makes it easier to test, and easier to revert only part of the work if we do hit performance/correctness problems.

i recently moved the dalvik/libcore benchmarks out of the code.google.com/p/dalvik project and into libcore, though you'll still have to bring your own copy of vogar/caliper to be able to run them. (but that's only if you're interested yourself; i'll have to double-check anyway.)
 

--

--- You received this message because you are subscribed to the Google Groups "Android Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-contrib+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
NIO, JNI, or bionic questions? Mail me/drop by/add me as a reviewer.

Joel Dice

unread,
Feb 26, 2013, 11:51:49 AM2/26/13
to android...@googlegroups.com
On Tue, 26 Feb 2013, enh wrote:

> On Mon, Feb 25, 2013 at 4:26 PM, Joel Dice <joel...@gmail.com> wrote:
> Hi all,
>
> I'm in the process of adding support for using Android's Java
> class library (e.g. libcore and its dependencies) to a portable
> JVM which supports both 32-bit and 64-bit architectures. �
>
>
> interesting. if that's easy to set up, that might be useful to me (as
> maintainer of libcore), so i can have a 64-bit continuous build even before
> there's a 64-bit dalvik.

Yeah, it's pretty easy. I've still got a bit more work to do porting the
VM to use libcore, but I hope to have the whole thing ready and the build
process documented by the end of the week. The work is happening in
https://github.com/dicej/avian, and will be pulled into
https://github.com/ReadyTalk/avian when it's ready. I'll let you know
then.

By the way, the VM currently supports Linux, OS X, iOS, Windows, FreeBSD,
and QNX on various architectures (ia32, x86_64, ARM, and PowerPC). I'm
hoping to get libcore working on as many of those as possible, with
Windows probably being the biggest challenge. How much, if any, of that
porting work would you be interested in pulling upstream?

> Since there is a lot of code in
> https://android.googlesource.com/platform/libcore which is not
> 64-bit safe, I spent some time today making it so:
>
> https://github.com/dicej/android-libcore64/commit/625205233730b0a42d172f421
> a7978f1b09e31fd
>
> Is there any interest in getting this merged upstream?
>
>
> definitely. i haven't had any time to work on 64-bit support yet, but i have
> been using longs in new code that has native peers.

Yay!

> i'm not sure you're up to date wrt the master-dalvik branch; i thought we'd
> already fixed all the 0/NULL confusion. so you should check that.

Thanks, I will.

> we should also break this up into multiple patches. in particular the SSL
> stuff will be reviewed by a different guy and should stand alone, and the
> NIO stuff is the one place where i worry about performance, so that will
> want to be tested independently. and the other stuf should be broken up into
> meaningful units too --- it makes it easier to test, and easier to revert
> only part of the work if we do hit performance/correctness problems.

How does this breakdown sound:

* ObjectStreamClass
* NativeDecimalFormat
* ExpatParser/ExpatAttributes
* the OpenSSL stuff
* the nio and libcore/io stuff

I don't think I can break down the last two into smaller chunks since
the classes in each case pass pointers around heavily, but I'm open to
advice if you think otherwise.

> i recently moved the dalvik/libcore benchmarks out of the
> code.google.com/p/dalvik project and into libcore, though you'll still have
> to bring your own copy of vogar/caliper to be able to run them. (but that's
> only if you're interested yourself; i'll have to double-check anyway.)

Thanks, I might give that a try.

enh

unread,
Feb 26, 2013, 12:47:17 PM2/26/13
to android...@googlegroups.com
On Tue, Feb 26, 2013 at 8:51 AM, Joel Dice <joel...@gmail.com> wrote:
On Tue, 26 Feb 2013, enh wrote:

On Mon, Feb 25, 2013 at 4:26 PM, Joel Dice <joel...@gmail.com> wrote:
      Hi all,

      I'm in the process of adding support for using Android's Java
      class library (e.g. libcore and its dependencies) to a portable
      JVM which supports both 32-bit and 64-bit architectures.  


interesting. if that's easy to set up, that might be useful to me (as
maintainer of libcore), so i can have a 64-bit continuous build even before
there's a 64-bit dalvik.

Yeah, it's pretty easy.  I've still got a bit more work to do porting the VM to use libcore, but I hope to have the whole thing ready and the build process documented by the end of the week.  The work is happening in https://github.com/dicej/avian, and will be pulled into https://github.com/ReadyTalk/avian when it's ready.  I'll let you know then.

cool.
 
By the way, the VM currently supports Linux, OS X, iOS, Windows, FreeBSD, and QNX on various architectures (ia32, x86_64, ARM, and PowerPC).  I'm hoping to get libcore working on as many of those as possible, with Windows probably being the biggest challenge.  How much, if any, of that porting work would you be interested in pulling upstream?

depends on how ugly it gets. we already have some Mac OS support, for example, and we already support ARM, MIPS, and x86.
yeah, that sounds about right to me.
 
i recently moved the dalvik/libcore benchmarks out of the
code.google.com/p/dalvik project and into libcore, though you'll still have
to bring your own copy of vogar/caliper to be able to run them. (but that's
only if you're interested yourself; i'll have to double-check anyway.)

Thanks, I might give that a try.
--

--- You received this message because you are subscribed to the Google Groups "Android Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-contrib+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Joel Dice

unread,
Feb 27, 2013, 5:08:48 PM2/27/13
to android...@googlegroups.com
Okay, I'm ready to start submitting patches for 64-bit support, but I'm
having trouble with the "repo upload" step. I've followed the
instructions at http://source.android.com/source/submit-patches.html, and
it all goes fine until the upload, where I get:

fatal: remote error: Upload denied for project 'platform/libcore2'

Any ideas?

Brian Carlstrom

unread,
Feb 27, 2013, 5:40:56 PM2/27/13
to android...@googlegroups.com
You need to :repo init -b master-dalvik", not master, if you want to
upload dalvik or libcore changes.

-bri
> --
>
> --- You received this message because you are subscribed to the Google
> Groups "Android Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-contr...@googlegroups.com.

Pablo Guerrero

unread,
Jul 4, 2013, 10:49:56 AM7/4/13
to android...@googlegroups.com
Hi,

I'm interested in the 64bit support of libcore. Is there any news on this?
I've seen a few patches fixing 64bit issues, but I would like to know how far is libcore from supporting 64bit.

Thank you,
Pablo

enh

unread,
Jul 8, 2013, 1:02:26 PM7/8/13
to android...@googlegroups.com
i believe the work is complete.


--
 
---
You received this message because you are subscribed to the Google Groups "Android Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-contr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Java i18n/JNI/NIO, or bionic questions? Mail me/drop by/add me as a reviewer.

Pablo Guerrero

unread,
Jul 8, 2013, 1:53:47 PM7/8/13
to android...@googlegroups.com
Thanks, everything I tried worked, but I wanted to have your opinion.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Android Contributors" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-contrib/tx2ITpsX4jY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-contr...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages