android build error on ubuntu 11.10 - android

I am facing a problem when trying to build android 2.3 on ubuntu 11.10
First error -
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: * Waiting for unfinished jobs....
I solved this by modifying,
frameworks/base/libs/utils/Android.mk
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
But after doing the above modification, new error came up,
host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)
host C++: libutils <= frameworks/base/libs/utils/Asset.cpp
host C++: libutils <= frameworks/base/libs/utils/AssetDir.cpp
host C++: libutils <= frameworks/base/libs/utils/AssetManager.cpp
g++: error: unrecognized option ‘--fpermissive’
make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/Asset.o] Error 1
make: * Waiting for unfinished jobs....
g++: error: unrecognized option ‘--fpermissive’
g++: error: unrecognized option ‘--fpermissive’
make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetDir.o] Error 1
make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o]
Build Configuration:
Ubuntu 11.10
Tried with both gcc versions, 4.4 and 4.6
but nothing is working out, please help me out struggling from the past one day
Command options used to built,
$. build/envsetup.sh
$lunch 1
$make -j4
GCC - version
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
----------------------------------------------------------------
EDIT 2-
I think its a problem with the gcc version, not its moving at a better pace, but now i am getting this error-
cmd - make CC=gcc-4.4 CXX=g++-4.4
error - host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

I have tried this solution and it solved the problem you mention: How to fix problem of incompatibility between GCC 4.6 and Android 2.3 (Gingerbread).
However, I cannot link after all is compiled.
I am compiling 2.2 with gcc-4.6 on linux mint.
Anyway it should help you.

Related

Build Android kernel ld vdso32 with error unrecognised emulation mode: armelf_linux_eabi

I try to build android kernel from google official document,use official build.shfrom scratch,but got this error message as follow:
VDSOSYM include/generated/vdso-offsets.h
LDS arch/arm64/kernel/vdso32/vdso.lds
VDSOC32 arch/arm64/kernel/vdso32/vgettimeofday.o
VDSOA32 arch/arm64/kernel/vdso32/sigreturn.o
HOSTCC arch/arm64/kernel/vdso32/../../../arm/vdso/vdsomunge
clang-5.0: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Wignored-optimization-argument]
VDSOL32 arch/arm64/kernel/vdso32/vdso.so.raw
/..//bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386pep i386pe elf64bpf
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/home/tonki/aosp/newkernel/private/msm-google/arch/arm64/kernel/vdso32/Makefile:138: arch/arm64/kernel/vdso32/vdso.so.raw] Error 1
make[2]: *** [arch/arm64/Makefile:242: vdso_prepare] Error 2
make[1]: *** [Makefile:152: sub-make] Error 2
make: *** [Makefile:24: __sub-make] Error 2
I take a look at arch/arm64/kernel/vdso32/Makefilefile,found this line
CC_ARM32 := $(CC) $(CLANG_TARGET_ARM32),it use clang --target=arm-linux-androideabi to link vdso32.raw image but use /usr/bin/ld to link.
My OS is Arch Linux distribution,there was no gcc-arm-linux-androideabi official package which i can install with pacman like Ubuntu's apt tool.
Branch: AOSP kernel/android-msm-crosshatch-4.9-pie-qpr2.
Device: Pixel 3XL.
Kernel-config: official b1c1_defconfig(arch/arm64/configs/b1c1_defconfig).
Question: How can i solve it ? I have no idea here.Thanks!
I try to find the error detail.
I open make verbose message ouput.
clang --target=arm-linux-androideabi -Wp,-MD,arch/arm64/kernel/vdso32/.vdso.so.raw.d -nostdinc -isystem /home/tonki/aosp/newkernel/prebuilts-master/clang/host/linux-x86/clang-4393122/lib64/clang/5.0.1/include -I/home/tonki/aosp/newkernel/private/msm-google/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated -I/home/tonki/aosp/newkernel/private/msm-google/include -I./include -I/home/tonki/aosp/newkernel/private/msm-google/arch/arm64/include/uapi -I/home/tonki/aosp/newkernel/private/msm-google/include/uapi -I./include/generated/uapi -include /home/tonki/aosp/newkernel/private/msm-google/include/linux/kconfig.h -D__KERNEL__ -Qunused-arguments -mlittle-endian -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 -nostdlib -shared -mfloat-abi=soft -Wl,-T arch/arm64/kernel/vdso32/vdso.lds arch/arm64/kernel/vdso32/vgettimeofday.o arch/arm64/kernel/vdso32/sigreturn.o -o arch/arm64/kernel/vdso32/vdso.so.raw
I think clang -target=arm-linux-androideabi was use system'ld to link vdso.so.raw ,so i found this link ,finally i modify like this
in arch/arm64/kernel/vdso32/Makefile:8
CC_ARM32 := $(CC) $(CLANG_TARGET_ARM32) -gcc-toolchain /home/tonki/aosp/newkernel/prebuilts/ndk-r23/toolchains/llvm/prebuilt/linux-x86_64
It finally work!

Building Android msm-3.18 kernel fails on soong-cc-config test on setSdclangVars()

I am trying to build msm-3.18 kernel for msm8996 (Android 8.0.0).
When trying to build from Android source top directory, it fails on running tests.
Following is the trace
FAILED: out/soong/.bootstrap/soong-cc-config/test/test.passed
out/soong/.bootstrap/bin/gotestrunner -p ./build/soong/cc/config -f out/soong/.bootstrap/soong-cc-config/test/test.passed -- \ out/soong/.bootstrap/soong-cc-config/test/test -test.short
panic: read /home/vagrant/android-msm: is a directory
goroutine 1 [running]:
android/soong/cc/config.setSdclangVars()
/home/vagrant/android-msm/build/soong/cc/config/global.go:197 +0x20d4
android/soong/cc/config.init.2()
/home/vagrant/android-msm/build/soong/cc/config/global.go:169 +0xcc9
android/soong/cc/config.init()
/home/vagrant/android-msm/build/soong/cc/config/tidy_test.go:42 +0x3969
main.init()
/home/vagrant/android-msm/out/soong/.bootstrap/soong-cc-
config/test/test.go:34 +0x4e
ninja: build stopped: subcommand failed.
15:22:17 soong bootstrap failed with: exit status 1
make: *** [run_soong_ui] Error 1
make: Leaving directory `/home/vagrant/android-msm'
I guess it has something to do with $SDCLANG_PATH but I need help
You need to register on Qualcomm Developer Network and download their proprietary compiler.
According to instruction on their forum:
Download the Qualcomm LLVM Compiler here: https://developer.qualcomm.com/download/sdllvm/snapdragon-llvm-compiler-android-linux64.tar.gz
Extract Snapdragon-llvm-3.8.4-toolchain.tar.gz
Move toolchains\llvm-Snapdragon_LLVM_for_Android_3.8\prebuilt\linux-x86_64 to prebuilts/clang/host/linux-x86/sdclang-3.8 within your Android build environment.
Add the following lines to your device's BoardConfig:
ifneq ($(HOST_OS),darwin)
SDCLANG := true
SDCLANG_PATH := prebuilts/clang/host/linux-x86/sdclang-3.8/bin
SDCLANG_LTO_DEFS := device/qcom/common/sdllvm-lto-defs.mk
endif
Compile Android.
Here is instruction from their forum: https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-llvm-compiler-android/33437

Using SiftGPU in Android (about ndk, cmake and SSE)

Recently I am trying to use SiftGPU in Android. I am using the Linux. So, first I download a ndk and use the following code to get a standalone toolchain:
sudo sh ./build/tools/make-standalone-toolchain.sh --verbose --platform=android-15 --install-dir=/home/YourUserName/Downloads/my-tool --toolchain=arm-linux-androideabi-4.9
Then, I add the some codes to the CmakeLists.txt so it becomes:
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(SIFTGPU C CXX)
set(NDK_STANDALONE_TOOLCHAIN /home/YourUserName/Downloads/my-tool/)
set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 15)
set(CMAKE_C_COMPILER ${NDK_STANDALONE_TOOLCHAIN}/bin/arm-linux-androideabi-gcc)
set(CMAKE_CXX_COMPILER ${NDK_STANDALONE_TOOLCHAIN}/bin/arm-linux-androideabi-g++)
set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set(CMAKE_FIND_ROOT_PATH ${NDK_STANDALONE_TOOLCHAIN})
add_definitions("--sysroot=${NDK_STANDALONE_TOOLCHAIN}/sysroot")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -Wno-unused-result -Wno-deprecated -fPIC")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-write-strings -Wno-unused-result -Wno-deprecated -fPIC")
ADD_SUBDIRECTORY(src)
After that, I simply go to the directory of SiftGPU, create a new folder, enter it, and run:
cmake ..
Until now, everything seems ok. However, after I run the following command, well, unfortunately, it doesn't work:
make
And here is the error:
[ 9%] Building CXX object src/SiftGPU/CMakeFiles/siftgpu.dir/FrameBufferObject.cpp.o
arm-linux-androideabi-g++: error: unrecognized argument in option '-march=core2'
arm-linux-androideabi-g++: note: valid arguments to '-march=' are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc iwmmxt iwmmxt2 native
arm-linux-androideabi-g++: error: unrecognized command line option '-mfpmath=sse'
src/SiftGPU/CMakeFiles/siftgpu.dir/build.make:62: recipe for target 'src/SiftGPU/CMakeFiles/siftgpu.dir/FrameBufferObject.cpp.o' failed
make[2]: *** [src/SiftGPU/CMakeFiles/siftgpu.dir/FrameBufferObject.cpp.o] Error 1
CMakeFiles/Makefile2:103: recipe for target 'src/SiftGPU/CMakeFiles/siftgpu.dir/all' failed
make[1]: *** [src/SiftGPU/CMakeFiles/siftgpu.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I tried to google it but I didn't get any useful result. It seems that the ndk complier is not compatible with SSE. Does anyone have any idea about this question?
Looks like their CMake files weren't meant to be cross-compiled.
arm-linux-androideabi-g++: error: unrecognized argument in option '-march=core2'
core2 is only valid for x86.
You'll need to take a look through SiftGPU's CMakeLists.txt to see if there are options for cross-compiling, and if not, just remove that flag.

Cross-compiling GLibC 2.24 fails with Error 1

I am trying to cross-compile GLibC 2.24 for ARM (Android) with the gcc-arm-linux-androideabi compiler. Here is the ./configure syntax I used:
../glibc-2.24/configure --prefix=/usr --host=arm-linux-androideabi --with-headers=/usr/include
However, when I run make, it fails with the following error:
In file included from
../sysdeps/arm/libc-tls.c:19:0:
../csu/libc-tls.c: In function '__libc_setup_tls':
../csu/libc-tls.c:191:1: error: '__ARM_NR_set_tls' undeclared (first use in this function)
../csu/libc-tls.c:191:1: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [/home/red/glibc-build/csu/libc-tls.o] Error 1
make[2]: Leaving directory `/home/red/glibc-2.24/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/home/red/glibc-2.24'
make: *** [all] Error 2
I browsed the web on why it happened, didn't find anything. What could be the cause of this error?
I am running Ubuntu 14.04.5 LTS 64-bit.
I am running Ubuntu 14.04.5 LTS 64-bit.
That is a meaningless statepement. 64-bit what? Is it sparc64, aarch64, x86_64, something else?
Most likely you are using x86_64. In that case, you are using configure all wrong. The --host=arm-linux-androideabi tells configure that you are building on an ARM linux machine, which couldn't be further from the truth.
What you likely mean is that you want to build for arm-linux-androideabi target, and in that case the correct configure command is something like:
configure --target=arm-linux-androideabi --prefix=/usr ...
Your --with-headers setting is also very likely to be incorrect: you almost certainly don't want to use /usr/include from x86_64 host to build for arm target.

Error while building Android V2.2[Froyo] Source Code

I'm getting the following error while building the Froyo Code -
No private recovery resources for TARGET_DEVICE passion
target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
host C: libneo_util <= external/clearsilver/util/neo_hash.c
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
/bin/bash: javah: command not found
/bin/bash: javah: command not found
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libclearsilver- jni_intermediates/org_clearsilver_CS.h] Error 127
make: *** Waiting for unfinished jobs....
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libclearsilver- jni_intermediates/org_clearsilver_HDF.h] Error 127
true
Please help me to find out the root cause for this build error.
This is probably a PATH issue. For me I had to do
export PATH=$PATH:/usr/java/jdk1.6.0_25/bin/
To make it work properly.
$ uname -m
x86_64
depending upon x86_64 or XXX32
modified the following files to use m64 for x86_64 and m32 for xxx32 in android directory
/external/clearsilver/cgi/Android.mk
/external/clearsilver/java-jni/Android.mk
/external/clearsilver/util/Android.mk
/external/clearsilver/cs/Android.mk
Edit the above mentioned files using vi or vim editor.
type
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
command in the files below the line "LOCAL_CFLAGS := "
NOTE: If your system is x86_64 download JDK_1.5_update_xx_amd64.bin
Javah is a part of the JDK. Download and install one.

Categories

Resources