On Tuesday 24 February 2009 13:41:30 Joseph S. Myers wrote: > On Mon, 23 Feb 2009, Rob Landley wrote: > > +config HARDWIRED_ABSPATH > > + string "Hardwire absolute paths into linker scripts" > > + default y > > + help > > + This prepends absolute paths to the libraries mentioned in linker > > + scripts such as libc.so. > > + > > + This is a build time optimization. It has no impact on dynamic > > + linking at runtime, which doesn't use linker scripts. > > + > > + You must disable this to use uClibc with a relocatable toolchain, > > I don't think this is an adequate explanation of the option. > > My understanding is that with the option enabled the absolute paths > embedded will be ones based on RUNTIME_PREFIX (typically /) and > DEVEL_PREFIX (typically /usr), while the libraries are installed under > PREFIX (the path which gets relocated). The compiler and linker will be > configured to find their sysroot at PREFIX and if the configured > --with-sysroot was a subdirectory of the configured --prefix then the > whole toolchain can be relocated and the sysroot will still be found. > Finally, when the linker is configured with a sysroot it will > automatically interpret a path such as /lib/whatever in a linker script as > meaning $sysroot/lib/whatever, and so the correct library will be found > based on the reference from the linker script. > > In summary, references to PREFIX in a linker script are what would cause > relocation problems, but references to RUNTIME_PREFIX and DEVEL_PREFIX do > not with a properly configured sysrooted toolchain, and this configure > option only affects references to RUNTIME_PREFIX and DEVEL_PREFIX; nothing > creates references to PREFIX.
A) Not all toolchains use --with-sysroot. (And I'm not just talking about tinycc, pcc, and llvm.) B) An absolute path that isn't always treated as an absolute path is kind of disgusting black magic. Rob _______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
