This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use -lgcc in libgcc_so linker script


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) \
-- 
1.7.12

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]