From 1152b11f44bf7922fae25685d884a52d86c0b74b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 24 Feb 2005 10:26:59 +0100 Subject: [PATCH] re PR target/19019 (GCC ldouble format incompatibility with XLC long double) 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. From-SVN: r95495 --- gcc/ChangeLog | 13 ++++++++++++ gcc/Makefile.in | 13 +++++++++--- gcc/config/rs6000/darwin-ldouble-shared.c | 2 ++ gcc/config/rs6000/darwin-ldouble.c | 2 +- gcc/config/rs6000/t-linux64 | 5 +++-- gcc/mklibgcc.in | 24 +++++++++++++++++++++++ 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 gcc/config/rs6000/darwin-ldouble-shared.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1cc1137bf91..6abb9a5dbcf7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2005-02-24 Jakub Jelinek + + 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. + 2005-02-23 Michael Beach PR target/20159 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7fcc7ed12a19..30815af41866 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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) stmp-int-hdrs $(STMP_FIXPROTO) \ 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 diff --git a/gcc/config/rs6000/darwin-ldouble-shared.c b/gcc/config/rs6000/darwin-ldouble-shared.c new file mode 100644 index 000000000000..8ceea0ac55b0 --- /dev/null +++ b/gcc/config/rs6000/darwin-ldouble-shared.c @@ -0,0 +1,2 @@ +#define IN_LIBGCC2_S 1 +#include "darwin-ldouble.c" diff --git a/gcc/config/rs6000/darwin-ldouble.c b/gcc/config/rs6000/darwin-ldouble.c index 60c17681b11f..210f2d6a3310 100644 --- a/gcc/config/rs6000/darwin-ldouble.c +++ b/gcc/config/rs6000/darwin-ldouble.c @@ -63,7 +63,7 @@ extern long double __gcc_qsub (double, double, double, double); 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 diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 index 77ba93e91525..6d1e6f469402 100644 --- a/gcc/config/rs6000/t-linux64 +++ b/gcc/config/rs6000/t-linux64 @@ -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 diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in index da480ab241be..143b4e83ba18 100644 --- a/gcc/mklibgcc.in +++ b/gcc/mklibgcc.in @@ -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="" -- 2.47.2