Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/efivar/, sys-libs/efivar/files/
Date: Mon, 17 Jan 2022 16:55:23
Message-Id: 1642438426.d797ef2bb92c4563459fbf326b2ec0a81baa4ffc.floppym@gentoo
1 commit: d797ef2bb92c4563459fbf326b2ec0a81baa4ffc
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 17 16:53:46 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 17 16:53:46 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d797ef2b
7
8 sys-libs/efivar: add a couple patches
9
10 Fix Makefile so objects are not rebuilt in src_install.
11 Drop -march=native when building makeguids.
12
13 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
14
15 sys-libs/efivar/efivar-38.ebuild | 9 ++----
16 sys-libs/efivar/files/efivar-38-Makefile-dep.patch | 33 +++++++++++++++++++
17 sys-libs/efivar/files/efivar-38-march-native.patch | 37 ++++++++++++++++++++++
18 3 files changed, 73 insertions(+), 6 deletions(-)
19
20 diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild
21 index ae6cba87f271..24459558e6fc 100644
22 --- a/sys-libs/efivar/efivar-38.ebuild
23 +++ b/sys-libs/efivar/efivar-38.ebuild
24 @@ -29,7 +29,9 @@ DEPEND="${RDEPEND}
25
26 src_prepare() {
27 local PATCHES=(
28 - "${FILESDIR}"/${PN}-38-ia64-relro.patch
29 + "${FILESDIR}"/efivar-38-ia64-relro.patch
30 + "${FILESDIR}"/efivar-38-march-native.patch
31 + "${FILESDIR}"/efivar-38-Makefile-dep.patch
32 )
33 default
34 }
35 @@ -57,8 +59,3 @@ src_configure() {
36 # Used by tests/Makefile
37 export GRUB_PREFIX=grub
38 }
39 -
40 -src_compile() {
41 - # https://bugs.gentoo.org/831334
42 - emake HOST_MARCH=
43 -}
44
45 diff --git a/sys-libs/efivar/files/efivar-38-Makefile-dep.patch b/sys-libs/efivar/files/efivar-38-Makefile-dep.patch
46 new file mode 100644
47 index 000000000000..64e3f4e0b7c4
48 --- /dev/null
49 +++ b/sys-libs/efivar/files/efivar-38-Makefile-dep.patch
50 @@ -0,0 +1,33 @@
51 +From 847856cd72088fd5f2349be858745c632c46b6c8 Mon Sep 17 00:00:00 2001
52 +From: Mike Gilbert <floppym@g.o>
53 +Date: Mon, 17 Jan 2022 11:42:53 -0500
54 +Subject: [PATCH] Adjust dependency for libefivar and libefiboot objects
55 +
56 +Depending on 'prep' causes all objects to be rebuilt every time 'make'
57 +is invoked.
58 +
59 +Depending on '$(GENERATED_SOURCES)' causes a build failure because
60 +guid-symbols.c gets passed to the compiler due to a rule in rules.mk.
61 +
62 +Depend on 'include/efivar/efivar-guids.h' directly to avoid these
63 +issues.
64 +
65 +Fixes: https://github.com/rhboot/efivar/issues/199
66 +Signed-off-by: Mike Gilbert <floppym@g.o>
67 +---
68 + src/Makefile | 2 +-
69 + 1 file changed, 1 insertion(+), 1 deletion(-)
70 +
71 +diff --git a/src/Makefile b/src/Makefile
72 +index 0e423c44..c6006ebf 100644
73 +--- a/src/Makefile
74 ++++ b/src/Makefile
75 +@@ -85,7 +85,7 @@ $(MAKEGUIDS_OUTPUT) : guids.txt
76 +
77 + prep : makeguids $(GENERATED_SOURCES)
78 +
79 +-$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : prep
80 ++$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : include/efivar/efivar-guids.h
81 +
82 + libefivar.a : | $(GENERATED_SOURCES)
83 + libefivar.a : $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS))
84
85 diff --git a/sys-libs/efivar/files/efivar-38-march-native.patch b/sys-libs/efivar/files/efivar-38-march-native.patch
86 new file mode 100644
87 index 000000000000..a970d8d6de6b
88 --- /dev/null
89 +++ b/sys-libs/efivar/files/efivar-38-march-native.patch
90 @@ -0,0 +1,37 @@
91 +From 43d19f297548208ce549fd87faa41e6bb86bf9c3 Mon Sep 17 00:00:00 2001
92 +From: Mike Gilbert <floppym@g.o>
93 +Date: Mon, 17 Jan 2022 10:13:31 -0500
94 +Subject: [PATCH] Drop "-march=native" from HOST flags
95 +
96 +GCC does not support -march=native on some targets (ia64, riscv).
97 +The performance enhancement for makeguids isn't worth the trouble it
98 +causes.
99 +
100 +Bug: https://bugs.gentoo.org/831334
101 +Signed-off-by: Mike Gilbert <floppym@g.o>
102 +---
103 + src/include/defaults.mk | 8 +-------
104 + 1 file changed, 1 insertion(+), 7 deletions(-)
105 +
106 +diff --git a/src/include/defaults.mk b/src/include/defaults.mk
107 +index 632b1551..9024a3a1 100644
108 +--- a/src/include/defaults.mk
109 ++++ b/src/include/defaults.mk
110 +@@ -71,16 +71,10 @@ override SOFLAGS = $(_SOFLAGS) \
111 + -Wl,--version-script=$(MAP) \
112 + $(call family,SOFLAGS)
113 +
114 +-HOST_ARCH=$(shell uname -m)
115 +-ifneq ($(HOST_ARCH),ia64)
116 +- HOST_MARCH=-march=native
117 +-else
118 +- HOST_MARCH=
119 +-endif
120 + HOST_CPPFLAGS ?= $(CPPFLAGS)
121 + override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
122 + override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \
123 +- -DEFIVAR_BUILD_ENVIRONMENT $(HOST_MARCH)
124 ++ -DEFIVAR_BUILD_ENVIRONMENT
125 + HOST_CFLAGS_GCC ?=
126 + HOST_CFLAGS_CLANG ?=
127 + HOST_CFLAGS ?= $(CFLAGS) $(call family,HOST_CFLAGS)