how to build the "dex2oat" for the target device?

337 views
Skip to first unread message

Abe Skolnik

unread,
Mar 15, 2016, 7:56:40 PM3/15/16
to android-...@googlegroups.com
Dear all,

I can easily enough build "dex2oat" for the _host_ [ia32 executable], but I
can`t seem to figure out how to make AOSP build the "dex2oat" for the
_target_ device, e.g. a 32-bit ARM or AArch64 executable. I`ve already
checked on an Android 5.1-or-so device to see that there is such a thing,
and it seems that there _is_.

Please help.

Regards,

Abe


Colin Cross

unread,
Mar 15, 2016, 8:31:57 PM3/15/16
to android-...@googlegroups.com
On the latest AOSP:
$ source build/envsetup.sh
$ lunch aosp_arm64-eng
$ make -j32 dex2oat
[100% 3695/3695] Install: out/target/product/generic_arm64/system/bin/dex2oat
$ file out/target/product/generic_arm64/system/bin/dex2oat
out/target/product/generic_arm64/system/bin/dex2oat: ELF 32-bit LSB
shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses
shared libs), BuildID[md5/uuid]=b7527da9a417d791c1282ba8444cb8fd,
stripped
> --
> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Abe Skolnik

unread,
Mar 16, 2016, 2:58:14 PM3/16/16
to Android Building
Thanks, Colin.

Yes, I could have sworn it used to be that "easy"/"simple", but I recently noticed that my builds had the host "dex2oat" but not the target.

I recently found that asking GYP to build "droid" gave me the target
"dex2oat".

Can anybody please explain why
the target "dex2oat" is 32-bit [as judged by the "file" utility] even though I asked for AArch64?  [similarly, as you can see when Colin specified "aosp_arm64-eng"]

-- Abe

Colin Cross

unread,
Mar 16, 2016, 4:12:04 PM3/16/16
to android-...@googlegroups.com
I noticed that too. The decision is made here:
https://android.googlesource.com/platform/art/+/master/dex2oat/Android.mk#33

For 64-bit only devices it uses a 64-bit dex2oat, for mixed
64-bit/32-bit (like aosp_arm64-eng) and 32-bit only devices it uses
32-bit dex2oat. The 32-bit version is capable of compiling for
aarch32 or aarch64, it is an implementation detail that it is itself
compiled for aarch32, one that may change in the future.

Abe Skolnik

unread,
Mar 17, 2016, 10:04:10 AM3/17/16
to Android Building
Thanks again, Colin!  You da` man!  ;-)

Is there any known way to force "dex2opt" [and the libraries upon which it depends] to be built purely 64-bit without hacking the makefiles and/or GYPfiles?

-- Abe

Colin Cross

unread,
Mar 17, 2016, 1:33:39 PM3/17/16
to android-...@googlegroups.com
No, you would have to modify art/dex2oat/Android.mk.
Reply all
Reply to author
Forward
0 new messages