On 28 December 2010 15:29, Marc Glisse wrote: > On Tue, 28 Dec 2010, Jonathan Wakely wrote: > >> Read the FAQ: >> http://gcc.gnu.org/faq.html#rpath > > Not everybody agrees that: > $ gcc helloworld.c > $ ./a.out > error: can't find libgcc_s.so.1 > is a nice behaviour, or that LD_LIBRARY_PATH is ok to use, or is root, but > that's not the topic of this thread. Indeed, I'm dubious about it myself, but the FAQ does give the historical reason. >> You can pass linker flags to the gcc build, you just don't use >> LDFLAGS. With gcc 4.5 and later it's --with-boot-ldflags, > > Maybe the paragraph about --with-gmp-lib could include a reference to this > new option, next to the mention of LD_LIBRARY_PATH? Patches welcome :-) I only added the note about LD_LIBRARY_PATH recently, I agree those docs could still do with improvement. >> I'm not >> sure what the right trick is for gcc 4.4, maybe LDFLAGS_FOR_BUILD or >> LDFLAGS_FOR_TARGET > > or BOOT_LDFLAGS? ;-) Aha, that looks more like it, thanks. > (note that it is not enough to export the variable in the environment, > BOOT_LDFLAGS=... has to be passed explicitly on the command line, > apparently)