From 4d0e748417069443292cecced8e96de38a097333 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 14 Mar 2019 13:17:36 +0100 Subject: [PATCH] Resolves: #1688766 --- gcc.spec | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/gcc.spec b/gcc.spec index 874faad..7d49003 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1266,36 +1266,39 @@ mkdir -p %{buildroot}/%{_lib} mv -f %{buildroot}%{_prefix}/%{_lib}/libgcc_s.so.1 %{buildroot}/%{_lib}/libgcc_s-%{gcc_major}-%{DATE}.so.1 chmod 755 %{buildroot}/%{_lib}/libgcc_s-%{gcc_major}-%{DATE}.so.1 ln -sf libgcc_s-%{gcc_major}-%{DATE}.so.1 %{buildroot}/%{_lib}/libgcc_s.so.1 +%ifarch %{ix86} x86_64 ppc ppc64 ppc64p7 ppc64le %{arm} +rm -f $FULLPATH/libgcc_s.so +echo '/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') +GROUP ( /%{_lib}/libgcc_s.so.1 libgcc.a )' > $FULLPATH/libgcc_s.so +%else ln -sf /%{_lib}/libgcc_s.so.1 $FULLPATH/libgcc_s.so +%endif %ifarch sparcv9 ppc +%ifarch ppc +rm -f $FULLPATH/64/libgcc_s.so +echo '/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +OUTPUT_FORMAT('`gcc -m64 -Wl,--print-output-format -nostdlib -r -o /dev/null`') +GROUP ( /lib64/libgcc_s.so.1 libgcc.a )' > $FULLPATH/64/libgcc_s.so +%else ln -sf /lib64/libgcc_s.so.1 $FULLPATH/64/libgcc_s.so %endif +%endif %ifarch %{multilib_64_archs} +%ifarch x86_64 ppc64 ppc64p7 +rm -f $FULLPATH/64/libgcc_s.so +echo '/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +OUTPUT_FORMAT('`gcc -m32 -Wl,--print-output-format -nostdlib -r -o /dev/null`') +GROUP ( /lib/libgcc_s.so.1 libgcc.a )' > $FULLPATH/32/libgcc_s.so +%else ln -sf /lib/libgcc_s.so.1 $FULLPATH/32/libgcc_s.so %endif -%ifarch ppc -rm -f $FULLPATH/libgcc_s.so -echo '/* GNU ld script - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ -OUTPUT_FORMAT(elf32-powerpc) -GROUP ( /lib/libgcc_s.so.1 libgcc.a )' > $FULLPATH/libgcc_s.so -%endif -%ifarch ppc64 ppc64p7 -rm -f $FULLPATH/32/libgcc_s.so -echo '/* GNU ld script - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ -OUTPUT_FORMAT(elf32-powerpc) -GROUP ( /lib/libgcc_s.so.1 libgcc.a )' > $FULLPATH/32/libgcc_s.so -%endif -%ifarch %{arm} -rm -f $FULLPATH/libgcc_s.so -echo '/* GNU ld script - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ -OUTPUT_FORMAT(elf32-littlearm) -GROUP ( /lib/libgcc_s.so.1 libgcc.a )' > $FULLPATH/libgcc_s.so %endif mv -f %{buildroot}%{_prefix}/%{_lib}/libgomp.spec $FULLPATH/ @@ -2958,6 +2961,10 @@ end %endif %changelog +% Thu Mar 14 2019 Jakub Jelinek 9.0.1-0.11 +- turn libgcc_s.so into a linker script on i?86, x86_64, ppc64le and also on + ppc and ppc64 for 64-bit multilib (#1688766) + * Tue Mar 12 2019 Jakub Jelinek 9.0.1-0.10 - update from trunk - PRs bootstrap/89656, c++/70349, c++/86521, c++/87571, c++/87750,