This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

--with-sysroot precise description?


Ugh.  Can anyone provide me with a precise, complete description of
exactly how --with-sysroot works?  I've read the manual, but it's not
very forthcoming.

So, I'm trying to rebuild a relocatable cross-GCC that can build for
multiple different targets; the only difference in these targets are
different versions of the system headers and libraries, so I would like
to use the same compiler for all of them.  That is, I have something
like:

	bin/...-gcc
	foo-bar-linux-gnu/{include,lib}
	foo-rab-linux-gnu/{include,lib}
	foo-biz-linux-gnu/{include,lib}

And what I want is to invoke the same compiler (underneath: I'm
perfectly happy to have the command invoked be a wrapper script or
something) but have it use different include/lib directories from one of
those target locations depending on something in the command line.

I see that if I use --with-sysroot, the docs say:

    If the specified directory is a subdirectory of ${exec_prefix}, then
    it will be found relative to the GCC binaries if the installation tree
    is moved.

So, in my case above it doesn't seem like sysroot can help me, right?
In fact, I don't see any 100% correct way to do this other than
rebuilding the same darn compiler N completely unnecessary times.


I can't understand how a compiler with so much history and huge user
base is so painful when it comes to relocatability and
cross-compilation!  And it's been done over a couple of times and it
still doesn't seem right to me.

All I want is something that lets me set a prefix on every system path
that the compiler would normally use; something like "gcc
-prefix /foo/bar".  When that happens, every single built-in system path
that is passed to gcc subcommands would be prefixed with that path,
so /usr/include becomes /foo/bar/usr/include, /lib becomes /foo/bar/lib
etc.  To me this seems powerful enough to supercede all the current
functionality plus any other setup you want (obviously with some
rearrangement of the target system directories).

What am I missing?  Why is this such a hard problem to solve?

-- 
-----------------------------------------------------------------------------
 Paul D. Smith <psmith@netezza.com>                       http://netezza.com
 "Please remain calm--I may be mad, but I am a professional."--Mad Scientist
-----------------------------------------------------------------------------
      These are my opinions--Netezza takes no responsibility for them.

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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