[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2023-02-12 Thread Mike Gilbert
commit: e65483f454acedbf2caae633be3d03309fd492a5
Author: Mike Gilbert  gentoo  org>
AuthorDate: Sun Feb 12 18:46:57 2023 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Sun Feb 12 18:47:10 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e65483f4

sys-libs/efivar: drop 37

Signed-off-by: Mike Gilbert  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..
--- 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..
--- 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 
-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 
 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:%

[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2023-02-12 Thread Mike Gilbert
commit: a929b75061d1ee6190ac9df0bfaafde6a4a19618
Author: Mike Gilbert  gentoo  org>
AuthorDate: Sun Feb 12 18:45:22 2023 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Sun Feb 12 18:47:10 2023 +
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  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:%https://bugs.gentoo.org/831472
+
+From b23aba1469de8bb7a115751f9cd294ad3aaa6680 Mon Sep 17 00:00:00 2001
+From: Ali Abdel-Qader 
+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 
+---
+ 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:%
+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 
+---
+ 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 

[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2022-08-02 Thread Sam James
commit: 5b70c9171330cdd689f9e736b66b23800f942310
Author: Sam James  gentoo  org>
AuthorDate: Wed Aug  3 02:24:58 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Aug  3 02:25:04 2022 +
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  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 ..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 
+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 
+--- a/src/gpt.c
 b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+--- a/src/linux.c
 b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+--- a/src/util.h
 b/src/util.h
+@@ -23,7 +23,6 @@
+ #include 
+ #include 
+ #include 
+-#include 
+ #include 
+ #include 
+ #include 
+



[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2022-01-17 Thread Mike Gilbert
commit: d797ef2bb92c4563459fbf326b2ec0a81baa4ffc
Author: Mike Gilbert  gentoo  org>
AuthorDate: Mon Jan 17 16:53:46 2022 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Mon Jan 17 16:53:46 2022 +
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  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 ..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 
+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 
+---
+ 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 ..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 
+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 
+---
+ 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)



[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2022-01-16 Thread Mike Gilbert
commit: 90f51c95eb90eea6c50624aad0a94143de827d8a
Author: Mike Gilbert  gentoo  org>
AuthorDate: Sun Jan 16 15:25:37 2022 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Sun Jan 16 15:30:47 2022 +
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  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 ..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 ..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 
+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 
+---
+ 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:%

[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2020-10-25 Thread Sergei Trofimovich
commit: 463cad343694a7f87f8b003ee6a1b683406e9d1b
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Sun Oct 25 09:48:40 2020 +
Commit: Sergei Trofimovich  gentoo  org>
CommitDate: Sun Oct 25 09:48:58 2020 +
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  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 000..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 
+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 
+--- 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:%

[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2018-01-25 Thread Lars Wendler
commit: babb2eb03e85ad5272d62f9e976cf901b3d06343
Author: Lars Wendler  gentoo  org>
AuthorDate: Thu Jan 25 13:42:30 2018 +
Commit: Lars Wendler  gentoo  org>
CommitDate: Thu Jan 25 13:45:08 2018 +
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 000..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 000..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 
+Date: Tue, 12 Sep 2017 10:45:31 -0400
+Subject: [PATCH] Make efi_guid_ux_capsule actually work.
+
+Signed-off-by: Peter Jones 
+---
+ 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_menuLenovo 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;



[gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/

2016-02-12 Thread Mike Gilbert
commit: 8e88e53253add3497e2abd730deb803f2079cdc6
Author: Mike Gilbert  gentoo  org>
AuthorDate: Fri Feb 12 18:43:28 2016 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Fri Feb 12 18:43:45 2016 +
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 000..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 000..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 
+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 
+---
+ 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
+