Cross-compiling GLibC 2.24 fails with Error 1 - android

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.

Related

Compiling Speex and SpeexDSP for Android 64bit architectures results in "error: impossible constraint in 'asm'"

Google recently announced policy requiring support libraries be recompiled for 64bit support so I'm hoping someone else has also been down this road recently.
I'm trying to compile Speex 1.2 for Android 64bit ARM. I was able to build speex but speexdsp fails.
Here are the steps I took, followed by the failure:
Created a standalone toolchain:
~/android-ndk-r17/build/tools/make-standalone-toolchain.sh --platform=android-21 --install-dir=~/speex-toolchain --arch=arm64
Set my PATH to look first in the toolchain's bin directory
export PATH=~/speex-toolchain/bin:$PATH
Set the CC and RANLIB env vars (maybe not necessary?)
export CC=aarch64-linux-android-gcc
export RANLIB=aarch64-linux-android-ranlib
./configure --host=arm
make
Make fails with:
make all-recursive
make[1]: Entering directory `/Users/spartygw/Downloads/speexdsp-1.2rc3'
Making all in libspeexdsp
make[2]: Entering directory `/Users/spartygw/Downloads/speexdsp-1.2rc3/libspeexdsp'
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
In file included from resample.c:104:0:
resample.c: In function 'resampler_basic_direct_single':
resample_neon.h:148:5: error: impossible constraint in 'asm'
asm volatile (" cmp %[len], #0\n"
^
make[2]: *** [resample.lo] Error 1
make[2]: Leaving directory `/Users/spartygw/Downloads/speexdsp-1.2rc3/libspeexdsp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/Users/spartygw/Downloads/speexdsp-1.2rc3'
make: *** [all] Error 2
Instead of steps 3 and 4, I would suggest just doing ./configure --host=aarch64-linux-android, which takes care of picking up the right tools, and which gets the target architecture right.
As for the main issue, the compilation error, the issue seems to be that speexdsp does support NEON (ARM's SIMD instruction set), but it detects it in configure in one way (by testing if #include <arm_neon.h> works and if NEON compiler intrinsics work, which work the same for both ARM and AArch64). Once it concluded that NEON is supported, it goes on to use it via inline assembly (which is different for ARM and AArch64).
So the conclusion is that speexdsp only supports NEON on ARM (32 bit), not on 64 bit, but speexdsp's configure script enables it incorrectly for AArch64 as well. Add --disable-neon to the configure call, and compilation should succeed.

Building PJSIP: "Make dep" command giving error on Windows7

I have followed all the steps written in the pjsip-startup guide.
But the last step (make dep && make clean && make) is giving me the following errors. I am on Windows 7.
$ make dep && make clean && make
for dir in pjlib/build pjlib-util/build pjnath/build third_party/build pjmedia/b uild pjsip/build pjsip-apps/build ; do \
if make -C $dir dep; then \
true; \
else \
exit 1; \
fi; \
done
make[1]: Entering directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
make -f /cygdrive/d/android/pjproject-2.2.1/build/rules.mak APP=PJLIB app=pjlib depend
make[2]: Entering directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
.pjlib-arm-unknown-linux-androideabi.depend:1: *** multiple target patterns. St op.
make[2]: Leaving directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
Makefile:88: recipe for target 'depend' failed
make[1]: *** [depend] Error 2
make[1]: Leaving directory '/cygdrive/d/android/pjproject-2.2.1/pjlib/build'
Makefile:14: recipe for target 'dep' failed
make: *** [dep] Error 1
Can someone help me to resolve these errors? Thanks!
After some research I come to know that don't use WINDOWS for building the PJSIP v2.x version. Now I am going to install Ubuntu on my system.
The build system is known to work on the following hosts:
Linux, many types of distributions.
MacOS X 10.2 mingw (Win2K, XP)
FreeBSD (must use gmake instead of make)
Building Win32 applications with Cygwin is currently not supported by the autoconf script (there are some conflicts with Windows headers), but one can still use the old configure script by calling ./configure-legacy. More over, cross-compilations might also work with Cygwin using this build system.
See the link for details.

SeAndroid Make - Compile Error‏ system/core/init/init.c: In function 'service_start'

I'm having compiling error while trying to build the SeAndroid 4.2 project.
I'm using Ubuntu 12.04 and gcc4.4
I followed the tutorial on SeAndroid Wiki and downloaded the whole source and after I tried to build a kernel.
seandroid-tegra3-grouper-3.1-jb-mr1.1 because I'm using a Asus TF700T device (with tegra chipset).
As mentioned on SeAndroid wiki page, I type
export PREFIX=/path/to/my/aospclone
cd $PREFIX/kernel/tegra
git checkout seandroid-tegra3-grouper-3.1-jb-mr1.1
make ARCH=arm tegra3_android_defconfig
make ARCH=arm CROSS_COMPILE=$PREFIX/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
The build completes correctly.
Then I'm trying to build my seandroid like :
cd $PREFIX
source build/envsetup.sh
lunch full_grouper-userdebug
make -j8
Then after 20 or 30 minutes of compiling, I got an error
...
system/core/init/init.c: In function 'service_start':
system/core/init/init.c:283:80: error: 'scon' undeclared (first use in this function)
system/core/init/init.c:283:80: note: each undeclared identifier is reported only once for each function it appears in
make: *** [out/target/product/generic/obj/EXECUTABLES/init_intermediates/init.o] Error 1
make: *** Waiting for unfinished jobs....
...
What could be the problem? I tried searching but couldn't find anything useful.

android kernel source code compilation error

I need to customize the kernel of android to run on my Nexus S.
So I download the kernel with branch name "remotes/origin/android-samsung-2.6.35-gingerbread"
I tried to follow the instruction here http://source.android.com/source/building-kernels.html to build the kernel. To do this, I need the cross compile tool.In my target android source code version android-2.3.5_r1, there is no such tool(no prebuilts/ folder). So I downloaded the version 4.1.2 and set up the tool as path prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin .
Then I tried to build my kernel, but I got the following error:
[root#localhost samsung]# make
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC drivers/gpu/pvr/osfunc.o
In file included from drivers/gpu/pvr/osfunc.c:39:0:
include/linux/pagemap.h: In function 'fault_in_pages_readable':
include/linux/pagemap.h:415:16: error: variable 'c' set but not used [-Werror=unused-but-set-variable]
drivers/gpu/pvr/osfunc.c: In function 'OSAccessOK':
drivers/gpu/pvr/osfunc.c:2144:13: error: variable 'linuxType' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[3]: *** [drivers/gpu/pvr/osfunc.o] Error 1
make[2]: *** [drivers/gpu/pvr] Error 2
make[1]: *** [drivers/gpu] Error 2
make: *** [drivers] Error 2
Should I just disable the "all warnings being treated as errors" to solve it? Or maybe I need a better toolchain?
PS: The tool chain of the master branch and branch 4.2 can not be used by me. Because it looks like they are made for a 64-bit OS while my linux is 32-bit
Do you have the path of ARCH=ARM and TOOLCHAIN pointing to the toolchain in \prebuilts folder?
make ARCH=ARM TOOLCHAIN=\<homeofAOSP>\prebuilt\.. herring_defconfig
make clean before you do the make

Configuration error of the GMP library for the android platform

I'm trying to compile GMP for android (arm) but I'm received a very strange error. First, I set up a few things as described another SO question here:
export NDKROOT=/prod/ndk
$NDKROOT/build/tools/make-standalone-toolchain.sh --platform=android-9 -- install-dir=$NDKROOT/android_armeabi
export CC="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-gcc --sysroot=$NDKROOT/android_armeabi/sysroot"
export CXX="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-g++ --sysroot=$NDKROOT/android_armeabi/sysroot"
export AR="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-ar"
export SYSROOT="$NDKROOT/android_armeabi/sysroot"
export PATH="$NDKROOT/android_armeabi/bin":$PATH
Then I simply run ./configure --enable-cxx --prefix=/local/to/where/i/want/to/install --host=arm-none-linux-gnueabi and configuration goes well, with the following being part of the output:
Version: GNU MP 5.1.1
Host type: arm-none-linux-gnueabi
ABI: standard
Install prefix: /location/to/where/i/want/to/install
Compiler: /prod/ndk/android_armeabi/bin/arm-linux-androideabi-gcc -- sysroot=/prod/ndk/android_armeabi/sysroot -std=gnu99
Static libraries: yes
Shared libraries: yes
Up to here it goes well, but when I run make, I receive the following error:
ismpf.cc: In function 'std::istream& operator>>(std::istream&, mpf_ptr)':
ismpf.cc:48:43: error: 'struct lconv' has no member named 'decimal_point'
make[2]: *** [ismpf.lo] Error 1
make[2]: Leaving directory `~/Downloads/gmp-5.1.1/cxx'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `~/Downloads/gmp-5.1.1'
make: *** [all] Error 2
So my first problem is there. Any ideas?
Just out of curiosity, I tried to rerun the same exact configure command as above but using sudo ahead of it. After a few seconds I receive the following:
configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
in this configuration expects 32 bits.
There is the second (and really weird problem that arises).
Just out of curiosity again, I tried to reboot and clear all the variables we created, and simply run the command that the GMP manual recommends:
./configure --prefix=/location/ --enable-cxx --host=arm-linux-androideabi
The ./configure runs, the make goes well, but all 9/9 tests fail when I do make check. Can anybody point me in the right direction with these errors, or about how to try and correctly compile GMP for android? Any help is immensely appreciated.
Unsetting the CFLAGS env var solved the problem for me.

Categories

Resources