implications and importance of --prefix?? what about -static in GCC_EXTRA_CONFIG?

Dan Kegel dank@kegel.com
Tue Nov 4 17:39:00 GMT 2003


Wolcott, Ken (MED, Compuware) wrote:
>   What is the implication/importance of using --prefix for configure?  If the 
> excuteable is written to /usr/local/bin, for example, can't I move the binary 
> to /opt and execute it successfully there?  The crux of the question is that 
> I need to place the cross compiler in clearcase -- does the path I use with 
> --prefix have to exactly match the path of the binaries and libraries that 
> I'm going to place into clearcase?


Try 'strings /usr/bin/gcc | grep lib/gcc/' and you'll see one of the hardcoded
paths.  The part to the left of the lib/gcc in the output is the value
passed to --prefix during configure, I think.

So yes, --prefix has to match exactly where you're going to run,
unless you're using a very recent (say, released May 2003 or later)
gcc, binutils, and gdb and are building them with --with-sysroot.
Using --with-sysroot with a relative path gets rid of the hardcoded
paths built in to the gcc binaries, or so I'm told. I haven't tried it yet.
See http://linuxfromscratch.org/pipermail/lfs-hackers/2003-October/000075.html

>   One more question...if I want a completely static cross toolchain should I 
> place -static in GCC_EXTRA_CONFIG?

Maybe, but adding
    LDFLAGS="-static"
to the make commandline building the final compiler is what's recommended.
See http://sources.redhat.com/ml/crossgcc/2003-10/msg00078.html

- Dan


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list