Broken Build (was Re: GCC flags)

Greg Schafer gschafer at zip.com.au
Wed May 14 02:15:14 PDT 2003


On Tue, May 13, 2003 at 12:01:25PM +0100, James Iwanek wrote:
> Greg Schafer wrote:
> 
> > 
> > The difference is that our Ch 6 tools are installed into /usr and that is
> > a default location searched by gcc's configure. I'm not very knowledgeable
> > about cross compilers but surely you would be installing into a
> > non-standard prefix and thus the magic would take effect.
> 
> dont you mean standard prefix?

No. I meant exactly what I said. But now that I think about it, it doesn't
matter what prefix a cross-compiler is installed into. I just re-read a
couple of cross-compiling howto's and realised that the various mechanisms
used, help to ensure the magic will work. It seems to me they CAN be
installed into /usr no problem. (but I am not a cross-compiler expert so may
be talking rubbish)

> > When not using tooldir=/usr, what actually happens is that the tools get
> > installed into both /usr and for e.g. /usr/i686-pc-linux-gnu (actually,
> > they're hardlinks).
> > 
> > In summary, I don't think it matters much but I'm not 100% certain. Prob'
> > best to leave as is.
> 
> wouldnt it be better to just drop tooldir - im sure that would be better for
> the "magic's" point of view? - specially when using crosscompilers

No, pls see above. The cross-compilers are not an issue. But upon
reflection, it may actually be prudent to drop tooldir=/usr in Ch 6. I could
envisage a situation where someone may accidentally overwrite their
/usr/bin/as and /usr/bin/ld. In the "no tooldir=/usr" scenario, the original
tools would still be available in /usr/i686-pc-linux-gnu/bin (they're
hardlinks remember) and thus gcc would still find them. Not only that, as
gcc searches that directory before searching the PATH (and thus /usr/bin),
compiles will be a teeny weeny bit faster (and I mean REALLY teeny weeny :-)

Attached strace proves the point. The stat64 call directly before the one to
"/opt/gnome1/bin/ld" is where ld would be found in the "no tooldir=/usr"
scenario.

I wonder what the distros do.

Greg
-------------- next part --------------
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc/i686-pc-linux-gnu/3.2.1/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc/i686-pc-linux-gnu/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/3.2.1/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/real-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc/i686-pc-linux-gnu/3.2.1/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc/i686-pc-linux-gnu/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/3.2.1/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/collect-ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc/i686-pc-linux-gnu/3.2.1/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc/i686-pc-linux-gnu/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/3.2.1/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/opt/gnome1/bin/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("~/bin/ld", 0xbffff5b0)    = -1 ENOENT (No such file or directory)
32008 stat64("/usr/X11R6/bin/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/local/bin/ld", 0xbffff5b0) = -1 ENOENT (No such file or directory)
32008 stat64("/usr/bin/ld", {st_mode=S_IFREG|0755, st_size=267872, ...}) = 0
32008 access("/usr/bin/ld", X_OK)       = 0


More information about the lfs-dev mailing list