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@gentoo.org>
This commit is contained in:
Mike Gilbert
2022-01-17 11:53:46 -05:00
parent c3617f0ef2
commit d797ef2bb9
3 changed files with 73 additions and 6 deletions
+3 -6
View File
@@ -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=
}
@@ -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))
@@ -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)