How the hell is that /ever/ supposed to work?

Dave Korn
Thu Jan 26 17:28:00 GMT 2006

      Hi all,

  When we want to build a cross-compiler, the easy way is to just point configure at the pre-built headers and libraries that you
got from your board mfr, and it copies them into your new $prefix and builds a toolchain that uses the copies there, yes?

  My PC broke down.  I copied my environment over to a new machine, but somethings's gone wrong, and all my cross-compiler builds
fail when it tries to configure all-target-libiberty.

  The problem is that configure fails with the "Compiler cannot create executables" error, and the reason for that is that it can't
find at the link stage.

  And the reason for that is that, although is in fact present in $prefix/$target/lib (it is a softlink to,
the linker doesn't look for it there.  The linker looks for it in /usr/local/$target, regardless of what setting of --prefix you
configured with, and that's because $prefix/$target/ itself is a text-file that looks like this:

dk@rainbow /artimi/tools/cygwin/arm-linux/lib> cat
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
GROUP ( /usr/local/arm-linux/lib/ /usr/local/arm-linux/lib/libc_nonshared.a )

  Now I'm really confused.  (I've never looked in a .so file before and so I've only just discovered they can be linker-scripts with
paths to files in them).  How was this _ever_ supposed to work?  If is a text file with a hard-coded full path to,
how could copying libraries into $prefix/$target for a cross build ever work, unless you always used the same $prefix as was used to
configure the prebuilt-binaries that you've obtained?  And why did it _used_ to work on my old machine?

Can't think of a witty .sigline today....

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list