Ryan Mansfield(deleted)
|
Re: gcc search directories
|
Ryan Mansfield(deleted)
11/24/2010 4:35 PM
post75910
|
Re: gcc search directories
On 10-11-24 03:19 PM, Norton Allen wrote:
> I have some libraries which I configure via autoconf/automake/libtool
> for portability. Unfortunately, those tools expect gcc command line
> arguments, so I can't use qcc. Letting it default to gcc/g++ worked OK
> in 6.4.3, but I'm having a little trouble in 6.5.0 because various
> standard library paths are not included automatically.
>
> gcc -print-search-dirs list a bunch of paths, but nothing under
> $(QNX_TARGET), so it misses $(QNX_TARGET)/x86/lib/gcc/4.4.2/ and hence
> cannot locate -lstdc++, and it does not search $(QNX_TARGET)/x86/lib, so
> it cannot find -lm.
The reason the $QNX_TARGET dirs aren't showing up is being
-print-search-dirs doesn't show the library paths specified in the
target's LINK_SPEC (which is where we add the $QNX_TARGET directories).
If you do:
gcc hw.c -v
<snip>
/usr/qnx650/host/qnx6/x86/usr/lib/gcc/i486-pc-nto-qnx6.5.0/4.4.2/collect2 --sysroot=/usr/qnx650/target/qnx6/
-V -Y P,/usr/qnx650/target/qnx6//lib -Qy -m i386nto --dynamic-linker
/usr/lib/ldqnx.so.2 /usr/qnx650/target/qnx6/x86/lib/crt1.o
/usr/qnx650/target/qnx6/x86/lib/crti.o
/usr/qnx650/host/qnx6/x86/usr/lib/gcc/i486-pc-nto-qnx6.5.0/4.4.2/crtbegin.o
-L/usr/qnx650/host/qnx6/x86/usr/lib/gcc/i486-pc-nto-qnx6.5.0/4.4.2
/tmp/ccA51rAl.o -lgcc -L /usr/qnx650/target/qnx6/x86/lib/gcc/4.4.2 -L
/usr/qnx650/target/qnx6/x86/lib -L /usr/qnx650/target/qnx6/x86/usr/lib
-L /usr/qnx650/target/qnx6/x86/opt/lib -rpath-link
/usr/qnx650/target/qnx6/x86/lib/gcc/4.4.2:/usr/qnx650/target/qnx6/x86/lib:/usr/qnx650/target/qnx6/x86/usr/lib:/usr/
qnx650/target/qnx6/x86/opt/lib
you will see that the $QNX_TARGET directories are searched.
Can you provide your example of libm not being found?
Regards,
Ryan Mansfield
|
|
|