Issue compiling Android 6.0 using Jack Server - android

I never had a problem compiling the AOSP version until 5.x. Now I'm trying to compile Android 6.0, which switched toolchain and uses Jack (Java Android Compiler Kit) but the compilation aborts.
The error seems to be related with a problem in compiling C object files, so the ld linker at some point starts producing file is empty errors such as the following one:
host SharedLib: libart (out/host/linux-x86/obj/lib/libart.so)
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/check_jni.o: file is empty
When I check these files their size is 0 bytes. I tried the process two times before writing this, but every time the make process stops with the follosing error:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [out/host/linux-x86/obj/lib/libart.so] Error 1
Have you experienced something like this and found a solution?

Related

AOSP - error failed to build the custom ROM

I'm trying to build AOSP for a supported device (sony Xperia z5) (aosp_mips64-eng)
I follow the instruction here: https://forum.xda-developers.com/t/guide-how-to-build-aosp-pie-custom-rom-for-xperia-devices.3921641/
After download the source, Initializing device type for ROM building. I Encounter an error while trying to build the custom ROM:
I there anything i could do? Have I done something wrong? I'm pretty sure i did the previous steps correctly.
============================================
ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
No need to regenerate ninja file
ninja: error: 'device/generic/common/nfc/libnfc-nci.conf', needed by 'out/target/product/generic/system/etc/libnfc-nci.conf', missing and no known rule to make it
10:29:40 ninja failed with: exit status 1
build/make/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

Oreo 8.1 boringssl build fail for FIPS Enforced mode

I am trying to build boringssl for FIPS Enforced mode and the build is failing. So far, I have enabled two flags "FIPS", and "FIPS_DELOCATE" in cmake command, followed by ninja build.
I am using Oreo 8.1. codebase and I have been struggling with this for quite some time. Here are the steps I followed.
external/boringssl/src$ cmake -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=27 -DFIPS=1 -DFIPS_DELOCATE=1
// This command executes successfully, and all config files are generated
external/boringssl/src$ ninja
// This command giving below error
siyachin#pcz-siyachin:/u/siyachin/Project_O3/external/boringssl/src$ ninja
[244/388] Building C object crypto/fipsmodule/CMakeFiles/bcm_c_generated_asm.dir/bcm.c.o
clang: warning: argument unused during compilation: '-Wa,--noexecstack' [-Wunused-command-line-argument]
[252/388] Generating bcm-delocated.S
FAILED: cd /u/siyachin/Project_O3/external/boringssl/src && go run util/fipstools/delocate.go util/fipstools/delocate.peg.go util/fipstools/ar.go util/fipstools/const.go -a /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/libbcm_c_generated_asm.a -o /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/bcm-delocated.S /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/aesv8-armx.S /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/armv8-mont.S /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/ghashv8-armx.S /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/sha1-armv8.S /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/sha256-armv8.S /u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/sha512-armv8.S
error while parsing "/u/siyachin/Project_O3/external/boringssl/src/crypto/fipsmodule/libbcm_c_generated_asm.a":
parse error near WS (line 57 symbol 29 - line 57 symbol 34):
" "
exit status 1
ninja: build stopped: subcommand failed.
I think, the build failing with util/fipstools/delocate.go. I tried to put some debug logs, and its failing while trying to pars libbcm_c_generated_asm.a from delocate.go.
Also, is there any way, I can run go files from from Android.bp?, as FIPS Relaxed mode is building properly with my Android.bp?
I ran into the same issue. I was trying to compile boringssl in fips mode for x86 ( x86_64 works ).
I was able to get past the "parse" issues by modifying "delocate.peg", regenerating "delocate.peg.go" ( using https://github.com/pointlander/peg ) but eventually got stuck.
If you look at line number 141 in file https://boringssl.googlesource.com/boringssl/+/refs/tags/fips-20180730/util/fipstools/delocate.go, you will see that the FIPS mode is only supported for x86_64 and ppc64le, It is currently not supported for ARM or x86.
See supported arch at https://csrc.nist.gov/csrc/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp2964.pdf

ndk-build fails to build Superpowered audio library after recent NDK update

UPDATE March 19, 2016: Superpowered has released new binaries which work properly with NDK r11
I'm trying to build Superpowered library CrossExample sample project in Android Studio. Until recent NDK update it worked like charm, but now execution of ndk-build gives an error:
Error:error: undefined reference to '__page_size'
I tried building with different toolchains, removing/adding several build flags with no luck so far.
In a different project that uses Superpowered SDK and pretty much the same config I get some other error details. Part of output message log:
/android/ndk/platforms/android-9/arch-x86/usr/include/unistd.h:173: error: undefined reference to '__page_size'
/android/ndk/platforms/android-9/arch-x86/usr/include/unistd.h:173: error: undefined reference to '__page_size'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/user_name/StudioProjects/project_name/app/src/main/jniSuperpowered/obj/local/x86/libNativeLibName.so] Error 1
make: *** Waiting for unfinished jobs....
/Volumes/iMect/iphone/SuperpoweredSource/decoder/SuperpoweredDecoder.cpp:120: error: undefined reference to '__page_size'
/Volumes/iMect/iphone/SuperpoweredSource/decoder/hlsreader.cpp:582: error: undefined reference to '__page_size'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/user_name/StudioProjects/project_name/app/src/main/jniSuperpowered/obj/local/armeabi-v7a/libNightcorizerSuperpowered.so] Error 1
FAILURE: Build failed with an exception.
What looks not right is undefined reference to __page_size in unistd.h . However I've got very little idea of further troubleshooting.
Thanks ahead for any help/suggestions!
The changes made in this NDK commit seem to explain the issue you're seeing. According to the commit description, __page_size was replaced with PAGE_SIZE for Android API levels 12 and under. As you're using API level 9 and code which directly references __page_size, you're seeing an effect from this change.
However, it looks like the method signature for int getpagesize() hasn't changed across NDK versions or across API levels, so you should be able to resolve this error by replacing the usage of __page_size with getpagesize() in the following locations:
SuperpoweredSource/decoder/SuperpoweredDecoder.cpp:120
SuperpoweredSource/decoder/hlsreader.cpp:582
Update:
To fix it without modifying the Superpowered source code, you'd need to define the symbol __page_size. To do that, you could build a tiny dummy library which just contains
#include <unistd.h>
extern unsigned int __page_size = getpagesize();
Then, add a module for this library to your Android.mk (or your build.gradle if you're using the new experimental system) and make the module for Superpowered depend on the dummy module.
Or, you could file a bug report with Superpowered.
So as a workaround for the situation I reverted NDK to r10e which worked. Will be using it until Superpowered library gets a fix. Great thanks to #bullsy

Building AOSP 5.1.51 with Ubuntu 14.04

Im trying to build AOSP 5.1.51, I machine meets requirements
Following the instructions but the make -j4 never build succesfully.
Recently trying to lunch aosp_mips-eng terminates with
target C++: v8_tools_gyp_v8_base_gyp <= external/chromium_org/v8/src/mips/lithium-mips.cc
In file included from external/chromium_org/v8/src/mips/lithium-codegen-mips.h:11:0, from external/chromium_org/v8/src/mips/lithium-codegen-mips.cc:36:
external/chromium_org/v8/src/mips/lithium-mips.h: In member function 'bool v8::internal::LCodeGen::GeneratePrologue()':
external/chromium_org/v8/src/mips/lithium-mips.h:2718:7: internal compiler error: Segmentation fault
class LChunkBuilder FINAL : public LChunkBuilderBase {
^
Please submit a full bug report, with preprocessed source if appropriate.
See <http://source.android.com/source/report-bugs.html> for instructions.
make: *** [/home/userAndroid/Builds/AOSP/target/product/generic_mips/obj/STATIC_LIBRARIES/v8_tools_gyp_v8_base_gyp_intermediates/v8/src/mips/lithium-codegen-mips.o] Error 1
make: *** Waiting for unfinished jobs....
#### make failed to build some targets (21:29 (mm:ss)) ####
And it ends there :(
After so many tries, I ended up removing the entire source repo, fetch everything and build. Now everything works way better than before. I have not read everything to see if its the introduction of jackor things are better with the latest branch of android source.
If you are struggling with your build, this could be the way to go.

Need Help AOSP Build Error for snapdragon 8974

I'm trying to build Android 5.0 source code from code-aurora for snapdragon 8074. Encountered the following error:
target SharedLib: libandroid_runtime (out/target/product/msm8974/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/LINKED/libandroid_runtime.so)
frameworks/base/core/jni/android/graphics/Paint.cpp:809: error: undefined reference to 'android::uirenderer::Blur::convertRadiusToSigma(float)'
collect2: error: ld returned 1 exit status
make: *** [out/target/product/msm8974/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/LINKED/libandroid_runtime.so] Error 1
#### make failed to build some targets (06:19:52 (hh:mm:ss)) ####
And I had downloaded the source code mentioned for the snapdragon8074.
I ran the following commands to build
$ source build/envsetup.sh
$ lunch msm8974-userdebug
$ make
Can anyone kindly help with the issue?
Thanks
You need to add USE_OPENGL_RENDERER := true to your BoardConfig.mk (in your case this file is under device/qcom/msm8974).
This is so because on modern builds of Android hardware accelerated graphics are pretty much mandatory. See here.
As a side note, for Code Aurora you should be using choosecombo instead of lunch (in your case choosecombo 1 msm8974 2).

Categories

Resources