From e380cf8427ba5f3c073491bdf88488c04beeff6b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 25 Oct 2019 09:55:14 -0700 Subject: sys-libs/efivar: fix compiling makeguids on older hosts This imports a fix for build failures when compiling on older hosts for a newer microarchitectures. Closes: https://bugs.gentoo.org/702584 Signed-off-by: Dmitry Torokhov Signed-off-by: Mike Gilbert Closes: https://github.com/gentoo/gentoo/pull/13435 --- sys-libs/efivar/efivar-37-r1.ebuild | 42 ++++++++++++++++++++++ sys-libs/efivar/efivar-37.ebuild | 38 -------------------- .../efivar-37-makeguids_fix_host_compile.patch | 36 +++++++++++++++++++ 3 files changed, 78 insertions(+), 38 deletions(-) create mode 100644 sys-libs/efivar/efivar-37-r1.ebuild delete mode 100644 sys-libs/efivar/efivar-37.ebuild create mode 100644 sys-libs/efivar/files/efivar-37-makeguids_fix_host_compile.patch (limited to 'sys-libs') diff --git a/sys-libs/efivar/efivar-37-r1.ebuild b/sys-libs/efivar/efivar-37-r1.ebuild new file mode 100644 index 000000000000..878309f4b43a --- /dev/null +++ b/sys-libs/efivar/efivar-37-r1.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit flag-o-matic 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 ia64 x86" + +RDEPEND="dev-libs/popt" +DEPEND="${RDEPEND} + >=sys-kernel/linux-headers-3.18 + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/${P}-makeguids_fix_host_compile.patch" +) + +src_prepare() { + default + sed -i -e 's/-Werror //' gcc.specs || die +} + +src_configure() { + tc-export CC + export CC_FOR_BUILD=$(tc-getBUILD_CC) + tc-ld-disable-gold + export libdir="/usr/$(get_libdir)" + unset LIBS # Bug 562004 + + if [[ -n ${GCC_SPECS} ]]; then + # The environment overrides the command line. + GCC_SPECS+=":${S}/gcc.specs" + fi +} diff --git a/sys-libs/efivar/efivar-37.ebuild b/sys-libs/efivar/efivar-37.ebuild deleted file mode 100644 index f9a608e46d22..000000000000 --- a/sys-libs/efivar/efivar-37.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit flag-o-matic 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 ia64 x86" - -RDEPEND="dev-libs/popt" -DEPEND="${RDEPEND} - >=sys-kernel/linux-headers-3.18 - virtual/pkgconfig -" - -src_prepare() { - default - sed -i -e 's/-Werror //' gcc.specs || die -} - -src_configure() { - tc-export CC - export CC_FOR_BUILD=$(tc-getBUILD_CC) - tc-ld-disable-gold - export libdir="/usr/$(get_libdir)" - unset LIBS # Bug 562004 - - if [[ -n ${GCC_SPECS} ]]; then - # The environment overrides the command line. - GCC_SPECS+=":${S}/gcc.specs" - fi -} diff --git a/sys-libs/efivar/files/efivar-37-makeguids_fix_host_compile.patch b/sys-libs/efivar/files/efivar-37-makeguids_fix_host_compile.patch new file mode 100644 index 000000000000..f0172eb612eb --- /dev/null +++ b/sys-libs/efivar/files/efivar-37-makeguids_fix_host_compile.patch @@ -0,0 +1,36 @@ +From 81346196bb262156fd436c78323d161af61dd6c1 Mon Sep 17 00:00:00 2001 +From: Dmitry Torokhov +Date: Tue, 6 Aug 2019 09:22:25 -0700 +Subject: [PATCH] Make sure makeguids helper is compiled for the host's arch + +Currently makeguids is compiled with the same flags/settings as the rest +of the package, which does not work in case of cross-compiles when arch +of the build host and the target host are different. Let's force +compiling for the native host arch to avoid this issue. + +Note that this is not a full cross-compile solution as this does not +account for potential differences in host/target compilers (versions, +clang vs gcc, etc), but it removes one of the issue with package build +aborting due to invalid instruction on the host. + +Signed-off-by: Dmitry Torokhov +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index addfaa0..3729d2b 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -52,7 +52,7 @@ include/efivar/efivar-guids.h : makeguids guids.txt + ./makeguids guids.txt guids.bin names.bin \ + guid-symbols.c include/efivar/efivar-guids.h + +-makeguids : CPPFLAGS+=-DEFIVAR_BUILD_ENVIRONMENT ++makeguids : CPPFLAGS+=-DEFIVAR_BUILD_ENVIRONMENT -march=native + makeguids : LIBS=dl + makeguids : $(MAKEGUIDS_SOURCES) + makeguids : CCLD=$(CCLD_FOR_BUILD) +-- +2.23.0.866.gb869b98d4c-goog + -- cgit v1.2.3-65-gdbad