AOSP on aws a1 instance (arm)

2,621 views
Skip to first unread message

kkh

unread,
Jun 8, 2021, 10:28:02 PM6/8/21
to Android Building
Hi,

Anyone manage to build AOSP on arm host? After repo sync on android-11.0.0_r35, did the source envsetup.sh and lunch command, but it seem that the build tools is in x86.

Error encountered
/home/ubuntu/android/build/blueprint/microfactory/microfactory.bash: line 62: /home/ubuntu/android/prebuilts/go/linux-x86//bin/go: cannot execute binary file: Exec format error

You're building on Linux

Lunch menu... pick a combo:

Which would you like? [aosp_arm-eng] 
/home/ubuntu/android/build/blueprint/microfactory/microfactory.bash: line 62: /home/ubuntu/android/prebuilts/go/linux-x86//bin/go: cannot execute binary file: Exec format error

Dan Willemsen

unread,
Jun 8, 2021, 11:08:39 PM6/8/21
to Android Building
Building Android requires a x86-64 machine, it is not supported on arm. As you've found, all of our prebuilt tools are x86-64, and I suspect there are further issues even if you manage to replace them with arm equivalents, as that hasn't been tested. There's limited support in Soong for Linux/arm64, but that's for cross-compiling binaries for that configuration on an x86-64 system.

- Dan

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/19e0f12e-d416-4ac5-83ec-0a89afae7fb6n%40googlegroups.com.

kkh

unread,
Jun 9, 2021, 9:58:54 PM6/9/21
to Android Building

Hi Dan,

Thanks for the reply. I got another related issue and hope that you can solve it as well. If I tried to build from x86-64 machine for arm target, the output folder does not have qemu files that the emulator needs such as ramdisk-qemu.img.

Download and build code
repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r35
repo sync -c -j4
source build/envsetup.sh
lunch aosp_arm-eng
m -j4

After build success, in the out/target/product/generic_arm64 directory, it does not have ramdisk-qemu.img. 

When I build for x86-64 target such as aosp_x86_64-eng, the output directory will have the required qemu image for me to run the emulator.

Command to run the x86-64 emulator without running envsetup.sh
export ANDROID_BUILD_TOP=/home/user/android
export ANDROID_PRODUCT_OUT=/home/user/android/out/target/product/generic_x86_64
cd /home/user/android/out/target/product/generic_x86_64
/home/user/android/prebuilts/android-emulator/linux-x86_64/emulator -verbose -show-kernel -sysdir system/ -datadir data/ -kernel kernel-ranchu -ramdisk ramdisk-qemu.img -system system.img -initdata userdata.img -cache cache.img -vendor vendor.img 

Am I missing something when building the arm target on x86-64 machine? I think that it should be possible to run the arm64 aosp android using the arm64 emulator on an arm64 host if I have the right files generated during Android building process.

Emulator for ARM64 hosts (I followed the instruction here to build the emulator for arm64 host, since the prebuilt android emulator only support x86-64 host)

Thanks
kkh
Reply all
Reply to author
Forward
0 new messages