cross-compilation takes the host library path
Hi All,
I have already cross-compiled some code end libs for arm. Now I am trying to compile the sofia-sip package and I have some trouble with the library path. The problem is that the linker search for some glib in the host path. I have the library for arm and I set the LDFLAGS to reach target arm glib Code:
export LDFLAGS=-L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/lib -L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/usr/lib “/usr/lib/libglib-2.0.so”. I can compile if I temporarily move the arm lib in /usr/lib but when I try to compile an example project using the lib I get I have again the same problem. In the example project makefile the /usr/lib path does not appears. Thank you. |
You need make sure makefile use LDFLAGS when doing linking.
|
Thank you for the answer nini09.
The LDFLAGS are used by the linker as you can see from the output of the make: Code:
Making all in src Thank you |
Quote:
You may be able to either exclude all system paths, or have all those not to be first in the search path. Use a chroot environment : Nothing outside will be used. Or : export LD_LIBRARY_PATH=/home/ermes/workdir/filesys/usr/lib etc. etc. . |
Your toolchain may not be built correctly. A GNU toolchain has a built-in list of places to search for libraries, and other bits. That built-in list is a function of how it was created. Try running
Code:
/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc -print-search-dirs --- rod. |
/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc -g -O2 -o sofsip_cli sofsip_cli.o ssc_input.o -pthread -L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/usr/lib ./.libs/libsofsip-cli-objects.a -L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/lib -L/home/ermes/workdir/filesys/usr/lib /home/ermes/workdir/filesys/usr/lib/libsofia-sip-ua.so /usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so -lrt /usr/lib/libglib-2.0.so -lreadline -lncurses -lpthread -Wl,--rpath -Wl,/home/ermes/workdir/filesys/usr/lib -Wl,--rpath -Wl,/home/ermes/workdir/filesys/usr/lib
Check your red print-out. The libgobject-2.0.so is told to serach at /usr/lib. |
All times are GMT -5. The time now is 06:25 AM. |