[3.4 PATCH] Fix powerpc*-*-linux* bootstrap (PR target/19019)
Jakub Jelinek
jakub@redhat.com
Wed Feb 23 17:43:00 GMT 2005
On Tue, Feb 15, 2005 at 08:09:02PM +1030, Alan Modra wrote:
> On Mon, Feb 14, 2005 at 06:56:00PM -0500, David Edelsohn wrote:
> > Richard> You can't make this change without breaking binary compatibility
> > Richard> on ELF.
> >
> > Yes, we know.
>
> This patch on top of yours provides versioned symbols for backwards
> compatibility. I've put the new syms as GCC_3.4.4 rather than GCC_4.0
> as I'm assuming you'll port your patch to gcc-3.4 too.
This part of the patch breaks ppc64-linux build on gcc-3_4-branch ATM.
The problem is that on 3.4 branch, there is just one object used in both
libgcc.a and libgcc_s.so and for libgcc.a it is then ld -r'ed with an
autogenerated assembly with .hidden directives to hide the symbols.
But this autogeneration doesn't cope with @ in symbols (just puts
.hidden _xlqadd@GCC_3.4 etc.).
The fundamental problem though is that the .symver directive should never
appear in libgcc.a's objects, only in libgcc_s.so's objects.
For the trunk this shouldn't be hard to fix (will do later on today),
because the libgcc.a and libgcc_s.so object files are compiled separately.
But for 3.4 I think we need something like the patch below, which worked for
me so far to get past stage2 and both libgcc.a and libgcc_s.so looked ok.
Ok to commit if it bootstraps/regtests?
Not sure about AIX, maybe it needs the same changes as in t-linux64.
2005-02-23 Jakub Jelinek <jakub@redhat.com>
PR target/19019
* Makefile.in (LIB2FUNCS_SHARED_EXTRA, LIB2ADD_SH): New.
(libgcc.mk): Depend on $(LIB2ADD_SH), pass LIB2ADD_SH to mklibgcc.
(LIBGCC_DEPS): Add $(LIB2ADD_SH).
* mklibgcc.in: Handle LIB2ADD_SH.
* config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Remove darwin-ldouble.c.
(LIB2FUNCS_STATIC_EXTRA, LIB2FUNCS_SHARED_EXTRA): Set.
* config/rs6000/darwin-ldouble.c: Protect .symver asm also with
defined IN_LIBGCC2_S.
* config/rs6000/darwin-ldouble-shared.c: New file.
--- gcc/Makefile.in.jj 2005-01-19 12:15:42.000000000 +0100
+++ gcc/Makefile.in 2005-02-23 10:03:22.811303371 +0100
@@ -553,6 +553,10 @@ LIB2FUNCS_EXTRA =
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_STATIC_EXTRA =
+# List of extra C and assembler files to add to shared libgcc2.
+# Assembler files should have names ending in `.asm'.
+LIB2FUNCS_SHARED_EXTRA =
+
# Program to convert libraries.
LIBCONVERT =
@@ -1144,14 +1148,17 @@ xlimits.h: glimits.h limitx.h limity.h
LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
+LIB2ADD_SH = $(LIB2FUNCS_SHARED_EXTRA)
-libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext) specs
+libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) $(LIB2ADD_SH) \
+ xgcc$(exeext) specs
objext='$(objext)' \
LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
LIBGCOV='$(LIBGCOV)' \
LIB2ADD='$(LIB2ADD)' \
LIB2ADD_ST='$(LIB2ADD_ST)' \
+ LIB2ADD_SH='$(LIB2ADD_SH)' \
LIB2ADDEH='$(LIB2ADDEH)' \
LIB2ADDEHSTATIC='$(LIB2ADDEHSTATIC)' \
LIB2ADDEHSHARED='$(LIB2ADDEHSHARED)' \
@@ -1187,8 +1194,8 @@ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES)
libgcc.mk $(srcdir)/libgcc2.c $(srcdir)/libgcov.c $(TCONFIG_H) \
$(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs \
tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
- $(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \
- $(srcdir)/config/$(LIB1ASMSRC) \
+ $(LIB2ADD_ST) $(LIB2ADD_SH) $(LIB2ADDEH) $(LIB2ADDEHDEP) \
+ $(EXTRA_PARTS) $(srcdir)/config/$(LIB1ASMSRC) \
$(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h
libgcov.a: libgcc.a; @true
--- gcc/mklibgcc.in.jj 2004-10-23 21:18:15.000000000 +0200
+++ gcc/mklibgcc.in 2005-02-23 10:00:46.010164416 +0100
@@ -13,6 +13,7 @@
# LIBGCOV
# LIB2ADD
# LIB2ADD_ST
+# LIB2ADD_SH
# LIB2ADDEH
# LIB2ADDEHSTATIC
# LIB2ADDEHSHARED
@@ -279,6 +280,26 @@ for file in $LIB2ADD_ST; do
libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}"
done
+if [ "$SHLIB_LINK" ]; then
+ for file in $LIB2ADD_SH; do
+ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
+ oname=`echo $name | sed -e 's,.*/,,'`
+
+ 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}/${oname}${objext}"
+ if [ ${name}.asm = ${file} ]; then
+ flags="$flags -xassembler-with-cpp"
+ fi
+
+ echo $out: stmp-dirs $file
+ echo " $gcc_compile" $flags -c $file -o $out
+ done
+ libgcc2_sh_objs="$libgcc2_sh_objs ${oname}${objext}"
+ done
+fi
+
if [ "$LIBUNWIND" ]; then
libunwind_static_objs=""
libunwind_shared_objs=""
@@ -346,6 +367,9 @@ for ml in $MULTILIBS; do
libgcc_eh_shared_objs="$libgcc_eh_shared_objs libgcc/${dir}/$o"
done
libgcc_sh_objs="$libgcc_objs $libgcc_eh_shared_objs"
+ for o in $libgcc2_sh_objs; do
+ libgcc_sh_objs="$libgcc_sh_objs libgcc/${dir}/$o"
+ done
shlib_deps="$libgcc_sh_objs"
libgcc_st_objs=""
--- gcc/config/rs6000/t-linux64.jj 2004-03-17 16:16:20.000000000 +0100
+++ gcc/config/rs6000/t-linux64 2005-02-23 10:12:09.127809856 +0100
@@ -1,8 +1,9 @@
#rs6000/t-linux64
-LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c \
- $(srcdir)/config/rs6000/darwin-ldouble.c
+LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c
+LIB2FUNCS_STATIC_EXTRA = eabi.S $(srcdir)/config/rs6000/darwin-ldouble.c
+LIB2FUNCS_SHARED_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble-shared.c
TARGET_LIBGCC2_CFLAGS = -mno-minimal-toc -fPIC -specs=bispecs
--- gcc/config/rs6000/darwin-ldouble.c.jj 2005-02-23 09:49:58.000000000 +0100
+++ gcc/config/rs6000/darwin-ldouble.c 2005-02-23 10:14:09.321463511 +0100
@@ -63,7 +63,7 @@ extern long double __gcc_qsub (double, d
extern long double __gcc_qmul (double, double, double, double);
extern long double __gcc_qdiv (double, double, double, double);
-#ifdef __ELF__
+#if defined __ELF__ && defined IN_LIBGCC2_S
/* Provide definitions of the old symbol names to statisfy apps and
shared libs built against an older libgcc. To access the _xlq
symbols an explicit version reference is needed, so these won't
--- gcc/config/rs6000/darwin-ldouble-shared.c.jj 2005-02-23 10:13:19.712274080 +0100
+++ gcc/config/rs6000/darwin-ldouble-shared.c 2005-02-23 10:13:57.428575681 +0100
@@ -0,0 +1,2 @@
+#define IN_LIBGCC2_S 1
+#include "darwin-ldouble.c"
Jakub
More information about the Gcc-patches
mailing list