Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
Date: Sun, 16 Jan 2022 15:30:56
Message-Id: 1642347047.90f51c95eb90eea6c50624aad0a94143de827d8a.floppym@gentoo
1 commit: 90f51c95eb90eea6c50624aad0a94143de827d8a
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 16 15:25:37 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 16 15:30:47 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90f51c95
7
8 sys-libs/efivar: add 38
9
10 Closes: https://bugs.gentoo.org/831302
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 sys-libs/efivar/Manifest | 1 +
14 sys-libs/efivar/efivar-38.ebuild | 58 ++++++++++++++++++++++++
15 sys-libs/efivar/files/efivar-38-ia64-relro.patch | 45 ++++++++++++++++++
16 3 files changed, 104 insertions(+)
17
18 diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
19 index c8afcced10cb..450ec0b1c8a3 100644
20 --- a/sys-libs/efivar/Manifest
21 +++ b/sys-libs/efivar/Manifest
22 @@ -1 +1,2 @@
23 DIST efivar-37.tar.bz2 109431 BLAKE2B 813d477d31562b773f6e19f20e9e237b94beed437ce221771770e7d46ff0e657530285f035dc942cc20609185be92dc50319bfe8e10dee642c8bd88403ef6ffe SHA512 305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4
24 +DIST efivar-38.tar.bz2 320221 BLAKE2B 0b96f3d71ddc2246e6a11a5cd32af3d007823c4a283186a428c3f145cd74425a31bd22c4671ad1ab252a3c572991bb1698381cb8bdf51efcbebd62befdc6c070 SHA512 c2f17297c863ece134a9dd758d237fd2df8c8d072f87af1d0bf2bcf9acfc7a53c25597f03fd4fb8cc664b205743d4ffa0ef1b068d0f73c58fa573d40993f3155
25
26 diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
27 new file mode 100644
28 index 000000000000..60060d4785fc
29 --- /dev/null
30 +++ b/sys-libs/efivar/efivar-38.ebuild
31 @@ -0,0 +1,58 @@
32 +# Copyright 2014-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit toolchain-funcs
38 +
39 +DESCRIPTION="Tools and library to manipulate EFI variables"
40 +HOMEPAGE="https://github.com/rhinstaller/efivar"
41 +SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2"
42 +
43 +LICENSE="GPL-2"
44 +SLOT="0/1"
45 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc64 ~riscv ~x86"
46 +IUSE="test"
47 +RESTRICT="!test? ( test )"
48 +
49 +BDEPEND="
50 + app-text/mandoc
51 + test? ( sys-boot/grub:2 )
52 +"
53 +RDEPEND="
54 + dev-libs/popt
55 +"
56 +DEPEND="${RDEPEND}
57 + >=sys-kernel/linux-headers-3.18
58 + virtual/pkgconfig
59 +"
60 +
61 +src_prepare() {
62 + local PATCHES=(
63 + "${FILESDIR}"/${PN}-38-ia64-relro.patch
64 + )
65 + default
66 +}
67 +
68 +src_configure() {
69 + tc-export CC
70 + export CC_FOR_BUILD=$(tc-getBUILD_CC)
71 +
72 + tc-ld-disable-gold
73 +
74 + export libdir="/usr/$(get_libdir)"
75 +
76 + # https://bugs.gentoo.org/562004
77 + unset LIBS
78 +
79 + # Avoid -Werror
80 + export ERRORS=
81 +
82 + if [[ -n ${GCC_SPECS} ]]; then
83 + # The environment overrides the command line.
84 + GCC_SPECS+=":${S}/src/include/gcc.specs"
85 + fi
86 +
87 + # Used by tests/Makefile
88 + export GRUB_PREFIX=grub
89 +}
90
91 diff --git a/sys-libs/efivar/files/efivar-38-ia64-relro.patch b/sys-libs/efivar/files/efivar-38-ia64-relro.patch
92 new file mode 100644
93 index 000000000000..2f3686cac444
94 --- /dev/null
95 +++ b/sys-libs/efivar/files/efivar-38-ia64-relro.patch
96 @@ -0,0 +1,45 @@
97 +From 145c6593fa9206cc27229a9a40c49e4bed046739 Mon Sep 17 00:00:00 2001
98 +From: Sergei Trofimovich <slyfox@g.o>
99 +Date: Mon, 19 Oct 2020 19:05:01 +0100
100 +Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64
101 + compatibility)
102 +MIME-Version: 1.0
103 +Content-Type: text/plain; charset=UTF-8
104 +Content-Transfer-Encoding: 8bit
105 +
106 +```
107 +$ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64
108 +ia64-unknown-linux-gnu-gcc ... \
109 + -o libefivar.so ...
110 +/usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored
111 +collect2: error: ld returned 1 exit status
112 +make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1
113 +```
114 +
115 +ia64 (and a few others) binutils target does not support '-z relro' and always
116 +issues a warning. --fatal-warnings spec option turns the build into always failing one.
117 +
118 +The change drops `--fatal-warnings` option from gcc.spec entirely.
119 +
120 +Rejected upstream in https://github.com/rhboot/efivar/pull/164.
121 +
122 +Reported-by: Émeric Maschino
123 +Bug: https://bugs.gentoo.org/749963
124 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
125 +---
126 + src/include/gcc.specs | 2 +-
127 + 1 file changed, 1 insertion(+), 1 deletion(-)
128 +
129 +diff --git a/src/include/gcc.specs b/src/include/gcc.specs
130 +index ef28e2b..4deead5 100644
131 +--- a/src/include/gcc.specs
132 ++++ b/src/include/gcc.specs
133 +@@ -5,4 +5,4 @@
134 + + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -grecord-gcc-switches
135 +
136 + *link:
137 +-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
138 +++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
139 +--
140 +2.34.1
141 +