PATCH: Put libunwind.a in libgcc_s.so: versioning of _Unwind_*() symbols

H. J. Lu hjl@lucon.org
Wed Apr 21 06:09:00 GMT 2004


On Tue, Apr 20, 2004 at 05:26:02PM -0700, Jim Wilson wrote:
> 
> What is wrong with putting the symbols back in libgcc_s.so?  If you link
> with libunwind before libgcc, programs will use the libunwind versions
> won't they?
> 

This patch puts libunwind.a in libgcc_s.so.1. The test result is at

http://gcc.gnu.org/ml/gcc-testresults/2004-04/msg00974.html

We can do it on ia64 since PIC is default on ia64.


H.J.
-------------- next part --------------
2004-04-20  H.J. Lu  <hongjiu.lu@intel.com>

	* config.gcc (ia64*-*-linux*): Use ia64/t-libunwind instead of
	t-libunwind.

	* config/ia64/t-libunwind: New file.

	* config/t-libunwind (LIB2ADDEH): Add $(srcdir)/gthr-gnat.c.

--- gcc/config.gcc.libunwind	2004-04-20 20:00:40.000000000 -0700
+++ gcc/config.gcc	2004-04-20 21:26:04.000000000 -0700
@@ -1264,7 +1264,7 @@ ia64*-*-linux*)
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	if test x"$use_libunwind_exceptions" = xyes; then
-	  tmake_file="$tmake_file t-libunwind"
+	  tmake_file="$tmake_file ia64/t-libunwind"
 	fi
 	;;
 ia64*-*-hpux*)
--- gcc/config/ia64/t-libunwind.libunwind	2004-04-20 21:27:56.000000000 -0700
+++ gcc/config/ia64/t-libunwind	2004-04-20 21:32:43.000000000 -0700
@@ -0,0 +1,13 @@
+# Override the default value from t-slibgcc-elf-ver to include
+# libunwind.a so that the resulting libgcc_s.so is 100% backward
+# compatible.
+# FIXME: libunwind.o is a kludge. 
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/gthr-gnat.c libunwind.o
+
+libunwind.o: $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -nostdlib -nostartfiles -r -o $@ \
+	  -Wl,--whole-archive \
+	  `$(GCC_FOR_TARGET) --print-file-name=libunwind.a`
+	mkdir -p libgcc
+	cp $@ libgcc
--- gcc/config/t-libunwind.libunwind	2003-12-23 10:02:54.000000000 -0800
+++ gcc/config/t-libunwind	2004-04-20 21:25:51.000000000 -0700
@@ -2,4 +2,5 @@
 # so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
 # libunwind.
 SHLIB_LC = -lunwind -lc
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/gthr-gnat.c


More information about the Gcc mailing list