Summary: | gold doesn't take the LD_RUN_PATH environment variable into account | ||
---|---|---|---|
Product: | binutils | Reporter: | Vincent Lefèvre <vincent-srcware> |
Component: | gold | Assignee: | Ian Lance Taylor <ian> |
Status: | NEW --- | ||
Severity: | normal | CC: | abc.mikey, ccoutant, maxim.yegorushkin, sam |
Priority: | P2 | ||
Version: | 2.22 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | patch to take he LD_RUN_PATH environment variable into account |
Description
Vincent Lefèvre
2012-02-27 14:28:05 UTC
I applied the patch to binutils-2.22 to build gcc-4.7.0 using gold linker and a non-standard $PREFIX. It worked for me. Thanks for the patch. The bug is still present in binutils 2.23.52.20130722 (Debian). It can be reproduced by compiling MPFR with the --with-gmp configure option. For instance: ./configure --with-gmp=/usr/local/gmp-debug CFLAGS='-fuse-ld=gold' (/usr/local/gmp-debug being a version different from the /usr one). I got: checking if gmp.h version and libgmp version are the same... (5.0.1/5.1.2) no configure: WARNING: ========================================================== configure: WARNING: 'gmp.h' and 'libgmp' seem to have different versions or configure: WARNING: we cannot run a program linked with GMP (if you cannot configure: WARNING: see the version numbers above). A cause may be different configure: WARNING: GMP versions with different ABI's or the use of --with-gmp configure: WARNING: or --with-gmp-include with a system include directory configure: WARNING: (such as /usr/include or /usr/local/include). configure: WARNING: However since we can't use 'libtool' inside the configure, configure: WARNING: we can't be sure. See 'config.log' for details. configure: WARNING: CC="gcc" configure: WARNING: CFLAGS="-fuse-ld=gold" configure: WARNING: CPPFLAGS=" -I/usr/local/gmp-debug/include" configure: WARNING: LDFLAGS=" -L/usr/local/gmp-debug/lib" configure: WARNING: LIBS="-lgmp " configure: WARNING: Temporary LD_RUN_PATH was "/usr/local/gmp-debug/lib". configure: WARNING: ========================================================== Shouldn't it be LDFLAGS='-fuse-ld=gold'? (In reply to Maxim Yegorushkin from comment #3) > Shouldn't it be LDFLAGS='-fuse-ld=gold'? It may work, but using CFLAGS is better (this is specific to MPFR and to the way GMP builds work). Moreover, in the gcc man page, -fuse-ld is listed under "Optimization Options", not "Linker Options". (In reply to Vincent Lefèvre from comment #4) > (In reply to Maxim Yegorushkin from comment #3) > > Shouldn't it be LDFLAGS='-fuse-ld=gold'? > > It may work, but using CFLAGS is better (this is specific to MPFR and to the > way GMP builds work). Is not whatever works it better? Not trolling. *** Bug 260998 has been marked as a duplicate of this bug. *** Seen from the domain http://volichat.com Page where seen: http://volichat.com/adult-chat-rooms Marked for reference. Resolved as fixed @bugzilla. This is *still* an issue in 2.32! The patch does work but needs applying by hand. Still reproducible with the binutils 2.38.50.20220629-4 Debian package. |