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

Dave Korn dave.korn@artimi.com
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 libc.so.6 at the link stage.

  And the reason for that is that, although libc.so.6 is in fact present in $prefix/$target/lib (it is a softlink to libc-2.2.5.so),
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/libc.so itself is a text-file that looks like this:


dk@rainbow /artimi/tools/cygwin/arm-linux/lib> cat libc.so
/* 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/libc.so.6 /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 libc.so is a text file with a hard-coded full path to libc.so.6,
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?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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



More information about the crossgcc mailing list