summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dahl <matthias.dahl@binary-island.eu>2017-07-04 10:02:11 +0200
committerMike Gilbert <floppym@gentoo.org>2017-07-09 11:07:40 -0400
commit3d47ec7831aa3c05e7b9dd2fad67e3e9dcb38c18 (patch)
treef8f95baff37b168fb22456498b2ed3de99126fd6 /sys-boot
parentkde-frameworks/kpackage: Fix tests (diff)
downloadgentoo-3d47ec7831aa3c05e7b9dd2fad67e3e9dcb38c18.tar.gz
gentoo-3d47ec7831aa3c05e7b9dd2fad67e3e9dcb38c18.tar.bz2
gentoo-3d47ec7831aa3c05e7b9dd2fad67e3e9dcb38c18.zip
sys-boot/gnu-efi: Add custom-cflags flag and prevent avx instructions
Building gnu-efi with custom compiler flags is risky at best and should generally be avoided. Nevertheless, if custom flags are used, we need to make sure no avx instructions are generated as those cause a non-functional gnu-efi build. This is only required for >= 3.0.5 as prior to this, "-mno-sse" was used which also implied no avx. Fixes bug #619628.
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild (renamed from sys-boot/gnu-efi/gnu-efi-3.0.6.ebuild)13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0.6.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild
index 838f2b4ecb0c..356ce6f38e93 100644
--- a/sys-boot/gnu-efi/gnu-efi-3.0.6.ebuild
+++ b/sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild
@@ -19,7 +19,7 @@ SLOT="0"
# IA64 build is broken in setjmp code:
# https://sourceforge.net/p/gnu-efi/bugs/9/
KEYWORDS="-* ~amd64 ~arm ~arm64 -ia64 ~x86"
-IUSE="abi_x86_32 abi_x86_64"
+IUSE="abi_x86_32 abi_x86_64 -custom-cflags"
DEPEND="sys-apps/pciutils"
RDEPEND=""
@@ -61,8 +61,15 @@ efimake() {
src_compile() {
tc-export BUILD_CC AR AS CC LD
- # https://bugs.gentoo.org/607992
- filter-mfpmath sse
+ if use custom-cflags; then
+ # https://bugs.gentoo.org/607992
+ filter-mfpmath sse
+
+ # https://bugs.gentoo.org/619628
+ append-flags $(test-flags-CC -mno-avx)
+ else
+ unset CFLAGS CPPFLAGS LDFLAGS
+ fi
if [[ ${CHOST} == x86_64* ]]; then
use abi_x86_32 && CHOST=i686 ABI=x86 efimake