commit:     a7d2b3e69853cb415a1dafe893af1cc32fdbfea0
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 13 08:25:21 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 19:25:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7d2b3e6

sys-libs/efivar: drop 38

Bug: https://bugs.gentoo.org/940104
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sys-libs/efivar/Manifest                           |   1 -
 sys-libs/efivar/efivar-38.ebuild                   |  75 -----
 sys-libs/efivar/files/efivar-38-64bit-off_t.patch  |  46 ---
 sys-libs/efivar/files/efivar-38-Makefile-dep.patch |  33 --
 .../efivar/files/efivar-38-binutils-2.36.patch     |  30 --
 .../efivar/files/efivar-38-efisecdb-musl.patch     | 179 -----------
 .../efivar/files/efivar-38-efisecdb-optarg.patch   |  51 ---
 sys-libs/efivar/files/efivar-38-glibc-2.36.patch   |  46 ---
 sys-libs/efivar/files/efivar-38-ld-locale.patch    |  30 --
 sys-libs/efivar/files/efivar-38-lld-fixes.patch    | 345 ---------------------
 sys-libs/efivar/files/efivar-38-march-native.patch |  37 ---
 11 files changed, 873 deletions(-)

diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
index afd23f75ab3c..7f8a29329c93 100644
--- a/sys-libs/efivar/Manifest
+++ b/sys-libs/efivar/Manifest
@@ -1,2 +1 @@
-DIST efivar-38.tar.bz2 320221 BLAKE2B 
0b96f3d71ddc2246e6a11a5cd32af3d007823c4a283186a428c3f145cd74425a31bd22c4671ad1ab252a3c572991bb1698381cb8bdf51efcbebd62befdc6c070
 SHA512 
c2f17297c863ece134a9dd758d237fd2df8c8d072f87af1d0bf2bcf9acfc7a53c25597f03fd4fb8cc664b205743d4ffa0ef1b068d0f73c58fa573d40993f3155
 DIST efivar-39.tar.gz 463349 BLAKE2B 
73ea4b3293cd708923bcd4332a8c7a5a8bbf539d81300c502a764a2ac205ba7cdf1e30b3432c42a101f56c0b6e31af2907a6a38ada69ace3b0d60e90515094cd
 SHA512 
04493c30efbfc2773abac9a3dd93aa13403c05e29e3bfc72877d2054930811fae99119aadcb1729b6ca85abf5a24db786ea0c27c16d5458ef1b19e74696f5ff7

diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
deleted file mode 100644
index 271b9b2d75d0..000000000000
--- a/sys-libs/efivar/efivar-38.ebuild
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2014-2024 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 ~loong 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}"/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
-               "${FILESDIR}"/efivar-38-efisecdb-musl.patch
-               "${FILESDIR}"/efivar-38-efisecdb-optarg.patch
-               "${FILESDIR}"/efivar-38-64bit-off_t.patch
-
-               # Rejected upstream, keep this for ia64 support
-               "${FILESDIR}"/efivar-38-ia64-relro.patch
-       )
-       default
-}
-
-src_configure() {
-       unset CROSS_COMPILE
-       export COMPILER=$(tc-getCC)
-       export HOSTCC=$(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
-}
-
-src_test() {
-       # https://bugs.gentoo.org/924370
-       emake -j1 test
-}

diff --git a/sys-libs/efivar/files/efivar-38-64bit-off_t.patch 
b/sys-libs/efivar/files/efivar-38-64bit-off_t.patch
deleted file mode 100644
index d06868b22587..000000000000
--- a/sys-libs/efivar/files/efivar-38-64bit-off_t.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-https://bugs.gentoo.org/905930
-
-From 914c686cc54b2405dab08bff77cd60827aab54b1 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 14 Dec 2022 16:55:51 -0800
-Subject: [PATCH] Use off_t instead of off64_t
-
-Pass _FILE_OFFSET_BITS=64 to ensure 64bit off_t
-
-This helps building efivar for 32bit arches on systems using musl C
-library. It works with glibc since _GNU_SOURCE defines
-_LARGEFILE64_SOURCE as well, this feature test macro enables the 64bit
-interfaces which were done as intermediate steps when transition to
-66-bit off_t was done as part olf LFS64 support.
-
-Signed-off-by: Khem Raj <[email protected]>
----
- src/error.c             | 2 +-
- src/include/defaults.mk | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/error.c b/src/error.c
-index fcbba0d6..9530e22c 100644
---- a/src/error.c
-+++ b/src/error.c
-@@ -191,7 +191,7 @@ dbglog_write(void *cookie, const char *buf, size_t size)
- }
- 
- static int
--dbglog_seek(void *cookie UNUSED, off64_t *offset, int whence)
-+dbglog_seek(void *cookie UNUSED, off_t *offset, int whence)
- {
-       FILE *log = efi_errlog ? efi_errlog : stderr;
-       int rc;
-diff --git a/src/include/defaults.mk b/src/include/defaults.mk
-index 42bd3d6e..bb9c997f 100644
---- a/src/include/defaults.mk
-+++ b/src/include/defaults.mk
-@@ -34,6 +34,7 @@ CPPFLAGS ?=
- override _CPPFLAGS := $(CPPFLAGS)
- override CPPFLAGS = $(_CPPFLAGS) -DLIBEFIVAR_VERSION=$(VERSION) \
-           -D_GNU_SOURCE \
-+          -D_FILE_OFFSET_BITS=64 \
-           -I$(TOPDIR)/src/include/
- CFLAGS ?= $(OPTIMIZE) $(DEBUGINFO) $(WARNINGS) $(ERRORS)
- CFLAGS_GCC ?= -specs=$(TOPDIR)/src/include/gcc.specs \

diff --git a/sys-libs/efivar/files/efivar-38-Makefile-dep.patch 
b/sys-libs/efivar/files/efivar-38-Makefile-dep.patch
deleted file mode 100644
index 64e3f4e0b7c4..000000000000
--- a/sys-libs/efivar/files/efivar-38-Makefile-dep.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 847856cd72088fd5f2349be858745c632c46b6c8 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <[email protected]>
-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 <[email protected]>
----
- 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-binutils-2.36.patch 
b/sys-libs/efivar/files/efivar-38-binutils-2.36.patch
deleted file mode 100644
index df0575de7f33..000000000000
--- a/sys-libs/efivar/files/efivar-38-binutils-2.36.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 197a0874ea4010061b98b4b55eff65b33b1cd741 Mon Sep 17 00:00:00 2001
-From: Robbie Harwood <[email protected]>
-Date: Mon, 17 Jan 2022 12:34:55 -0500
-Subject: [PATCH] Add -T workaround for GNU ld 2.36
-
-Signed-off-by: Robbie Harwood <[email protected]>
-Resolves: #195
----
- src/include/workarounds.mk | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/include/workarounds.mk b/src/include/workarounds.mk
-index 31188342..143e7902 100644
---- a/src/include/workarounds.mk
-+++ b/src/include/workarounds.mk
-@@ -4,12 +4,12 @@
- 
- LD_FLAVOR := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g')
- LD_VERSION := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //')
--# I haven't tested 2.36 here; 2.35 is definitely broken and 2.37 seems to work
-+# 2.35 is definitely broken and 2.36 seems to work
- LD_DASH_T := $(shell \
-       if [ "x${LD_FLAVOR}" = xLLD ] ; then \
-               echo '-T' ; \
-       elif [ "x${LD_FLAVOR}" = xGNU ] ; then \
--              if echo "${LD_VERSION}" | grep -q -E 
'^2\.3[789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
-+              if echo "${LD_VERSION}" | grep -q -E 
'^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
-                       echo '-T' ; \
-               else \
-                       echo "" ; \

diff --git a/sys-libs/efivar/files/efivar-38-efisecdb-musl.patch 
b/sys-libs/efivar/files/efivar-38-efisecdb-musl.patch
deleted file mode 100644
index a1bfa631aae1..000000000000
--- a/sys-libs/efivar/files/efivar-38-efisecdb-musl.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From cece3ffd5be2f8641eb694513f2b73e5eb97ffd3 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <[email protected]>
-Date: Fri, 28 Jan 2022 12:13:30 +0100
-Subject: [PATCH] efisecdb: fix build with musl libc
-
-Refactor code to use POSIX atexit(3) instead of the GNU specific
-on_exit(3).
-
-Resolves: #197
-Resolves: #202
-Signed-off-by: Natanael Copa <[email protected]>
----
- src/compiler.h |  2 --
- src/efisecdb.c | 68 +++++++++++++++++++-------------------------------
- 2 files changed, 26 insertions(+), 44 deletions(-)
-
-diff --git a/src/compiler.h b/src/compiler.h
-index e2f18f0b..d95fb014 100644
---- a/src/compiler.h
-+++ b/src/compiler.h
-@@ -7,8 +7,6 @@
- #ifndef COMPILER_H_
- #define COMPILER_H_
- 
--#include <sys/cdefs.h>
--
- /* GCC version checking borrowed from glibc. */
- #if defined(__GNUC__) && defined(__GNUC_MINOR__)
- #  define GNUC_PREREQ(maj,min) \
-diff --git a/src/efisecdb.c b/src/efisecdb.c
-index f8823737..6bd5ad90 100644
---- a/src/efisecdb.c
-+++ b/src/efisecdb.c
-@@ -25,6 +25,10 @@
- extern char *optarg;
- extern int optind, opterr, optopt;
- 
-+static efi_secdb_t *secdb = NULL;
-+static list_t infiles;
-+static list_t actions;
-+
- struct hash_param {
-       char *name;
-       efi_secdb_type_t algorithm;
-@@ -187,12 +191,11 @@ add_action(list_t *list, action_type_t action_type, 
const efi_guid_t *owner,
- }
- 
- static void
--free_actions(int status UNUSED, void *actionsp)
-+free_actions(void)
- {
--      list_t *actions = (list_t *)actionsp;
-       list_t *pos, *tmp;
- 
--      for_each_action_safe(pos, tmp, actions) {
-+      for_each_action_safe(pos, tmp, &actions) {
-               action_t *action = list_entry(pos, action_t, list);
- 
-               list_del(&action->list);
-@@ -202,12 +205,11 @@ free_actions(int status UNUSED, void *actionsp)
- }
- 
- static void
--free_infiles(int status UNUSED, void *infilesp)
-+free_infiles(void)
- {
--      list_t *infiles = (list_t *)infilesp;
-       list_t *pos, *tmp;
- 
--      for_each_ptr_safe(pos, tmp, infiles) {
-+      for_each_ptr_safe(pos, tmp, &infiles) {
-               ptrlist_t *entry = list_entry(pos, ptrlist_t, list);
- 
-               list_del(&entry->list);
-@@ -216,27 +218,12 @@ free_infiles(int status UNUSED, void *infilesp)
- }
- 
- static void
--maybe_free_secdb(int status UNUSED, void *voidp)
-+maybe_free_secdb(void)
- {
--      efi_secdb_t **secdbp = (efi_secdb_t **)voidp;
--
--      if (secdbp == NULL || *secdbp == NULL)
-+      if (secdb == NULL)
-               return;
- 
--      efi_secdb_free(*secdbp);
--}
--
--static void
--maybe_do_unlink(int status, void *filep)
--{
--      char **file = (char **)filep;
--
--      if (status == 0)
--              return;
--      if (file == NULL || *file == NULL)
--              return;
--
--      unlink(*file);
-+      efi_secdb_free(secdb);
- }
- 
- static void
-@@ -323,15 +310,6 @@ parse_input_files(list_t *infiles, char **outfile, 
efi_secdb_t **secdb,
-       return status;
- }
- 
--/*
-- * These need to be static globals so that they're not on main's stack when
-- * on_exit() fires.
-- */
--static efi_secdb_t *secdb = NULL;
--static list_t infiles;
--static list_t actions;
--static char *outfile = NULL;
--
- int
- main(int argc, char *argv[])
- {
-@@ -351,6 +329,7 @@ main(int argc, char *argv[])
-       bool do_sort_data = false;
-       bool sort_descending = false;
-       int status = 0;
-+      char *outfile = NULL;
- 
-       const char sopts[] = ":aAc:dfg:h:i:Lo:rs:t:v?";
-       const struct option lopts[] = {
-@@ -376,10 +355,9 @@ main(int argc, char *argv[])
-       INIT_LIST_HEAD(&infiles);
-       INIT_LIST_HEAD(&actions);
- 
--      on_exit(free_actions, &actions);
--      on_exit(free_infiles, &infiles);
--      on_exit(maybe_free_secdb, &secdb);
--      on_exit(maybe_do_unlink, &outfile);
-+      atexit(free_actions);
-+      atexit(free_infiles);
-+      atexit(maybe_free_secdb);
- 
-       /*
-        * parse the command line.
-@@ -587,24 +565,30 @@ main(int argc, char *argv[])
-       outfd = open(outfile, flags, 0600);
-       if (outfd < 0) {
-               char *tmpoutfile = outfile;
--              if (errno == EEXIST)
--                      outfile = NULL;
-+              if (errno != EEXIST)
-+                      unlink(outfile);
-               err(1, "could not open \"%s\"", tmpoutfile);
-       }
- 
-       rc = ftruncate(outfd, 0);
--      if (rc < 0)
-+      if (rc < 0) {
-+              unlink(outfile);
-               err(1, "could not truncate output file \"%s\"", outfile);
-+      }
- 
-       void *output;
-       size_t size = 0;
-       rc = efi_secdb_realize(secdb, &output, &size);
--      if (rc < 0)
-+      if (rc < 0) {
-+              unlink(outfile);
-               secdb_err(1, "could not realize signature list");
-+      }
- 
-       rc = write(outfd, output, size);
--      if (rc < 0)
-+      if (rc < 0) {
-+              unlink(outfile);
-               err(1, "could not write signature list");
-+      }
- 
-       close(outfd);
-       xfree(output);

diff --git a/sys-libs/efivar/files/efivar-38-efisecdb-optarg.patch 
b/sys-libs/efivar/files/efivar-38-efisecdb-optarg.patch
deleted file mode 100644
index 612395efbe18..000000000000
--- a/sys-libs/efivar/files/efivar-38-efisecdb-optarg.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From df09b472419466987f2f30176dd00937e640aa9a Mon Sep 17 00:00:00 2001
-From: Natanael Copa <[email protected]>
-Date: Fri, 28 Jan 2022 12:29:00 +0100
-Subject: [PATCH] efisecdb: do not free optarg
-
-The *outfile passed to parse_input_files can only be either set to
-optarg or be NULL. optarg should not be free'd and NULL does not need
-to.
-
-Since we no longer use on_exit to unlink outfile we also don't need to
-set *outfile to NULL.
-
-Fixes commit d91787035bc1 (efisecdb: add efisecdb)
-
-Signed-off-by: Natanael Copa <[email protected]>
----
- src/efisecdb.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/src/efisecdb.c b/src/efisecdb.c
-index 6bd5ad90..70fa1847 100644
---- a/src/efisecdb.c
-+++ b/src/efisecdb.c
-@@ -255,8 +255,7 @@ list_guids(void)
-  * failure.
-  */
- static int
--parse_input_files(list_t *infiles, char **outfile, efi_secdb_t **secdb,
--                bool dump)
-+parse_input_files(list_t *infiles, efi_secdb_t **secdb, bool dump)
- {
-       int status = 0;
-       list_t *pos, *tmp;
-@@ -297,8 +296,6 @@ parse_input_files(list_t *infiles, char **outfile, 
efi_secdb_t **secdb,
-                               if (!dump)
-                                       exit(1);
-                               status = 1;
--                              xfree(*outfile);
--                              *outfile = NULL;
-                               break;
-                       }
-               }
-@@ -528,7 +525,7 @@ main(int argc, char *argv[])
-       efi_secdb_set_bool(secdb, EFI_SECDB_SORT_DATA, do_sort_data);
-       efi_secdb_set_bool(secdb, EFI_SECDB_SORT_DESCENDING, sort_descending);
- 
--      status = parse_input_files(&infiles, &outfile, &secdb, dump);
-+      status = parse_input_files(&infiles, &secdb, dump);
-       if (status == 0) {
-               for_each_action_safe(pos, tmp, &actions) {
-                       action_t *action = list_entry(pos, action_t, list);

diff --git a/sys-libs/efivar/files/efivar-38-glibc-2.36.patch 
b/sys-libs/efivar/files/efivar-38-glibc-2.36.patch
deleted file mode 100644
index 0a7e5f2e099c..000000000000
--- a/sys-libs/efivar/files/efivar-38-glibc-2.36.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-https://github.com/rhboot/efivar/commit/bc65d63ebf8fe6ac8a099ff15ca200986dba1565
-https://bugs.gentoo.org/863230
-
-From: Robbie Harwood <[email protected]>
-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 <[email protected]>
---- 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>
-

diff --git a/sys-libs/efivar/files/efivar-38-ld-locale.patch 
b/sys-libs/efivar/files/efivar-38-ld-locale.patch
deleted file mode 100644
index b1dd699a4461..000000000000
--- a/sys-libs/efivar/files/efivar-38-ld-locale.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 01de7438520868650bfaa1ef3e2bfaf00cacbcc6 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <[email protected]>
-Date: Fri, 24 Jun 2022 17:00:33 -0400
-Subject: [PATCH] Set LC_ALL=C to force English output from ld
-
-If the user has a different locale set, ld --version may not contain the
-string "GNU ld".
-
-For example, in Italian, ld --version outputs "ld di GNU".
-
-Signed-off-by: Mike Gilbert <[email protected]>
----
- src/include/workarounds.mk | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/include/workarounds.mk b/src/include/workarounds.mk
-index 143e7902..b72fbaf6 100644
---- a/src/include/workarounds.mk
-+++ b/src/include/workarounds.mk
-@@ -2,8 +2,8 @@
- #
- # workarounds.mk - workarounds for weird stuff behavior
- 
--LD_FLAVOR := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g')
--LD_VERSION := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //')
-+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/.* //')
- # 2.35 is definitely broken and 2.36 seems to work
- LD_DASH_T := $(shell \
-       if [ "x${LD_FLAVOR}" = xLLD ] ; then \

diff --git a/sys-libs/efivar/files/efivar-38-lld-fixes.patch 
b/sys-libs/efivar/files/efivar-38-lld-fixes.patch
deleted file mode 100644
index c0fbee802edd..000000000000
--- a/sys-libs/efivar/files/efivar-38-lld-fixes.patch
+++ /dev/null
@@ -1,345 +0,0 @@
-https://bugs.gentoo.org/831472
-
-From b23aba1469de8bb7a115751f9cd294ad3aaa6680 Mon Sep 17 00:00:00 2001
-From: Ali Abdel-Qader <[email protected]>
-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 <[email protected]>
----
- 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?= <[email protected]>
-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 <[email protected]>
----
- 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 <[email protected]>
-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 <[email protected]>
-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 $@ [email protected]
- 
- %.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);
- 

diff --git a/sys-libs/efivar/files/efivar-38-march-native.patch 
b/sys-libs/efivar/files/efivar-38-march-native.patch
deleted file mode 100644
index a970d8d6de6b..000000000000
--- a/sys-libs/efivar/files/efivar-38-march-native.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 43d19f297548208ce549fd87faa41e6bb86bf9c3 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <[email protected]>
-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 <[email protected]>
----
- 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)

Reply via email to