AOSP (master) fails to build on MacOS

2,040 views
Skip to first unread message

Michael

unread,
Apr 20, 2018, 5:38:18 PM4/20/18
to Android Building
Hi guys

Struggling to get AOSP built on MacOS (High Sierra). I get the same pthread_cond_timedwait error every attempt.

Commands executed

repo init -u https://android.googlesource.com/platform/manifest -b master

repo sync -j24

. ./build/envsetup.sh
lunch hikey960-userdebug
make -j32


Output before failure
[  9% 2563/27328] target dex2oat: out/target/product/hikey960/dex_bootjars/system/framework/arm64/boot.art
FAILED: out/target/product/hikey960/dex_bootjars/system/framework/arm64/boot.art 
/bin/bash -c "(mkdir -p out/target/product/hikey960/symbols/system/framework/arm64/ ) && (rm -f out/target/product/hikey960/dex_bootjars/system/framework/arm64//*.art out/target/product/hikey960/dex_bootjars/system/framework/arm64//*.oat out/target/product/hikey960/dex_bootjars/system/framework/arm64//*.art.rel ) && (rm -f out/target/product/hikey960/symbols/system/framework/arm64//*.art ) && (rm -f out/target/product/hikey960/symbols/system/framework/arm64//*.oat ) && (rm -f out/target/product/hikey960/symbols/system/framework/arm64//*.art.rel ) && (ANDROID_LOG_TAGS=\"*:v\" out/host/darwin-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=speed-profile --profile-file=out/target/product/hikey960/dex_bootjars/system/framework/boot.prof --dex-file=out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/legacy-test_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/ims-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy.boot_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.hidl.base-V1.0-java_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.hidl.manager-V1.0-java_intermediates/javalib.jar --dex-location=/system/framework/core-oj.jar --dex-location=/system/framework/core-libart.jar --dex-location=/system/framework/conscrypt.jar --dex-location=/system/framework/okhttp.jar --dex-location=/system/framework/bouncycastle.jar --dex-location=/system/framework/apache-xml.jar --dex-location=/system/framework/legacy-test.jar --dex-location=/system/framework/ext.jar --dex-location=/system/framework/framework.jar --dex-location=/system/framework/telephony-common.jar --dex-location=/system/framework/voip-common.jar --dex-location=/system/framework/ims-common.jar --dex-location=/system/framework/org.apache.http.legacy.boot.jar --dex-location=/system/framework/android.hidl.base-V1.0-java.jar --dex-location=/system/framework/android.hidl.manager-V1.0-java.jar --oat-symbols=out/target/product/hikey960/symbols/system/framework/arm64/boot.oat --oat-file=out/target/product/hikey960/dex_bootjars/system/framework/arm64/boot.oat --oat-location=/system/framework/arm64/boot.oat --image=out/target/product/hikey960/dex_bootjars/system/framework/arm64/boot.art --base=0x70000000 --instruction-set=arm64 --instruction-set-variant=cortex-a73 --instruction-set-features=default --android-root=out/target/product/hikey960/system --runtime-arg -Xnorelocate --compile-pic --no-generate-debug-info --generate-build-id --multi-image --no-inline-from=core-oj.jar --abort-on-hard-verifier-error --abort-on-soft-verifier-error     || ( echo \"ERROR: Dex2oat failed to compile a boot image. It is likely that the boot classpath is inconsistent. Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS=\"--runtime-arg -verbose:verifier\" to see verification errors.\" ; false ) && ANDROID_LOG_TAGS=\"*:v\" ANDROID_ROOT=out/target/product/hikey960/system ANDROID_DATA=out/target/product/hikey960/dex_bootjars/system/framework/arm64/ out/host/darwin-x86/bin/patchoatd --input-image-location=out/target/product/hikey960/dex_bootjars/system/framework/boot.art --output-image-relocation-directory=out/target/product/hikey960/dex_bootjars/system/framework/arm64/ --instruction-set=arm64 --base-offset-delta=0x10000000 )"
dex2oatd W 04-20 21:33:25 49081 2336186 time_utils.cc:179] uint64_t art::ProcessCpuNanoTime() unimplemented 
dex2oatd F art/dex2oat/dex2oat.cc] pthread_cond_timedwait failed: Undefined error: 0
ERROR: Dex2oat failed to compile a boot image. It is likely that the boot classpath is inconsistent. Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS=--runtime-arg -verbose:verifier to see verification errors.
[  9% 2594/27328] target  C++: libv8src <= external/v8/src/objects.cc
ninja: build stopped: subcommand failed.
21:33:39 ninja failed with: exit status 1

#### failed to build some targets (28:00 (mm:ss)) ####

Dan Willemsen

unread,
Apr 20, 2018, 6:17:23 PM4/20/18
to Android Building
Running dex2oat isn't supported on Mac. You'll want to be setting WITH_DEXPREOPT=false in your environment.

Most configs check to make sure you're running on linux before changing that default, but it looks like hikey always sets it: https://android.googlesource.com/device/linaro/hikey/+/master/BoardConfigCommon.mk#14 -- so I wouldn't be overly surprised if other things fail, since it apparently hasn't been tested on Mac.

- 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.
For more options, visit https://groups.google.com/d/optout.

Michael

unread,
Apr 21, 2018, 2:37:49 PM4/21/18
to Android Building
Thanks Dan, I'll try that.

Seems odd tho as there is a Apple specific defines in the dex2oat code. As far as I understand, the error that I'm getting is some kind of timing issue that happens sometimes - not always, only sometimes (as with most bugs).

Michael

unread,
Apr 22, 2018, 1:25:04 PM4/22/18
to Android Building
Building with (out) WITH_DEXPREOPT=false did the trick.

Oleg Kokorin

unread,
Apr 23, 2018, 10:35:06 AM4/23/18
to android-...@googlegroups.com
the compilation failed for me too, but for a different reason:

there are places where "linux" is hardcoded in some include paths.

Oleg

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

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-building+unsubscribe@googlegroups.com.

Dan Willemsen

unread,
Apr 23, 2018, 4:34:01 PM4/23/18
to Android Building
I've uploaded https://android-review.googlesource.com/c/device/linaro/hikey/+/670443 to fix the WITH_DEXPREOPT issue. After that, the build completes successfully on my mac.

the compilation failed for me too, but for a different reason:
there are places where "linux" is hardcoded in some include paths.

Can you give some error output, or reproduction steps? hikey960 on master doesn't appear to have other issues.

- Dan

To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

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.

--
--
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

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.
Reply all
Reply to author
Forward
0 new messages