Hi I have got a problem that I can't solve when compiling the android source for ICS. The build gets to a certain stage, then I get the message:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../libtinfo.so when searching for -ltinfo
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../libtinfo.a when searching for -ltinfo
/usr/bin/ld: skipping incompatible /usr/lib/libtinfo.so when searching for -ltinfo
/usr/bin/ld: skipping incompatible /usr/lib/libtinfo.a when searching for -ltinfo
/usr/bin/ld: cannot find -ltinfo
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
make: *** Waiting for unfinished jobs....
I have tried updating/installing libncurses5-dev and libtinfo-dev which were both latest versions and am a bit stuck now. How can I get rid of this to allow the build to happen properly?
I had seen similar issue with gingerbread when compiled on 64bit ubuntu. It got fixed with installation of lib32ncurses5-dev and its dependencies which includes lib32tinfo5-dev. The compiled host adb executable with android is a 32-bit executable.
I have seen same problem on my fedora 16 64bit, same android branch 4.0.3 r1
you might want to try ncurses-devel.i686
yum install ncurses-devel.i686
it solved my problem
I got this issue while I was building mysql statically. So I had to install the static versions of these libraries. For example I did run:
yum search ncurses
Then I installed,
yum install ncurses-static # not exactly the same syntax, but something similar; see search command's output
This might work in Fedora 23
dnf install ncurses-devel
Related
In order to run the bluetooth C program on my ubuntu desktop I installed the libbluetooth-dev using
sudo apt-get install libbluetooth-dev
Then I compiled the code with
gcc -o simplescan simplescan.c -lbluetooth
and it executed just fine. However when I tried to cross compiled it for Android using
arm-linux-gnueabi-gcc -o simplescan simplescan.c -lbluetooth
It gave me the error
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lbluetooth
collect2: error: ld returned 1 exit status
I noticed there was similar post here: Bluetooth programming in Linux - cross compiler issue
But seems like it didn't give a solution, I am still confused how to install the libbluetooth-dev support for the cross compiler.
You cannot link the libbluetooth library that was compiled for a different architecture.
You need to build the libbluetooth library for the architecture your application will be build for.
I installed ubuntu 15.10 (32 and 64) bits on VMware. I am trying to compile vlc using these steps:
https://wiki.videolan.org/AndroidCompile/
I got this error:
checking for LUA... no configure: WARNING: No package 'lua5.2' found,
trying lua 5.1 instead checking for LUA... no configure: WARNING: No
package 'lua5.1' found, trying lua >= 5.1 instead checking for LUA...
yes checking for luac... luac configure: error: You need 32-bits luac
when using lua from contrib. vlc: configure failed
I am a newbie at this. Would someone please explain how to fix this?
sudo apt-get install lua5.1:i386
I am currently compiling Android Linaro build 11.11 (staging-panda) for pandaboard.
In the build process, Android compiles some tools with the host gcc compiler. On my Linux Mint 12 (Ubuntu-11.10 based), I have gcc-4.6 installed by default.
I built Android, everything runs fine, pandaboard booted, but then starting any application will lead to segmentation fault (signal 11 in logcat).
I then learned that Linaro built this release with gcc-4.5, not 4.6 version. I installed it using apt-get. I removed out/ directory and rebuild Android entirely.
The compilation runs fine, but the linker insults me:
g++-4.5 -Wl,-rpath-link=out/target/product/pandaboard/obj/lib -Wl,-rpath,\$ORIGIN/../lib -Lout/host/linux-x86/obj/lib -Wl,--no-undefined -m32 out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o -Wl,--whole-archive -Wl,--no-whole-archive out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a -o out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp
g++-4.5 -Wl,-rpath-link=out/target/product/pandaboard/obj/lib -Wl,-rpath,\$ORIGIN/../lib -Lout/host/linux-x86/obj/lib -Wl,--no-undefined -m32 out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs.o -Wl,--whole-archive -Wl,--no-whole-archive -o out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status
The linker grabs the 64bit libraries of gcc-4.5, although it probably for 32bit version. So far, here are the things I tried, without success:
re-do the package installation following these instructions
sudo ldconfig
reboot my machine
I looked into removing gcc-4.6 to get only gcc-4.5 on my machine.
But synaptic showed so many dependencies needed to be uninstalled,
that I didn't make that step :)
Finally I've been told to install gcc-4.5-multilib and g++-4.5-multilib. It worked, and the build got further. I start the panda, still the apps (eg com.android.launcher) fails to launch. I know this is an assumption, but I think that this segfault is somehow linked to the compiler.
My questions are simple:
Is com.android.launcher cross-compiled or compiled with host 32bit
compiler? What keyword should I look for to find the associated command in the build log?
How can I debug this segmentation fault? In particular, I am looking
for starting com.android.launcher with the "am" command.
Will strace provide valuable information for this issue?
Thanks heaps.
Use gdb. Requirements:
# is the target shell, although being root is not mandatory
$ is the host shell
The app must be compiled in debug mode
LOCAL_CFLAGS += -g
start gdbserver on the target:
# gdbserver :5039 </system/bin/executable>
(or)
# gdbserver :5039 --attach <pid>
forward tcp port to adb connection:
$ adb forward tcp:5039 tcp:5039
start gdbclient on the host:
$ gdbclient :5039 <executable>
If you struggle with gdbclient, check build/envsetup.sh where the function is defined: $ type gdbclient Adding the verbose -v option might be of some help. Also if your executable is not in system/bin, you'll definitely need to modify build/envsetup.sh as it is hard-coded.
Some more information can be found here.
when I run ndk-build, it fails complaining from the following errors:
$ ndk-build
make: /…/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
Compile arm : jpeg <= jcapimin.c
make: /…/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
make: *** [obj/local/armeabi/objs/jpeg/jcapimin.o] Error 127
The problem is that although it says "command not found", "arm-linux-androideabi-gcc" exists in the above path. Even when I run "arm-linux-androideabi-gcc" directly from /…/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/ it gives the same error of "command not found"
I also added ./toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin to my PATH but still getting the same error. Even I tried different versions of ndk (7, 7b, 6b) still same error! seems to me the above gcc is meant for 32bit machines whereas my machine is "Linux 2.6.32-37-server x86_64". but I guess the ndk package should work for both 32 and 64bit. am I right? do I need to compile or build ndk before using it? I assume downloading and unpacking is all I have to do. right? how about sdk? I just downloaded and unpacked it at the same folder that I have my ndk. do I need to configure them to work with each other
I ran into the same problem. You are right, the problem is due to trying to run a 32-bit binary on a 64-bit kernel.
I solved it on Ubuntu 11.10 by installing the 32-bit compatibility libs:
sudo apt-get install ia32-libs
I followed instructions from here. After $ repo sync I tried to build it with $ make, but got this error:
host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1
Using Ubuntu 10.04 LTS. Any help appreciated.
UPD: I found a discussion, that claims, that problem could be that I'm having 64bit libs on my 32bit system.
$ ls -l /usr/lib/libz.so
lrwxrwxrwx 1 root root 20 2010-07-07 17:08 /usr/lib/libz.so -> /lib/libz.so.1.2.3.3
$ file /lib/libz.so.1.2.3.3
/lib/libz.so.1.2.3.3: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
How do I figure out, if that libz.so.1.2.3.3 is the right lib, and in case I have to replace it with the right one, how do I do it?
Also, $ arch says, I have an i686 architecture. Machine, I'm using is Lenovo ThinkPad SL500 with Core 2 DUO CPU.
Everything works now, the solution was to install lib64z1-dev:
sudo apt-get install lib64z1-dev
Edit: now there's another problem, with ClearSilver, described here and finally resolved here.
You need to install libz.
sudo apt-get install libz-dev
libz library has different name in different distros
lib32z1 on debian system