0
votes

[ 2% 247/11700] target SharedLib: lib...libart_intermediates/LINKED/libart.so) FAILED: /bin/bash -c "prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -nostdlib -Wl,-soname,libart.so -Wl,--gc-sections -shared -Lout/target/product/generic/obj/lib out/target/product/generic/obj/lib/crtbegin_so.o out/target/product/generic/obj/SHARED_LIBRARIES/libart_intermediates/interpreter/mterp/out/mterp_arm.o
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin/ld: error: out/target/product/generic/obj/SHARED_LIBRARIES/libart_intermediates/type_lookup_table.o: file is empty prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin/ld: error: out/target/product/generic/obj/SHARED_LIBRARIES/libart_intermediates/verifier/instruction_flags.o: file is empty art/runtime/base/scoped_flock.cc:37: error: undefined reference to 'art::OS::OpenFileWithFlags(char const*, int)' art/runtime/check_jni.cc:3240: error: undefined reference to 'art::operator<<(std::__1::basic_ostream >&, art::Primitive::Type const&)' art/runtime/check_jni.cc:3056: error: undefined reference to 'art::operator<<(std::__1::basic_ostream >&, art/runtime/class_linker.cc:2166: error: undefined reference to 'art::ObjectLock::ObjectLock(art::Thread*, art::Handle)' art/runtime/class_linker.cc:2169: error: undefined reference to 'art::ObjectLock::WaitIgnoringInterrupts()' clang++: error: linker command failed with exit code 1 (use -v to see invocation) [ 2% 247/11700] Building with Jack: o...t_intermediates/with-local/classes.dex ninja: build stopped: subcommand failed. build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed make: *** [ninja_wrapper] Error 1

make failed to build some targets (06:55 (mm:ss))

Getting this error when i run make -j16 Help me what to do !

2

2 Answers

0
votes

Seems like some of your object files have been corrupted. I suggest you either clean the dir out/target/product/generic/obj/SHARED_LIBRARIES/libart_intermediates or/and clean ccache ccache -C

0
votes

First advice is not to build with make -j16 as it takes too much ram. For example compiling on 8 cores needs 64 GB of ram (tested on my server)

Try just compiling on a single core or at most on two. Another solution would be to call the command m instead of make to let it automatically find optimal settings on your hardware.

Another thing could be that you are missing some packages. Are you sure these packages are installed?

git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

They could have different names for your distro (for example if you use Arch).

Also to note:

  • Compiling should take between 2.5 to 4 hours depending on your cpu performance. - It needs 100GB for downloading the android sources and 100-150GB for compilation.
  • You also need at least 12 GB or more to compile on a single core.
  • There is some method to compile it on 8GB of RAM by using swap space but this is extremely slow so not recommended.

My personal hardware and times:

  • Intel xeon e5-2680v3 8 core cpu
  • 40 GB ram
  • Compile time on make -j1: 2 hours