This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: configure --with-sysroot


On Wed, Mar 05, 2003 at 04:41:05PM -0000, gp at qnx dot com wrote:
> Hi.
> 
> I am working on support for QNX6.  Our cross development system files are laid
> out so we don't have a single TARGET_SYSTEM_ROOT, but rather we have a
> TARGET_HEADER_ROOT and a different TARGET_LIB_ROOT.  
> 
> For example, on i386-qnx-nto targetting armle-qnx-nto, we have:
> 
>  ${TARGET_SYSTEM_ROOT}/lib           # Native lib dir
>  ${TARGET_SYSTEM_ROOT}/usr/include   # Common headers for all targets
>  ${TARGET_SYSTEM_ROOT}/armle/lib     # armle lib
>  ${TARGET_SYSTEM_ROOT}/armle/usr/lib # armle usr/lib
> 
> I had set things up to use the existing --with-sysroot, and then in my t-nto
> file I set up a QNX_SYSTEM_ROOT define which I use in my LIB_SPEC to build a
> set of '-L' lines:
> 
>    "-L " QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/lib \
>     -L " QNX_SYSTEM_ROOT "/arm%{EB:be}%{!EB:le}/usr/lib "
> 
> This works except we have incompatible native libs in
> ${TARGET_SYSTEM_ROOT}/lib and ${TARGET_SYSTEM_ROOT}/usr/lib.  Then I get all
> kinds of warnings about "skipping incompatible file libc.so" from the linker.
> 
> 1) Is there a way to prepend (as opposed to append) a search path to gcc's
> binary/lib search path from within the specs file?  Like "-B" does on the
> command line?  That way I can get the armle/lib dirs searched first.
> 
> 2) If not, would anyone strongly oppose my adding a --with-hdrsysroot and
> --with-libsysroot (overridden by --with-sysroot) to gcc/configure.in et al?

The fact is, that's not a sysroot if you have headers in one place and
libs in another; the whole point of sysroot is to "work exactly like it
would if we were a native compiler and rooted at $sysroot".  I don't
recommend working on (1), because if someone requests a library that
isn't available in armeb/usr/lib you'll go on to search for it in
usr/lib, and that's bad news.  It may be easier to just avoid using the
sysroot code for this entirely.

That said, I guess --with-headers-sysroot isn't terribly gross.  I just
don't like it very much.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]