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]

3.4 patch for PR target/24718 (IA64 HP-UX shared libgcc linking)


This patch is a backport of two patches made to 4.0 that fix a problem
where GCC is using an archive libgcc instead of the shared libgcc (fixed
by the removal of LIBGCC_SPEC from config/ia64/hpux.h) and the problem
where if we start using libgcc_eh the HP linker complains about it being
empty (fixed by the change to mklibgcc.in).  These changes are already
in the 4.0 branch and ToT.

Tested on 3.4 branch with no regressions.

OK for checkin to the 3.4 branch?

Steve Ellcey
sje@cup.hp.com


2005-11-15  Steve Ellcey  <sje@cup.hp.com>

	PR target/24718
	* mklibgcc.in: Create dummy object for libgcc_eh.a
	* config/ia64/hpux.h (LIBGCC_SPEC): Remove.

Index: mklibgcc.in
===================================================================
--- mklibgcc.in	(revision 107022)
+++ mklibgcc.in	(working copy)
@@ -246,6 +246,9 @@ for file in $LIB2ADDEH; do
   fi
 done
 
+# Flag whether we need eh_dummy.c
+need_eh_dummy=
+
 if [ "$SHLIB_LINK" ]; then
   # Those should be in libgcc_eh.a.
   for file in $LIB2ADDEHSTATIC; do
@@ -260,6 +263,23 @@ if [ "$SHLIB_LINK" ]; then
     oname=`echo $name | sed -e 's,.*/,,'`
     libgcc2_eh_shared_objs="$libgcc2_eh_shared_objs ${oname}${objext}"
   done
+
+  # If nothing went into libgcc_eh.a, create a dummy object -
+  # some linkers don't like totally empty archives.
+  if [ -z "$LIB2ADDEHSTATIC" ]; then
+      file=eh_dummy.c
+      libgcc2_eh_static_objs="$libgcc2_eh_static_objs eh_dummy${objext}"
+      need_eh_dummy=1
+
+      for ml in $MULTILIBS; do
+        dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+        flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
+        out="libgcc/${dir}/eh_dummy${objext}"
+
+        echo $out: stmp-dirs $file
+        echo "	$gcc_compile" $flags -fexceptions -c $file -o $out
+      done
+  fi
 fi
 
 for file in $LIB2ADD_ST; do
@@ -648,6 +668,11 @@ done
 
 echo ""
 echo "all: $all"
+
+if [ "$need_eh_dummy" ]; then
+  echo "eh_dummy.c:"
+  echo "	echo 'int __libgcc_eh_dummy;' > \$@"
+fi
 
 echo ""
 echo "install: $all"

Index: config/ia64/hpux.h
===================================================================
--- config/ia64/hpux.h	(revision 107022)
+++ config/ia64/hpux.h	(working copy)
@@ -84,13 +84,6 @@ do {							\
 	  %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
      %{!symbolic:-lc}}"
 
-#ifndef CROSS_COMPILE
-#undef LIBGCC_SPEC
-#define LIBGCC_SPEC \
-  "%{shared-libgcc:%{!mlp64:-lgcc_s}%{mlp64:-lgcc_s_hpux64} -lgcc} \
-   %{!shared-libgcc:-lgcc}"
-#endif
-
 #undef SUBTARGET_SWITCHES
 #define SUBTARGET_SWITCHES \
   { "ilp32",    MASK_ILP32,     "Generate ILP32 code" }, \


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