https://sourceware.org/bugzilla/show_bug.cgi?id=22962
--- Comment #9 from Serge Belyshev <belyshev at depni dot sinp.msu.ru> --- (In reply to Jim Wilson from comment #8) > If gcc is configured --enable-multilib, then it appears that you get the -L > options you need for this to work. If gcc is configured --disable-multilib, > then you do not get the -L options needed for this to work. > > Is your gcc configured --disable-multilib? Indeed my gcc configured with --disable-multilib. Hovewer, I see that relevant directories appear in the LIBRARY_PATH and thus on the ld command line. And moreover, adding -L/lib64/lp64d manually on gcc command line does not fix the problem. See relevalnt parts of the output: $ gcc f2.c -o f2 -L/lib64/lp64d -L/usr/lib64/lp64d f1.so -v -Wl,--verbose ... LIBRARY_PATH=/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/:/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/lib/:/lib64/lp64d/:/usr/lib64/lp64d/:/lib/:/usr/lib/ ... /usr/libexec/gcc/riscv64-unknown-linux-gnu/7.3.1/collect2 -plugin /usr/libexec/gcc/riscv64-unknown-linux-gnu/7.3.1/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/riscv64-unknown-linux-gnu/7.3.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc0RVYrX.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -melf64lriscv -dynamic-linker /lib/ld-linux-riscv64-lp64d.so.1 -o f2 /usr/lib64/lp64d/crt1.o /usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/crti.o /usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/crtbegin.o -L/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1 -L/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/lib -L/lib64/lp64d -L/usr/lib64/lp64d /tmp/ccYKxfmX.o f1.so --verbose -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/crtend.o /usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/crtn.o ... SEARCH_DIR("/usr/riscv64-unknown-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/riscv64-unknown-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); ... /usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: warning: libm.so.6, needed by f1.so, not found (try using -rpath or -rpath-link) -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils