commit:     6c5ced06c025ddc8b34d02c7597d0f0f0932393f
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 14 07:12:22 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Jul 14 07:12:22 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6c5ced06

10.1.0: use crtendS.o on sparc-linux-pie

This should fix TEXTREL warning when linking most binaries on sparc.

Bug: https://gcc.gnu.org/PR96190
Bug: https://bugs.gentoo.org/619706
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch | 49 ++++++++++++++++++++++++++++
 10.1.0/gentoo/README.history                 |  3 ++
 2 files changed, 52 insertions(+)

diff --git a/10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch 
b/10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch
new file mode 100644
index 0000000..059f744
--- /dev/null
+++ b/10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch
@@ -0,0 +1,49 @@
+https://gcc.gnu.org/PR96190
+https://bugs.gentoo.org/619706
+
+From 6acaa3c1c1e6202af9871aa304ed772939d51311 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+Date: Tue, 14 Jul 2020 07:48:42 +0100
+Subject: [PATCH] sparc/sparc64: use PIE_SPEC to select crtendS.o [PR96190]
+
+In --enable-default-pie mode compiler should switch from
+using crtend.o to crtendS.o. On sparc it is especially visible
+because crtend.o contains PIC-unfriendly code.
+
+gcc:
+
+2020-07-14  Sergei Trofimovich  <[email protected]>
+
+       PR driver/96190
+       * config/sparc/linux.h: Use PIE_SPEC to select crtendS.o.
+       * config/sparc/linux64.h: ditto
+---
+ gcc/config/sparc/linux.h   | 2 +-
+ gcc/config/sparc/linux64.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #undef  ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+-  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
++  "%{shared|" PIE_SPEC ":crtendS.o%s;:crtend.o%s} crtn.o%s\
+    %{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+ 
+ /* -mcpu=native handling only makes sense with compiler running on
+--- a/gcc/config/sparc/linux64.h
++++ b/gcc/config/sparc/linux64.h
+@@ -52,7 +52,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #undef        ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+-  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
++  "%{shared|" PIE_SPEC ":crtendS.o%s;:crtend.o%s} crtn.o%s\
+    %{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+ 
+ /* The default code model.  */
+-- 
+2.27.0
+

diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history
index 6fab577..f081231 100644
--- a/10.1.0/gentoo/README.history
+++ b/10.1.0/gentoo/README.history
@@ -1,3 +1,6 @@
+4              TODO
+       + 37_all_sparc_pie_TEXTREL.patch
+
 3              04 July 2020
        + 33_all_avx512-scalar-PR95528.patch
        + 34_all_cet-cross-x86.patch

Reply via email to