sys-boot/gnu-efi: Fix building with clang-9
authorPeter Levine <plevine457@gmail.com>
Wed, 25 Sep 2019 07:26:23 +0000 (03:26 -0400)
committerMike Gilbert <floppym@gentoo.org>
Thu, 3 Oct 2019 21:02:05 +0000 (17:02 -0400)
Fix the build to emit valid CFLAGS for clang.

Closes: https://bugs.gentoo.org/695612
Closes: https://github.com/gentoo/gentoo/pull/13033
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Peter Levine <plevine457@gmail.com>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
sys-boot/gnu-efi/files/gnu-efi-3.0.9-fix-clang-build.patch [new file with mode: 0644]
sys-boot/gnu-efi/gnu-efi-3.0.9.ebuild

diff --git a/sys-boot/gnu-efi/files/gnu-efi-3.0.9-fix-clang-build.patch b/sys-boot/gnu-efi/files/gnu-efi-3.0.9-fix-clang-build.patch
new file mode 100644 (file)
index 0000000..0e4ec7d
--- /dev/null
@@ -0,0 +1,19 @@
+Bug: https://bugs.gentoo.org/695612
+Upstream: https://sourceforge.net/p/gnu-efi/patches/70/
+
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -110,10 +110,10 @@
+                             || ( [ $(GCCVERSION) -eq "4" ]      \
+                                  && [ $(GCCMINOR) -ge "7" ] ) ) \
+                           && echo 1)
+-  ifeq ($(GCCNEWENOUGH),1)
+-    CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
+-  else ifeq ($(USING_CLANG),clang)
++  ifeq ($(USING_CLANG),clang)
+     CPPFLAGS += -DGNU_EFI_USE_MS_ABI --std=c11
++  else ifeq ($(GCCNEWENOUGH),1)
++    CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
+   endif
+   CFLAGS += -mno-red-zone
index fa23e18d91de43bc7c89aa76bf4ff0d6e14be080..57a9ed662e5bbffffbedec03ec75f39908d88998 100644 (file)
@@ -24,9 +24,11 @@ IUSE="abi_x86_32 abi_x86_64 custom-cflags"
 QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
 RESTRICT="strip"
 
+PATCHES=( "${FILESDIR}"/${PN}-3.0.9-fix-clang-build.patch )
+
 src_prepare() {
-       sed -i -e "s/-Werror//" Make.defaults || die
        default
+       sed -i -e "s/-Werror//" Make.defaults || die
 }
 
 efimake() {