Question about gcc/binutils relocatability

Steven W. Orr steveo at syslang.net
Thu Dec 7 16:57:00 EST 2006


On Thursday, Dec 7th 2006 at 13:23 -0500, quoth Paul Lussier:

=>"Steven W. Orr" <steveo at syslang.net> writes:
=>
=>> No, I'm not asking about whether the generated code is
=>> pc-relocatable. I'm asking if the arg to the --prefix option at
=>> configure time stops the compiler from working if the tools are
=>> installed in a different location. Last time I looked, that was an
=>> issue but now I'm wondering.
=>>
=>> If it's no longer an issue then I have to assume that gcc figures out
=>> where its components are by figuring out what direectory its binary is
=>> located in. Can someone please 'splain dis won to me? I am verstumpt.
=>
=>I'm not quite sure what you're asking.  Are you trying to build
=>binutils, or gcc? --prefix should allow you to place something
=>anywhere you want it.  The compiler probably needs to be able to
=>*find* it once you've installed it, which means that the arg to
=>--prefix needs to be in your path, or provived to the compiler when it
=>is run so it knows where to find them.
=>
=>For example, if you're going to build/install binutils like this:
=>
=>  ./configure --prefix=/usr/local/random/path/put/bin/utils/here
=>
=>You need to augment your $PATH with:
=>
=>  PATH=$PATH:/usr/local/random/path/put/bin/utils/here/bin
=>
=>Or, when calling gcc, do something like:
=>
=>  PATH=$PATH:/usr/local/random/path/put/bin/utils/here/bin gcc ....
=>
=>When calling gcc (which can be accomplished by setting that path in a
=>Makefile).
=>
=>Does that help?

Almost, but not quite. A while ago (given my advancing old age) the spec 
file (usually found in $prefix/lib/gcc/i386-redhat-linux/4.0.2 would list 
where the compiler was expected to find all of the needed components, like 
as, ld, cpp, etc. Now I see no spec file and gcc seems to not care where 
it gets installed even if that directory is different from $prefix. It 
seems like the gcc build doesn't care where it runs from and that $prefix 
is only used by make install. The odd thing (as if this isn't odd enuff) 
is that if you run strings on the gcc binary you will see the entire 
configure commandline.

What I was asking for was for confirmation. 


More information about the gnhlug-discuss mailing list