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 <[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-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 <[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