Zack Weinberg - ia64-hpux libgcc_eh fixes (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- From: Zack Weinberg
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 19 Feb 2005 10:17:46 -0800
- Subject: ia64-hpux libgcc_eh fixes
Richard Sandiford's patch to fix problems with shared libgcc leaves the ia64-hpux 64-bit multilib in a mildly broken state, because the name libgcc_s_hpux64.so is wired into config/ia64/hpux.h.
Removing that exposes another problem, which is probably why this target had its own definition of LIBGCC_SPEC in the first place: on this target libgcc_eh.a has nothing in it, and the HP static linker objects to completely empty .a libraries. The simplest fix I could think of is to add a dummy object to libgcc_eh.a when it would otherwise be empty.
Bootstrapped ia64-hp-hpux11.22, and verified that the 64-bit multilib now works. Committed.
zw
* mklibgcc.in: If libgcc_eh.a would be empty, put a dummy
object inside.
* config/ia64/hpux.h: Don't define LIBGCC_SPEC.===================================================================
Index: mklibgcc.in
--- mklibgcc.in 19 Feb 2005 11:43:56 -0000 1.84
+++ mklibgcc.in 19 Feb 2005 18:11:25 -0000
@@ -94,6 +94,9 @@ libgcov_c_dep='stmp-dirs $(srcdir)/libgc
# Dependencies for fp-bit.c
fpbit_c_dep='stmp-dirs config.status tsystem.h'
+# Flag whether we need eh_dummy.c
+need_eh_dummy=
+
if [ "$SHLIB_LINK" ]; then
# Test -fvisibility=hidden. We need both a -fvisibility=hidden on
# the command line, and a #define to prevent libgcc2.h etc from
@@ -540,6 +543,19 @@ for ml in $MULTILIBS; do
fi
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
+ out="libgcc/${dir}/eh_dummy${objext}"
+ need_eh_dummy=1
+
+ echo out:stmp−dirsout: stmp-dirs out:stmp−dirsfile
+ echo " gcccompile"gcc_compile" gcccompile"flags '$(vis_hide)' -fexceptions -c file−ofile -o file−oout
+ echo libgcceha:libgcc_eh_a: libgcceha:out
+ fi
+
+
else # no libgcc_eh.a
for file in $LIB2ADDEH; do
case $file in
@@ -760,6 +776,11 @@ echo " if [ -d $$d ]; then true; els
echo " done"
echo " if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi"
+if [ "$need_eh_dummy" ]; then
+ echo "eh_dummy.c:"
+ echo " echo 'struct eh_dummy;' > $@"
+fi
+
echo ""
echo "install: all"
for ml in $MULTILIBS; do
Index: config/ia64/hpux.h
--- config/ia64/hpux.h 11 Feb 2005 19:55:07 -0000 1.46
+++ config/ia64/hpux.h 19 Feb 2005 18:11:30 -0000
@@ -91,13 +91,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] |