------- Comment #13 from hjl dot tools at gmail dot com 2010-09-20 16:56 ------- Here is the deal:
1. The linker default search paths are /lib, /usr/lib. 2. "ld -r" disables the linker default search paths. 3. Gcc always passes -Lmulti-lib-dir to ld when multi-lib is enabled. On Linux/ia32, gcc never passes -L/lib -L/usr/lib to linker. It works with the linker default search paths. But "gcc -r" disables the linker default search paths and "gcc -r -lm" doesn't work. On Linux/x86-64, gcc always passes -Lmulti-lib-dir to linker and "gcc -r -lm" works with -m32/-m64. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45702