From patchwork Sun Sep 9 19:29:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Use -lgcc in libgcc_so linker script Date: Sun, 09 Sep 2012 09:29:10 -0000 From: Andreas Schwab X-Patchwork-Id: 182646 Message-Id: To: gcc-patches@gcc.gnu.org The libgcc_s.so linker script (as used by targets using t-slibgcc-libgcc) refers to libgcc.a, which causes the linker to search in cwd first, where it might find a completely unrelated libgcc.a (eg. while building a cross gcc). Use -lgcc instead so that it is searched on the library path. Andreas. PR target/46191 * config/t-slibgcc-libgcc (SHLIB_MAKE_SOLINK): Use -lgcc instead of libgcc.a. --- libgcc/config/t-slibgcc-libgcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/t-slibgcc-libgcc b/libgcc/config/t-slibgcc-libgcc index ec36b27..0668226 100644 --- a/libgcc/config/t-slibgcc-libgcc +++ b/libgcc/config/t-slibgcc-libgcc @@ -25,7 +25,7 @@ SHLIB_MAKE_SOLINK = \ (echo "/* GNU ld script"; \ echo " Use the shared library, but some functions are only in"; \ echo " the static library. */"; \ - echo "GROUP ( $(SHLIB_SONAME) libgcc.a )" \ + echo "GROUP ( $(SHLIB_SONAME) -lgcc )" \ ) > $(SHLIB_DIR)/$(SHLIB_SOLINK) SHLIB_INSTALL_SOLINK = \ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SOLINK) \