This is a backport of commit revision 151568 from trunk into 4.4 the changes for config/t-slibgcc-elf-ver are already available in 4.4 and t-slibgcc-libgcc is available in 4.4.4 so they dont reflect in the patch as they are mentioned in the changelog message. This patch converts the libgcc_s.so to a linker script stub which should let static libgcc link in on affected architectures they should include t-slibgcc-libgcc in there tmake_file variable. For OE its ppc for now which has this problem when using libtool and -Os flag. -Khem 2009-09-09 Jakub Jelinek * config/t-slibgcc-elf-ver (SHLIB_MAKE_SOLINK, SHLIB_INSTALL_SOLINK): New variables. (SHLIB_LINK, SHLIB_INSTALL): Use them. * config/t-slibgcc-libgcc: New file. * config.gcc (powerpc*-*-linux*, powerpc*-*-gnu*): Use it. Index: gcc-4.4.4/gcc/config.gcc =================================================================== --- gcc-4.4.4.orig/gcc/config.gcc 2010-08-27 21:04:18.246053928 +0000 +++ gcc-4.4.4/gcc/config.gcc 2010-08-27 21:48:06.258158384 +0000 @@ -1745,12 +1745,12 @@ tm_file="rs6000/secureplt.h ${tm_file}" fi extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" - tmake_file="t-dfprules rs6000/t-fprules ${tmake_file} rs6000/t-ppccomm rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp" + tmake_file="t-dfprules rs6000/t-fprules ${tmake_file} rs6000/t-ppccomm rs6000/t-linux64 t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp" ;; powerpc64-*-gnu*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h" extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" - tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-gnu rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp" + tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-slibgcc-libgcc t-gnu rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp" ;; powerpc-*-darwin*) extra_options="${extra_options} rs6000/darwin.opt" @@ -1827,17 +1827,17 @@ powerpc-*-linux*altivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h" extra_options="${extra_options} rs6000/sysv4.opt" - tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} t-slibgcc-libgcc rs6000/t-ppccomm" ;; powerpc-*-linux*spe*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h rs6000/e500.h" extra_options="${extra_options} rs6000/sysv4.opt" - tmake_file="t-dfprules rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + tmake_file="t-dfprules rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} t-slibgcc-libgcc rs6000/t-ppccomm" ;; powerpc-*-linux*paired*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/750cl.h" extra_options="${extra_options} rs6000/sysv4.opt" - tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} t-slibgcc-libgcc rs6000/t-ppccomm" ;; powerpc-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" @@ -1856,7 +1856,7 @@ tm_file="${tm_file} rs6000/linux.h" ;; esac - tmake_file="${tmake_file} rs6000/t-fprules-softfp soft-fp/t-softfp" + tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp" if test x${enable_secureplt} = xyes; then tm_file="rs6000/secureplt.h ${tm_file}" fi @@ -1864,14 +1864,14 @@ powerpc-*-gnu-gnualtivec*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h" extra_options="${extra_options} rs6000/sysv4.opt" - tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-slibgcc-libgcc t-gnu rs6000/t-ppccomm" if test x$enable_threads = xyes; then thread_file='posix' fi ;; powerpc-*-gnu*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/gnu.h" - tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-slibgcc-libgcc t-gnu rs6000/t-ppccomm" extra_options="${extra_options} rs6000/sysv4.opt" if test x$enable_threads = xyes; then thread_file='posix'