Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - gcc search directories: (3 Items)
   
gcc search directories  
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.

Is there some central location where these paths can be edited, or are they compiled into the binaries?
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
Re: gcc search directories  
Thanks, and I have confirmed that under normal circumstances the libraries are found. In the case where I'm seeing the 
problem, g++ is being invoked by libtool, and libtool is specifying -nostdlib, which obviously is defeating all the 
default search paths. Any idea why libtool would be doing that?