OnePlusOSS / android

454 stars 105 forks source link

compile error #9

Closed vyrus001 closed 8 years ago

vyrus001 commented 8 years ago

phone successfully rooted. script to pull all requirements from the phone through ADB did not work due to being unable to run cmds as root on adb (my rooted oneplus-3 is still running the stock image and the stock image does not support ADB as root) so i modified it to copy all the required files to an area accessible by the default user and chmodded it to be accessible (which totally worked).

am now trying to compile the operating system and running into the following error.

Install: out/target/product/generic/system/etc/security/cacerts/ed39abd0.0
Install: out/target/product/generic/system/etc/security/cacerts/ed524cf5.0
Install: out/target/product/generic/system/etc/security/cacerts/ee7cd6fb.0
Install: out/target/product/generic/system/etc/security/cacerts/ee90b008.0
Install: out/target/product/generic/system/etc/security/cacerts/f58a60fe.0
Install: out/target/product/generic/system/etc/security/cacerts/f61bff45.0
Install: out/target/product/generic/system/etc/security/cacerts/f80cc7f6.0
Install: out/target/product/generic/system/etc/security/cacerts/fac084d7.0
Install: out/target/product/generic/system/etc/security/cacerts/facacbc6.0
Install: out/target/product/generic/system/etc/security/cacerts/fb126c6d.0
Install: out/target/product/generic/system/etc/security/cacerts/fde84897.0
Install: out/target/product/generic/system/etc/security/cacerts/ff783690.0
Install: out/host/linux-x86/bin/insertkeys.py
out/host/linux-x86/bin/checkpolicy:  loading policy configuration from out/target/product/generic/obj/ETC/sepolicy.recovery_intermediates/policy_recovery.conf
external/sepolicy/domain.te:256:ERROR 'unknown type rmt_storage' at token ';' on line 9027:
# Ensure that nothing in userspace can access /dev/mem or /dev/kmem
neverallow { domain -kernel -ueventd -init -rmt_storage } kmem_device:chr_file *;
checkpolicy:  error(s) encountered while parsing configuration
external/sepolicy/Android.mk:96: recipe for target 'out/target/product/generic/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery' failed
make: *** [out/target/product/generic/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery] Error 1
make: *** Waiting for unfinished jobs....
Install: out/target/product/generic/system/fonts/AndroidClock.ttf
vyrus001 commented 8 years ago

apperantlyso after reducing the number of make threads to one, I have identified the err that seems to be the origin of the build failure. Its a linker error with libart (which is apparently a problem child in some other android builds). The full error context is below.

*** snip ***
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x86_64.o: unsupported reloc 42 against global symbol art::Runtime::instance_
out/host/linux-x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x86_64.o:function art_quick_throw_null_pointer_exception: error: unsupported reloc 42
*** snip ***
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:51: recipe for target 'out/host/linux-x86/obj/lib/libart.so' failed
make: *** [out/host/linux-x86/obj/lib/libart.so] Error 1
vyrus001 commented 8 years ago

I have solved my own problem, applying the fix documented here => http://review.cyanogenmod.org/#/c/120824/2/build/Android.common_build.mk allows the project to compile. The file in question resides within the oneplus source repo at art/build/Android.common_build.mk