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]

Re: --with-sysroot precise description?


On Tuesday 16 January 2007 17:17, Paul Smith wrote:
> 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.

if you find somewhere, let us know :)

> 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}

so you should have the wrapper invoke gcc with the corresponding --sysroot ... 
i guess the crux of the issue is how you have the directories relative to 
each other

invoking your one compiler could give you the behavior you desire:
...-gcc --sysroot=/.../foo-bar-linux-gnu
...-gcc --sysroot=/.../foo-rab-linux-gnu
...-gcc --sysroot=/.../foo-biz-linux-gnu

the trouble would be in figuring out the /.../ part :)

> 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).

that's pretty much how sysroot works ... it prepends the sysroot path to 
absolute filenames where it makes sense

if your sysroot is set to say /fooie/mooie/, then trying to link a library 
with a path of /lib/libgoo.so will cause the toolchain to look 
at /fooie/mooie/lib/libgoo.so instead of /lib/libgoo.so
-mike

Attachment: pgp00000.pgp
Description: PGP signature


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