* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2016-02-12 18:44 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2016-02-12 18:44 UTC (permalink / raw
To: gentoo-commits
commit: 8e88e53253add3497e2abd730deb803f2079cdc6
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 12 18:43:28 2016 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Feb 12 18:43:45 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e88e532
sys-libs/efivar: Bump to 0.22
Package-Manager: portage-2.2.27_p57
sys-libs/efivar/Manifest | 1 +
sys-libs/efivar/efivar-0.22.ebuild | 44 ++++++++++++++++++++++++++++++++++
sys-libs/efivar/files/0.22-flags.patch | 41 +++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+)
diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
index a3cb255..ab7bf59 100644
--- a/sys-libs/efivar/Manifest
+++ b/sys-libs/efivar/Manifest
@@ -1 +1,2 @@
DIST efivar-0.21.tar.bz2 66677 SHA256 04b9b9de9d9a1a013395400438a033daf4a4290f497ec5be04a120e2ac535094 SHA512 851b5e29c2dab213bb81c6ea5c5c211d36fb6846de8aa1086b0657f06917c2f93bf154aa3a4c2dda22103bdf1d67ca877f9771dc3f979c9311ca24e0bc09492a WHIRLPOOL d6cdb2e2f047a22677d046581490ee4e64a2ac0631be8e41bf6250241b2554f62ddf81226fa3970ee80ebb9ec62665ca21f4fec94cc5ebe05414b0c674ad38dd
+DIST efivar-0.22.tar.bz2 67384 SHA256 74f9700039c2c77b468ab2e174c17eb97bd5ee427d22b68a0ae0dbf8fd2d6e32 SHA512 45b1b33e6928415f60de460086e6015e62ee65cab531b578b5a7ea78fd9c593220d8df00ee262171eb1ae3fc1bd1b733ce2c87c1dd91c2ac16a59c2764146e81 WHIRLPOOL 7000191aea4dd37639168e279e00ac4493683c956775d5887f37a860b25a76d3b1d1347b596f2cbb321673de7be3e77fcd10a3f155d483c06a0883a6b47fa8ee
diff --git a/sys-libs/efivar/efivar-0.22.ebuild b/sys-libs/efivar/efivar-0.22.ebuild
new file mode 100644
index 0000000..e811cf3
--- /dev/null
+++ b/sys-libs/efivar/efivar-0.22.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/rhinstaller/efivar"
+SRC_URI="https://github.com/rhinstaller/${PN}/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+
+RDEPEND="dev-libs/popt"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-3.18"
+
+src_prepare() {
+ epatch "${FILESDIR}/0.21-nvme_ioctl.h.patch"
+ epatch "${FILESDIR}/0.22-flags.patch"
+ epatch_user
+}
+
+src_configure() {
+ tc-export CC
+ export libdir="/usr/$(get_libdir)"
+ unset LIBS # Bug 562004
+}
+
+src_compile() {
+ # Avoid building static binary/libs
+ opts=(
+ BINTARGETS=efivar
+ STATICLIBTARGETS=
+ )
+ emake "${opts[@]}"
+}
+
+src_install() {
+ emake "${opts[@]}" DESTDIR="${D}" install
+}
diff --git a/sys-libs/efivar/files/0.22-flags.patch b/sys-libs/efivar/files/0.22-flags.patch
new file mode 100644
index 0000000..df49f43
--- /dev/null
+++ b/sys-libs/efivar/files/0.22-flags.patch
@@ -0,0 +1,41 @@
+From 5bc17590cb096340fc695da3020883130437d745 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 12 Feb 2016 13:22:13 -0500
+Subject: [PATCH] Make.defaults: Improve gcc/clang detection
+
+The old filter only matched "gcc" or "clang".
+
+The new findstring call matches any occurance of gcc or clang. This is
+useful when CC includes the full host tuple, like x86_64-pc-linux-gnu-gcc.
+
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ Make.defaults | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Make.defaults b/Make.defaults
+index bf814b8..5aed21e 100644
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -25,14 +25,14 @@ PKGS =
+ clang_cflags =
+ gcc_cflags = -specs=$(TOPDIR)/gcc.specs
+ cflags = $(CFLAGS) -I${TOPDIR}/src/include/efivar/ \
+- $(if $(filter $(CC),clang),$(clang_cflags),) \
+- $(if $(filter $(CC),gcc),$(gcc_cflags),) \
++ $(if $(findstring clang,$(CC)),$(clang_cflags),) \
++ $(if $(findstring gcc,$(CC)),$(gcc_cflags),) \
+ $(call pkg-config-cflags)
+ clang_ccldflags =
+ gcc_ccldflags =
+ ccldflags = $(cflags) $(CCLDFLAGS) $(LDFLAGS) \
+- $(if $(filter $(CCLD),clang),$(clang_ccldflags),) \
+- $(if $(filter $(CCLD),gcc),$(gcc_ccldflags),) \
++ $(if $(findstring clang,$(CCLD)),$(clang_ccldflags),) \
++ $(if $(findstring gcc,$(CCLD)),$(gcc_ccldflags),) \
+ $(call pkg-config-ccldflags)
+ SOFLAGS=-shared
+ LDLIBS=$(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs)
+--
+2.7.1
+
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2018-01-25 13:45 Lars Wendler
0 siblings, 0 replies; 8+ messages in thread
From: Lars Wendler @ 2018-01-25 13:45 UTC (permalink / raw
To: gentoo-commits
commit: babb2eb03e85ad5272d62f9e976cf901b3d06343
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 25 13:42:30 2018 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Jan 25 13:45:08 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=babb2eb0
sys-libs/efivar: Revbump to fix efi_guid_ux_capsule
with a patch from upstream. This required for sys-apps/fwupdate-10
Permissin kindly granted by floppym.
Package-Manager: Portage-2.3.20, Repoman-2.3.6
sys-libs/efivar/efivar-32-r1.ebuild | 42 +++++++++++++++
.../files/efivar-32-efi_guid_ux_capsule.patch | 59 ++++++++++++++++++++++
2 files changed, 101 insertions(+)
diff --git a/sys-libs/efivar/efivar-32-r1.ebuild b/sys-libs/efivar/efivar-32-r1.ebuild
new file mode 100644
index 00000000000..2ae5a0644a8
--- /dev/null
+++ b/sys-libs/efivar/efivar-32-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/rhinstaller/efivar"
+#SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2"
+SRC_URI="https://github.com/rhinstaller/efivar/archive/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/1"
+KEYWORDS="~amd64 ~arm64 ~ia64 ~x86"
+
+RDEPEND="dev-libs/popt"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-3.18
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-efi_guid_ux_capsule.patch"
+)
+
+src_prepare() {
+ default
+ sed -i -e s/-Werror// gcc.specs || die
+}
+
+src_configure() {
+ tc-export CC
+ tc-ld-disable-gold
+ export libdir="/usr/$(get_libdir)"
+ unset LIBS # Bug 562004
+
+ if [[ -n ${GCC_SPECS} ]]; then
+ # The environment overrides the command line.
+ GCC_SPECS+=":${S}/gcc.specs"
+ fi
+}
diff --git a/sys-libs/efivar/files/efivar-32-efi_guid_ux_capsule.patch b/sys-libs/efivar/files/efivar-32-efi_guid_ux_capsule.patch
new file mode 100644
index 00000000000..8a5a72f66fb
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-32-efi_guid_ux_capsule.patch
@@ -0,0 +1,59 @@
+From cd732494ba7685feaf71b9ee58619ca6aef39fc9 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Tue, 12 Sep 2017 10:45:31 -0400
+Subject: [PATCH] Make efi_guid_ux_capsule actually work.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ src/abignore | 11 ++++++++++-
+ src/guids.txt | 2 +-
+ src/libefivar.map.in | 4 ++++
+ 3 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/src/abignore b/src/abignore
+index 74b5160..479b5c3 100644
+--- a/src/abignore
++++ b/src/abignore
+@@ -14,7 +14,16 @@
+ # 'efidp_wifi __anonymous_union__::wifi' at efivar-dp.h:868:1
+ #
+ [suppress_type]
+- soname_regexp = libefi(var|boot)\\.so
++ soname_regexp = libefi(var|boot)\\.so\\..*
+ name = efidp_data
+ type_kind = typedef
+ has_data_member_inserted_at = end
++
++# 1 Added variable:
++#
++# 'const __anonymous_struct__ efi_guid_ux_capsule' {efi_guid_ux_capsule@@LIBEFIVAR_1.32}
++#
++[suppress_variable]
++ soname_regexp = ^libefivar\\.so\\.[[:digit:]]+
++ symbol_name_regexp = ^efi_guid_[[:alnum:]_]+$
++ change_kind = add-variable
+diff --git a/src/guids.txt b/src/guids.txt
+index 87e2f61..06081ed 100644
+--- a/src/guids.txt
++++ b/src/guids.txt
+@@ -3,7 +3,7 @@
+ 0abba7dc-e516-4167-bbf5-4d9d1c739416 redhat Red Hat
+ 0b6e5233-a65c-44c9-9407-d9ab83bfc8bd sha224 SHA-224
+ 126a762d-5758-4fca-8531-201a7f57f850 lenovo_boot_menu Lenovo Boot Menu
+-3b8c8162-188c-46a4-aec9-be43f1d65697 ux_capsule_guid Firmware update localized text image
++3b8c8162-188c-46a4-aec9-be43f1d65697 ux_capsule Firmware update localized text image
+ 3bd2a492-96c0-4079-b420-fcf98ef103ed x509_sha256 SHA256 hash of X.509 Certificate
+ 3c5766e8-269c-4e34-aa14-ed776e85b3b6 rsa2048 RSA 2048
+ 3CC24E96-22C7-41D8-8863-8E39DCDCC2CF lenovo Lenovo
+diff --git a/src/libefivar.map.in b/src/libefivar.map.in
+index ba51d55..a95a505 100644
+--- a/src/libefivar.map.in
++++ b/src/libefivar.map.in
+@@ -110,3 +110,7 @@ LIBEFIVAR_1.30 {
+ efi_error_get;
+ efi_error_clear;
+ } LIBEFIVAR_1.29;
++
++LIBEFIVAR_1.32 {
++ global: efi_guid_ux_capsule;
++} LIBEFIVAR_1.30;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2020-10-25 9:49 Sergei Trofimovich
0 siblings, 0 replies; 8+ messages in thread
From: Sergei Trofimovich @ 2020-10-25 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 463cad343694a7f87f8b003ee6a1b683406e9d1b
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 25 09:48:40 2020 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Oct 25 09:48:58 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=463cad34
sys-libs/efivar: drop -Werror equivalent for linker
ia64's ld does not implement '-z relro'. This means
'z relro --fatal-warnings' always fails on ia64.
The change drops '--fatal-warnings'.
Reported-by: Émeric Maschino
Closes: https://bugs.gentoo.org/749963
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
sys-libs/efivar/efivar-37.ebuild | 4 +++
sys-libs/efivar/files/efivar-37-ia64-relro.patch | 37 ++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/sys-libs/efivar/efivar-37.ebuild b/sys-libs/efivar/efivar-37.ebuild
index d85015b8778..40c8e6430d9 100644
--- a/sys-libs/efivar/efivar-37.ebuild
+++ b/sys-libs/efivar/efivar-37.ebuild
@@ -19,6 +19,10 @@ DEPEND="${RDEPEND}
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-37-ia64-relro.patch
+)
+
src_prepare() {
default
sed -i -e 's/-Werror //' gcc.specs || die
diff --git a/sys-libs/efivar/files/efivar-37-ia64-relro.patch b/sys-libs/efivar/files/efivar-37-ia64-relro.patch
new file mode 100644
index 00000000000..92a79aec88e
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-37-ia64-relro.patch
@@ -0,0 +1,37 @@
+https://github.com/rhboot/efivar/pull/164
+https://bugs.gentoo.org/749963
+
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon, 19 Oct 2020 19:05:01 +0100
+Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64
+ compatibility)
+
+```
+$ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64
+ia64-unknown-linux-gnu-gcc ... \
+ -o libefivar.so ...
+/usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored
+collect2: error: ld returned 1 exit status
+make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1
+```
+
+ia64 (and a few others) binutils target does not support '-z relro' and always
+issues a warning. --fatal-warnings spec option turns the build into always failing one.
+
+The change drops `--fatal-warnings` options from gcc.spec entirely.
+
+Reported-by: Émeric Maschino
+Bug: https://bugs.gentoo.org/749963
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+--- a/gcc.specs
++++ b/gcc.specs
+@@ -11,7 +11,7 @@
+ + %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
+
+ *self_spec:
+-+ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}
+++ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-static -static -Wl,-z,relro,-z,now}
+
+ *link:
+-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2022-01-16 15:30 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2022-01-16 15:30 UTC (permalink / raw
To: gentoo-commits
commit: 90f51c95eb90eea6c50624aad0a94143de827d8a
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 16 15:25:37 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Jan 16 15:30:47 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90f51c95
sys-libs/efivar: add 38
Closes: https://bugs.gentoo.org/831302
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
sys-libs/efivar/Manifest | 1 +
sys-libs/efivar/efivar-38.ebuild | 58 ++++++++++++++++++++++++
sys-libs/efivar/files/efivar-38-ia64-relro.patch | 45 ++++++++++++++++++
3 files changed, 104 insertions(+)
diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
index c8afcced10cb..450ec0b1c8a3 100644
--- a/sys-libs/efivar/Manifest
+++ b/sys-libs/efivar/Manifest
@@ -1 +1,2 @@
DIST efivar-37.tar.bz2 109431 BLAKE2B 813d477d31562b773f6e19f20e9e237b94beed437ce221771770e7d46ff0e657530285f035dc942cc20609185be92dc50319bfe8e10dee642c8bd88403ef6ffe SHA512 305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4
+DIST efivar-38.tar.bz2 320221 BLAKE2B 0b96f3d71ddc2246e6a11a5cd32af3d007823c4a283186a428c3f145cd74425a31bd22c4671ad1ab252a3c572991bb1698381cb8bdf51efcbebd62befdc6c070 SHA512 c2f17297c863ece134a9dd758d237fd2df8c8d072f87af1d0bf2bcf9acfc7a53c25597f03fd4fb8cc664b205743d4ffa0ef1b068d0f73c58fa573d40993f3155
diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
new file mode 100644
index 000000000000..60060d4785fc
--- /dev/null
+++ b/sys-libs/efivar/efivar-38.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2014-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/rhinstaller/efivar"
+SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0/1"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc64 ~riscv ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ app-text/mandoc
+ test? ( sys-boot/grub:2 )
+"
+RDEPEND="
+ dev-libs/popt
+"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-3.18
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-38-ia64-relro.patch
+ )
+ default
+}
+
+src_configure() {
+ tc-export CC
+ export CC_FOR_BUILD=$(tc-getBUILD_CC)
+
+ tc-ld-disable-gold
+
+ export libdir="/usr/$(get_libdir)"
+
+ # https://bugs.gentoo.org/562004
+ unset LIBS
+
+ # Avoid -Werror
+ export ERRORS=
+
+ if [[ -n ${GCC_SPECS} ]]; then
+ # The environment overrides the command line.
+ GCC_SPECS+=":${S}/src/include/gcc.specs"
+ fi
+
+ # Used by tests/Makefile
+ export GRUB_PREFIX=grub
+}
diff --git a/sys-libs/efivar/files/efivar-38-ia64-relro.patch b/sys-libs/efivar/files/efivar-38-ia64-relro.patch
new file mode 100644
index 000000000000..2f3686cac444
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-38-ia64-relro.patch
@@ -0,0 +1,45 @@
+From 145c6593fa9206cc27229a9a40c49e4bed046739 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon, 19 Oct 2020 19:05:01 +0100
+Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64
+ compatibility)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+```
+$ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64
+ia64-unknown-linux-gnu-gcc ... \
+ -o libefivar.so ...
+/usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored
+collect2: error: ld returned 1 exit status
+make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1
+```
+
+ia64 (and a few others) binutils target does not support '-z relro' and always
+issues a warning. --fatal-warnings spec option turns the build into always failing one.
+
+The change drops `--fatal-warnings` option from gcc.spec entirely.
+
+Rejected upstream in https://github.com/rhboot/efivar/pull/164.
+
+Reported-by: Émeric Maschino
+Bug: https://bugs.gentoo.org/749963
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ src/include/gcc.specs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/include/gcc.specs b/src/include/gcc.specs
+index ef28e2b..4deead5 100644
+--- a/src/include/gcc.specs
++++ b/src/include/gcc.specs
+@@ -5,4 +5,4 @@
+ + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -grecord-gcc-switches
+
+ *link:
+-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+--
+2.34.1
+
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2022-01-17 16:55 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2022-01-17 16:55 UTC (permalink / raw
To: gentoo-commits
commit: d797ef2bb92c4563459fbf326b2ec0a81baa4ffc
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 17 16:53:46 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan 17 16:53:46 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d797ef2b
sys-libs/efivar: add a couple patches
Fix Makefile so objects are not rebuilt in src_install.
Drop -march=native when building makeguids.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
sys-libs/efivar/efivar-38.ebuild | 9 ++----
sys-libs/efivar/files/efivar-38-Makefile-dep.patch | 33 +++++++++++++++++++
sys-libs/efivar/files/efivar-38-march-native.patch | 37 ++++++++++++++++++++++
3 files changed, 73 insertions(+), 6 deletions(-)
diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
index ae6cba87f271..24459558e6fc 100644
--- a/sys-libs/efivar/efivar-38.ebuild
+++ b/sys-libs/efivar/efivar-38.ebuild
@@ -29,7 +29,9 @@ DEPEND="${RDEPEND}
src_prepare() {
local PATCHES=(
- "${FILESDIR}"/${PN}-38-ia64-relro.patch
+ "${FILESDIR}"/efivar-38-ia64-relro.patch
+ "${FILESDIR}"/efivar-38-march-native.patch
+ "${FILESDIR}"/efivar-38-Makefile-dep.patch
)
default
}
@@ -57,8 +59,3 @@ src_configure() {
# Used by tests/Makefile
export GRUB_PREFIX=grub
}
-
-src_compile() {
- # https://bugs.gentoo.org/831334
- emake HOST_MARCH=
-}
diff --git a/sys-libs/efivar/files/efivar-38-Makefile-dep.patch b/sys-libs/efivar/files/efivar-38-Makefile-dep.patch
new file mode 100644
index 000000000000..64e3f4e0b7c4
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-38-Makefile-dep.patch
@@ -0,0 +1,33 @@
+From 847856cd72088fd5f2349be858745c632c46b6c8 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 17 Jan 2022 11:42:53 -0500
+Subject: [PATCH] Adjust dependency for libefivar and libefiboot objects
+
+Depending on 'prep' causes all objects to be rebuilt every time 'make'
+is invoked.
+
+Depending on '$(GENERATED_SOURCES)' causes a build failure because
+guid-symbols.c gets passed to the compiler due to a rule in rules.mk.
+
+Depend on 'include/efivar/efivar-guids.h' directly to avoid these
+issues.
+
+Fixes: https://github.com/rhboot/efivar/issues/199
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 0e423c44..c6006ebf 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -85,7 +85,7 @@ $(MAKEGUIDS_OUTPUT) : guids.txt
+
+ prep : makeguids $(GENERATED_SOURCES)
+
+-$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : prep
++$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : include/efivar/efivar-guids.h
+
+ libefivar.a : | $(GENERATED_SOURCES)
+ libefivar.a : $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS))
diff --git a/sys-libs/efivar/files/efivar-38-march-native.patch b/sys-libs/efivar/files/efivar-38-march-native.patch
new file mode 100644
index 000000000000..a970d8d6de6b
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-38-march-native.patch
@@ -0,0 +1,37 @@
+From 43d19f297548208ce549fd87faa41e6bb86bf9c3 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 17 Jan 2022 10:13:31 -0500
+Subject: [PATCH] Drop "-march=native" from HOST flags
+
+GCC does not support -march=native on some targets (ia64, riscv).
+The performance enhancement for makeguids isn't worth the trouble it
+causes.
+
+Bug: https://bugs.gentoo.org/831334
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ src/include/defaults.mk | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/src/include/defaults.mk b/src/include/defaults.mk
+index 632b1551..9024a3a1 100644
+--- a/src/include/defaults.mk
++++ b/src/include/defaults.mk
+@@ -71,16 +71,10 @@ override SOFLAGS = $(_SOFLAGS) \
+ -Wl,--version-script=$(MAP) \
+ $(call family,SOFLAGS)
+
+-HOST_ARCH=$(shell uname -m)
+-ifneq ($(HOST_ARCH),ia64)
+- HOST_MARCH=-march=native
+-else
+- HOST_MARCH=
+-endif
+ HOST_CPPFLAGS ?= $(CPPFLAGS)
+ override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
+ override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \
+- -DEFIVAR_BUILD_ENVIRONMENT $(HOST_MARCH)
++ -DEFIVAR_BUILD_ENVIRONMENT
+ HOST_CFLAGS_GCC ?=
+ HOST_CFLAGS_CLANG ?=
+ HOST_CFLAGS ?= $(CFLAGS) $(call family,HOST_CFLAGS)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2022-08-03 2:25 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-08-03 2:25 UTC (permalink / raw
To: gentoo-commits
commit: 5b70c9171330cdd689f9e736b66b23800f942310
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 3 02:24:58 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 3 02:25:04 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b70c917
sys-libs/efivar: fix build w/ glibc 2.36
Closes: https://bugs.gentoo.org/863230
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-libs/efivar/efivar-38.ebuild | 1 +
sys-libs/efivar/files/efivar-38-glibc-2.36.patch | 46 ++++++++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
index eecc85f7cbca..e17d33968234 100644
--- a/sys-libs/efivar/efivar-38.ebuild
+++ b/sys-libs/efivar/efivar-38.ebuild
@@ -34,6 +34,7 @@ src_prepare() {
"${FILESDIR}"/efivar-38-Makefile-dep.patch
"${FILESDIR}"/efivar-38-binutils-2.36.patch
"${FILESDIR}"/efivar-38-ld-locale.patch
+ "${FILESDIR}"/efivar-38-glibc-2.36.patch
)
default
}
diff --git a/sys-libs/efivar/files/efivar-38-glibc-2.36.patch b/sys-libs/efivar/files/efivar-38-glibc-2.36.patch
new file mode 100644
index 000000000000..0a7e5f2e099c
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-38-glibc-2.36.patch
@@ -0,0 +1,46 @@
+https://github.com/rhboot/efivar/commit/bc65d63ebf8fe6ac8a099ff15ca200986dba1565
+https://bugs.gentoo.org/863230
+
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time. This broke the build, since linux/fs.h itself
+includes linux/mount.h. For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>
+
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2023-02-12 18:47 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2023-02-12 18:47 UTC (permalink / raw
To: gentoo-commits
commit: e65483f454acedbf2caae633be3d03309fd492a5
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 18:46:57 2023 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 18:47:10 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e65483f4
sys-libs/efivar: drop 37
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
sys-libs/efivar/Manifest | 1 -
sys-libs/efivar/efivar-37.ebuild | 42 ------------------------
sys-libs/efivar/files/efivar-37-ia64-relro.patch | 37 ---------------------
3 files changed, 80 deletions(-)
diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
index 450ec0b1c8a3..70de2f8e537c 100644
--- a/sys-libs/efivar/Manifest
+++ b/sys-libs/efivar/Manifest
@@ -1,2 +1 @@
-DIST efivar-37.tar.bz2 109431 BLAKE2B 813d477d31562b773f6e19f20e9e237b94beed437ce221771770e7d46ff0e657530285f035dc942cc20609185be92dc50319bfe8e10dee642c8bd88403ef6ffe SHA512 305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4
DIST efivar-38.tar.bz2 320221 BLAKE2B 0b96f3d71ddc2246e6a11a5cd32af3d007823c4a283186a428c3f145cd74425a31bd22c4671ad1ab252a3c572991bb1698381cb8bdf51efcbebd62befdc6c070 SHA512 c2f17297c863ece134a9dd758d237fd2df8c8d072f87af1d0bf2bcf9acfc7a53c25597f03fd4fb8cc664b205743d4ffa0ef1b068d0f73c58fa573d40993f3155
diff --git a/sys-libs/efivar/efivar-37.ebuild b/sys-libs/efivar/efivar-37.ebuild
deleted file mode 100644
index e6751c0136da..000000000000
--- a/sys-libs/efivar/efivar-37.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit toolchain-funcs
-
-DESCRIPTION="Tools and library to manipulate EFI variables"
-HOMEPAGE="https://github.com/rhinstaller/efivar"
-SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0/1"
-KEYWORDS="amd64 arm arm64 ~ia64 ppc64 ~riscv x86"
-
-RDEPEND="dev-libs/popt"
-DEPEND="${RDEPEND}
- >=sys-kernel/linux-headers-3.18
- virtual/pkgconfig
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-37-ia64-relro.patch
-)
-
-src_prepare() {
- default
- sed -i -e 's/-Werror //' gcc.specs || die
-}
-
-src_configure() {
- tc-export CC
- export CC_FOR_BUILD=$(tc-getBUILD_CC)
- tc-ld-disable-gold
- export libdir="/usr/$(get_libdir)"
- unset LIBS # Bug 562004
-
- if [[ -n ${GCC_SPECS} ]]; then
- # The environment overrides the command line.
- GCC_SPECS+=":${S}/gcc.specs"
- fi
-}
diff --git a/sys-libs/efivar/files/efivar-37-ia64-relro.patch b/sys-libs/efivar/files/efivar-37-ia64-relro.patch
deleted file mode 100644
index 92a79aec88e4..000000000000
--- a/sys-libs/efivar/files/efivar-37-ia64-relro.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-https://github.com/rhboot/efivar/pull/164
-https://bugs.gentoo.org/749963
-
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon, 19 Oct 2020 19:05:01 +0100
-Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64
- compatibility)
-
-```
-$ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64
-ia64-unknown-linux-gnu-gcc ... \
- -o libefivar.so ...
-/usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored
-collect2: error: ld returned 1 exit status
-make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1
-```
-
-ia64 (and a few others) binutils target does not support '-z relro' and always
-issues a warning. --fatal-warnings spec option turns the build into always failing one.
-
-The change drops `--fatal-warnings` options from gcc.spec entirely.
-
-Reported-by: Émeric Maschino
-Bug: https://bugs.gentoo.org/749963
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---- a/gcc.specs
-+++ b/gcc.specs
-@@ -11,7 +11,7 @@
- + %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
-
- *self_spec:
--+ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}
-++ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-static -static -Wl,-z,relro,-z,now}
-
- *link:
--+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
-++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
@ 2023-02-12 18:47 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2023-02-12 18:47 UTC (permalink / raw
To: gentoo-commits
commit: a929b75061d1ee6190ac9df0bfaafde6a4a19618
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 18:45:22 2023 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 18:47:10 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a929b750
sys-libs/efivar: backport lld fixes
Closes: https://bugs.gentoo.org/831472
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
sys-libs/efivar/efivar-38.ebuild | 7 +-
sys-libs/efivar/files/efivar-38-ia64-relro.patch | 4 +-
sys-libs/efivar/files/efivar-38-lld-fixes.patch | 345 +++++++++++++++++++++++
3 files changed, 352 insertions(+), 4 deletions(-)
diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
index bd13a3c45113..f9ec399b79fb 100644
--- a/sys-libs/efivar/efivar-38.ebuild
+++ b/sys-libs/efivar/efivar-38.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2014-2022 Gentoo Authors
+# Copyright 2014-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -29,12 +29,15 @@ DEPEND="${RDEPEND}
src_prepare() {
local PATCHES=(
- "${FILESDIR}"/efivar-38-ia64-relro.patch
"${FILESDIR}"/efivar-38-march-native.patch
"${FILESDIR}"/efivar-38-Makefile-dep.patch
"${FILESDIR}"/efivar-38-binutils-2.36.patch
"${FILESDIR}"/efivar-38-ld-locale.patch
"${FILESDIR}"/efivar-38-glibc-2.36.patch
+ "${FILESDIR}"/efivar-38-lld-fixes.patch
+
+ # Rejected upstream, keep this for ia64 support
+ "${FILESDIR}"/efivar-38-ia64-relro.patch
)
default
}
diff --git a/sys-libs/efivar/files/efivar-38-ia64-relro.patch b/sys-libs/efivar/files/efivar-38-ia64-relro.patch
index e90736a0394b..f43057e5e0ad 100644
--- a/sys-libs/efivar/files/efivar-38-ia64-relro.patch
+++ b/sys-libs/efivar/files/efivar-38-ia64-relro.patch
@@ -40,8 +40,8 @@ index ef28e2b..4deead5 100644
+ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -grecord-gcc-switches
*link:
--+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
-++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+++ --no-undefined-version --no-allow-shlib-undefined -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
--
2.34.1
diff --git a/sys-libs/efivar/files/efivar-38-lld-fixes.patch b/sys-libs/efivar/files/efivar-38-lld-fixes.patch
new file mode 100644
index 000000000000..c0fbee802edd
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-38-lld-fixes.patch
@@ -0,0 +1,345 @@
+https://bugs.gentoo.org/831472
+
+From b23aba1469de8bb7a115751f9cd294ad3aaa6680 Mon Sep 17 00:00:00 2001
+From: Ali Abdel-Qader <abdelqaderali@protonmail.com>
+Date: Tue, 31 May 2022 11:53:32 -0400
+Subject: [PATCH] Remove deprecated --add-needed linker flag
+
+Resolves #204
+Signed-off-by: Ali Abdel-Qader <abdelqaderali@protonmail.com>
+---
+ src/include/defaults.mk | 2 --
+ src/include/gcc.specs | 2 +-
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/include/defaults.mk b/src/include/defaults.mk
+index b8cc590c..42bd3d6e 100644
+--- a/src/include/defaults.mk
++++ b/src/include/defaults.mk
+@@ -51,7 +51,6 @@ LDFLAGS ?=
+ override _CCLDFLAGS := $(CCLDFLAGS)
+ override _LDFLAGS := $(LDFLAGS)
+ override LDFLAGS = $(CFLAGS) -L. $(_LDFLAGS) $(_CCLDFLAGS) \
+- -Wl,--add-needed \
+ -Wl,--build-id \
+ -Wl,--no-allow-shlib-undefined \
+ -Wl,--no-undefined-version \
+@@ -98,7 +97,6 @@ override _HOST_LDFLAGS := $(HOST_LDFLAGS)
+ override _HOST_CCLDFLAGS := $(HOST_CCLDFLAGS)
+ override HOST_LDFLAGS = $(HOST_CFLAGS) -L. \
+ $(_HOST_LDFLAGS) $(_HOST_CCLDFLAGS) \
+- -Wl,--add-needed \
+ -Wl,--build-id \
+ -Wl,--no-allow-shlib-undefined \
+ -Wl,-z,now \
+diff --git a/src/include/gcc.specs b/src/include/gcc.specs
+index ef28e2bb..d85e8658 100644
+--- a/src/include/gcc.specs
++++ b/src/include/gcc.specs
+@@ -5,4 +5,4 @@
+ + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -grecord-gcc-switches
+
+ *link:
+-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+++ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+From 1f247260c9b4bd6fcda30f3e4cc358852aeb9e4d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= <tpgxyz@gmail.com>
+Date: Wed, 29 Jun 2022 21:44:29 +0200
+Subject: [PATCH] LLD: fix detection and remove not needed workarounds
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Tomasz Paweł Gajc <tpgxyz@gmail.com>
+---
+ src/include/workarounds.mk | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/include/workarounds.mk b/src/include/workarounds.mk
+index b72fbaf6..57394edd 100644
+--- a/src/include/workarounds.mk
++++ b/src/include/workarounds.mk
+@@ -2,12 +2,12 @@
+ #
+ # workarounds.mk - workarounds for weird stuff behavior
+
+-LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g')
+-LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //')
++LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/ .*//g')
++LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/.* //')
+ # 2.35 is definitely broken and 2.36 seems to work
+ LD_DASH_T := $(shell \
+ if [ "x${LD_FLAVOR}" = xLLD ] ; then \
+- echo '-T' ; \
++ echo "" ; \
+ elif [ "x${LD_FLAVOR}" = xGNU ] ; then \
+ if echo "${LD_VERSION}" | grep -q -E '^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
+ echo '-T' ; \
+@@ -15,7 +15,7 @@ LD_DASH_T := $(shell \
+ echo "" ; \
+ fi ; \
+ else \
+- echo "Your linker is not supported" ; \
++ echo "Your linker ${LD_FLAVOR} version ${LD_VERSION} is not supported" ; \
+ exit 1 ; \
+ fi)
+
+From cfd686de51494d3e34be896a91835657ccab37d4 Mon Sep 17 00:00:00 2001
+From: Nicholas Vinson <nvinson234@gmail.com>
+Date: Mon, 10 Oct 2022 14:22:36 -0400
+Subject: [PATCH] Revamp efi_well_known_* variable handling
+
+The current implementation attempts to use the linker to create aliases
+for efi_well_known_guids and efi_well_known_names. It also tries to use
+the linker to generate the variables efi_well_known_guids_end and
+efi_well_known_names_end.
+
+When building with clang, the generated linker result results in a
+broken libefivar.so that causes programs to segfault when linked against
+it. This change does away with linker script hacker and instead
+introduces pointers to store the locations of efi_well_known_guids_end
+and efi_well_known_names_end.
+
+Additionally, efi_well_known_guids and efi_well_known_names are now
+created as pointers that point to the beginning of their respective
+arrays.
+
+Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
+Fixes: #234
+---
+ src/Makefile | 7 ++--
+ src/include/rules.mk | 5 +--
+ src/include/workarounds.mk | 24 -------------
+ src/makeguids.c | 72 +++++++++++++-------------------------
+ 4 files changed, 27 insertions(+), 81 deletions(-)
+ delete mode 100644 src/include/workarounds.mk
+
+diff --git a/src/Makefile b/src/Makefile
+index e04357a7..ec1eabe6 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -4,7 +4,6 @@ include $(TOPDIR)/src/include/deprecated.mk
+ include $(TOPDIR)/src/include/version.mk
+ include $(TOPDIR)/src/include/rules.mk
+ include $(TOPDIR)/src/include/defaults.mk
+-include $(TOPDIR)/src/include/workarounds.mk
+
+ LIBTARGETS=libefivar.so libefiboot.so libefisec.so
+ STATICLIBTARGETS=libefivar.a libefiboot.a libefisec.a
+@@ -30,7 +29,7 @@ EFISECDB_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFISECDB_SOURCES)))
+ GENERATED_SOURCES = include/efivar/efivar-guids.h guid-symbols.c
+ MAKEGUIDS_SOURCES = makeguids.c util-makeguids.c
+ MAKEGUIDS_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(MAKEGUIDS_SOURCES)))
+-MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES) guids.lds
++MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES)
+
+ util-makeguids.c : util.c
+ cp util.c util-makeguids.c
+@@ -84,7 +83,7 @@ $(MAKEGUIDS_OUTPUT) : guids.txt
+ if [ "$${missing}" != "no" ]; then \
+ exit 1 ; \
+ fi
+- ./makeguids $(LD_DASH_T) guids.txt guid-symbols.c include/efivar/efivar-guids.h guids.lds
++ ./makeguids guids.txt guid-symbols.c include/efivar/efivar-guids.h
+
+ prep : makeguids $(GENERATED_SOURCES)
+
+@@ -96,7 +95,6 @@ libefivar.a : $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS))
+ libefivar.so : $(LIBEFIVAR_OBJECTS)
+ libefivar.so : | $(GENERATED_SOURCES) libefivar.map
+ libefivar.so : LIBS=dl
+-libefivar.so : LDSCRIPTS=guids.lds
+ libefivar.so : MAP=libefivar.map
+
+ efivar : $(EFIVAR_OBJECTS) | libefivar.so
+@@ -137,7 +135,6 @@ deps : $(ALL_SOURCES)
+ clean :
+ @rm -rfv *~ *.o *.a *.E *.so *.so.* *.pc *.bin .*.d *.map \
+ makeguids guid-symbols.c include/efivar/efivar-guids.h \
+- guids.lds \
+ $(TARGETS) $(STATICTARGETS)
+ @# remove the deps files we used to create, as well.
+ @rm -rfv .*.P .*.h.P *.S.P include/efivar/.*.h.P
+diff --git a/src/include/rules.mk b/src/include/rules.mk
+index f309f863..8d0b68a2 100644
+--- a/src/include/rules.mk
++++ b/src/include/rules.mk
+@@ -3,7 +3,6 @@ default : all
+ .PHONY: default all clean install test
+
+ include $(TOPDIR)/src/include/version.mk
+-include $(TOPDIR)/src/include/workarounds.mk
+
+ comma:= ,
+ empty:=
+@@ -36,9 +35,7 @@ family = $(foreach FAMILY_SUFFIX,$(FAMILY_SUFFIXES),$($(1)_$(FAMILY_SUFFIX)))
+ $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) -o $@ $(sort $^) $(LDLIBS)
+
+ %.so :
+- $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) $(SOFLAGS) \
+- $(foreach LDS,$(LDSCRIPTS),$(LD_DASH_T) $(LDS)) \
+- -o $@ $^ $(LDLIBS)
++ $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) $(SOFLAGS) -o $@ $^ $(LDLIBS)
+ ln -vfs $@ $@.1
+
+ %.abixml : %.so
+diff --git a/src/include/workarounds.mk b/src/include/workarounds.mk
+deleted file mode 100644
+index 57394edd..00000000
+--- a/src/include/workarounds.mk
++++ /dev/null
+@@ -1,24 +0,0 @@
+-# SPDX-License-Identifier: SPDX-License-Identifier: LGPL-2.1-or-later
+-#
+-# workarounds.mk - workarounds for weird stuff behavior
+-
+-LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/ .*//g')
+-LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/.* //')
+-# 2.35 is definitely broken and 2.36 seems to work
+-LD_DASH_T := $(shell \
+- if [ "x${LD_FLAVOR}" = xLLD ] ; then \
+- echo "" ; \
+- elif [ "x${LD_FLAVOR}" = xGNU ] ; then \
+- if echo "${LD_VERSION}" | grep -q -E '^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
+- echo '-T' ; \
+- else \
+- echo "" ; \
+- fi ; \
+- else \
+- echo "Your linker ${LD_FLAVOR} version ${LD_VERSION} is not supported" ; \
+- exit 1 ; \
+- fi)
+-
+-export LD_DASH_T
+-
+-# vim:ft=make
+diff --git a/src/makeguids.c b/src/makeguids.c
+index 376bffba..bfdee12e 100644
+--- a/src/makeguids.c
++++ b/src/makeguids.c
+@@ -107,51 +107,46 @@ write_guidnames(FILE *out, const char *listname,
+ gn->symbol, gn->name, gn->description);
+ }
+ fprintf(out, "};\n");
++ fprintf(out, "const struct efivar_guidname\n"
++ "\t__attribute__((__visibility__ (\"default\")))\n"
++ "\t* const %s = %s_;\n", listname, listname);
++ fprintf(out, "const struct efivar_guidname\n"
++ "\t__attribute__((__visibility__ (\"default\")))\n"
++ "\t* const %s_end = %s_\n\t+ %zd;\n",
++ listname, listname, n - 1);
+ }
+
+ int
+ main(int argc, char *argv[])
+ {
+ int rc;
+- int argstart = 0;
+- FILE *symout, *header, *ldsout;
+- int dash_t = 0;
++ FILE *symout, *header;
+
+- if (argc < 5) {
++ if (argc < 4) {
+ errx(1, "Not enough arguments.\n");
+- } else if (argc > 5 && !strcmp(argv[1],"-T")) {
+- argstart = 1;
+- dash_t = 1;
+- } else if (argc > 5) {
++ } else if (argc > 4) {
+ errx(1, "Too many arguments.\n");
+ }
+
+- symout = fopen(argv[argstart + 2], "w");
++ symout = fopen(argv[2], "w");
+ if (symout == NULL)
+- err(1, "could not open \"%s\"", argv[argstart + 2]);
+- rc = chmod(argv[argstart + 2], 0644);
++ err(1, "could not open \"%s\"", argv[2]);
++ rc = chmod(argv[2], 0644);
+ if (rc < 0)
+- warn("chmod(%s, 0644)", argv[argstart + 2]);
++ warn("chmod(%s, 0644)", argv[2]);
+
+- header = fopen(argv[argstart + 3], "w");
++ header = fopen(argv[3], "w");
+ if (header == NULL)
+- err(1, "could not open \"%s\"", argv[argstart + 3]);
+- rc = chmod(argv[argstart + 3], 0644);
+- if (rc < 0)
+- warn("chmod(%s, 0644)", argv[argstart + 3]);
+-
+- ldsout = fopen(argv[argstart + 4], "w");
+- if (ldsout == NULL)
+- err(1, "could not open \"%s\"", argv[argstart + 4]);
+- rc = chmod(argv[argstart + 4], 0644);
++ err(1, "could not open \"%s\"", argv[3]);
++ rc = chmod(argv[3], 0644);
+ if (rc < 0)
+- warn("chmod(%s, 0644)", argv[argstart + 4]);
++ warn("chmod(%s, 0644)", argv[3]);
+
+ struct guidname_index *guidnames = NULL;
+
+- rc = read_guids_at(AT_FDCWD, argv[argstart + 1], &guidnames);
++ rc = read_guids_at(AT_FDCWD, argv[1], &guidnames);
+ if (rc < 0)
+- err(1, "could not read \"%s\"", argv[argstart + 1]);
++ err(1, "could not read \"%s\"", argv[1]);
+
+ struct efivar_guidname *outbuf;
+
+@@ -243,12 +238,11 @@ struct efivar_guidname {\n\
+ fprintf(header,
+ "extern const struct efivar_guidname\n"
+ "\t__attribute__((__visibility__ (\"default\")))\n"
+- "\tefi_well_known_guids[%d];\n",
+- i);
++ "\t* const efi_well_known_guids;\n");
+ fprintf(header,
+ "extern const struct efivar_guidname\n"
+ "\t__attribute__((__visibility__ (\"default\")))\n"
+- "\tefi_well_known_guids_end;\n");
++ "\t* const efi_well_known_guids_end;\n");
+ fprintf(header,
+ "extern const uint64_t\n"
+ "\t__attribute__((__visibility__ (\"default\")))\n"
+@@ -256,12 +250,11 @@ struct efivar_guidname {\n\
+ fprintf(header,
+ "extern const struct efivar_guidname\n"
+ "\t__attribute__((__visibility__ (\"default\")))\n"
+- "\tefi_well_known_names[%d];\n",
+- i);
++ "\t* const efi_well_known_names;\n");
+ fprintf(header,
+ "extern const struct efivar_guidname\n"
+ "\t__attribute__((__visibility__ (\"default\")))\n"
+- "\tefi_well_known_names_end;\n");
++ "\t* const efi_well_known_names_end;\n");
+ fprintf(header,
+ "extern const uint64_t\n"
+ "\t__attribute__((__visibility__ (\"default\")))\n"
+@@ -310,23 +303,6 @@ struct efivar_guidname {\n\
+
+ fclose(symout);
+
+- fprintf(ldsout,
+- "SECTIONS\n"
+- "{\n"
+- " .data :\n"
+- " {\n"
+- " efi_well_known_guids = efi_well_known_guids_;\n"
+- " efi_well_known_guids_end = efi_well_known_guids_ + %zd;\n"
+- " efi_well_known_names = efi_well_known_names_;\n"
+- " efi_well_known_names_end = efi_well_known_names_ + %zd;\n"
+- " }\n"
+- "}%s;\n",
+- (line - 1) * sizeof(struct efivar_guidname),
+- (line - 1) * sizeof(struct efivar_guidname),
+- dash_t ? " INSERT AFTER .data" : "");
+-
+- fclose(ldsout);
+-
+ free(guidnames->strtab);
+ free(guidnames);
+
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-02-12 18:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25 13:45 [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2023-02-12 18:47 Mike Gilbert
2023-02-12 18:47 Mike Gilbert
2022-08-03 2:25 Sam James
2022-01-17 16:55 Mike Gilbert
2022-01-16 15:30 Mike Gilbert
2020-10-25 9:49 Sergei Trofimovich
2016-02-12 18:44 Mike Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox