1 |
commit: 463cad343694a7f87f8b003ee6a1b683406e9d1b |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 25 09:48:40 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 25 09:48:58 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=463cad34 |
7 |
|
8 |
sys-libs/efivar: drop -Werror equivalent for linker |
9 |
|
10 |
ia64's ld does not implement '-z relro'. This means |
11 |
'z relro --fatal-warnings' always fails on ia64. |
12 |
|
13 |
The change drops '--fatal-warnings'. |
14 |
|
15 |
Reported-by: Émeric Maschino |
16 |
Closes: https://bugs.gentoo.org/749963 |
17 |
Package-Manager: Portage-3.0.8, Repoman-3.0.2 |
18 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
19 |
|
20 |
sys-libs/efivar/efivar-37.ebuild | 4 +++ |
21 |
sys-libs/efivar/files/efivar-37-ia64-relro.patch | 37 ++++++++++++++++++++++++ |
22 |
2 files changed, 41 insertions(+) |
23 |
|
24 |
diff --git a/sys-libs/efivar/efivar-37.ebuild b/sys-libs/efivar/efivar-37.ebuild |
25 |
index d85015b8778..40c8e6430d9 100644 |
26 |
--- a/sys-libs/efivar/efivar-37.ebuild |
27 |
+++ b/sys-libs/efivar/efivar-37.ebuild |
28 |
@@ -19,6 +19,10 @@ DEPEND="${RDEPEND} |
29 |
virtual/pkgconfig |
30 |
" |
31 |
|
32 |
+PATCHES=( |
33 |
+ "${FILESDIR}"/${PN}-37-ia64-relro.patch |
34 |
+) |
35 |
+ |
36 |
src_prepare() { |
37 |
default |
38 |
sed -i -e 's/-Werror //' gcc.specs || die |
39 |
|
40 |
diff --git a/sys-libs/efivar/files/efivar-37-ia64-relro.patch b/sys-libs/efivar/files/efivar-37-ia64-relro.patch |
41 |
new file mode 100644 |
42 |
index 00000000000..92a79aec88e |
43 |
--- /dev/null |
44 |
+++ b/sys-libs/efivar/files/efivar-37-ia64-relro.patch |
45 |
@@ -0,0 +1,37 @@ |
46 |
+https://github.com/rhboot/efivar/pull/164 |
47 |
+https://bugs.gentoo.org/749963 |
48 |
+ |
49 |
+From: Sergei Trofimovich <slyfox@g.o> |
50 |
+Date: Mon, 19 Oct 2020 19:05:01 +0100 |
51 |
+Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64 |
52 |
+ compatibility) |
53 |
+ |
54 |
+``` |
55 |
+$ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64 |
56 |
+ia64-unknown-linux-gnu-gcc ... \ |
57 |
+ -o libefivar.so ... |
58 |
+/usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored |
59 |
+collect2: error: ld returned 1 exit status |
60 |
+make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1 |
61 |
+``` |
62 |
+ |
63 |
+ia64 (and a few others) binutils target does not support '-z relro' and always |
64 |
+issues a warning. --fatal-warnings spec option turns the build into always failing one. |
65 |
+ |
66 |
+The change drops `--fatal-warnings` options from gcc.spec entirely. |
67 |
+ |
68 |
+Reported-by: Émeric Maschino |
69 |
+Bug: https://bugs.gentoo.org/749963 |
70 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
71 |
+--- a/gcc.specs |
72 |
++++ b/gcc.specs |
73 |
+@@ -11,7 +11,7 @@ |
74 |
+ + %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} |
75 |
+ |
76 |
+ *self_spec: |
77 |
+-+ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} |
78 |
+++ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-static -static -Wl,-z,relro,-z,now} |
79 |
+ |
80 |
+ *link: |
81 |
+-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie} |
82 |
+++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie} |