summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeshav Amburay2013-06-08 14:00:20 +0530
committerKeshav Amburay2013-06-08 14:00:20 +0530
commit20339d229092eda68fcd6693199965a80bf3399c (patch)
tree31bc86f718cf155d1f4a1fd7cbf2bbbc79977af3
parente6355d135665162c60e70379e5923055ffffd091 (diff)
downloadaur-20339d229092eda68fcd6693199965a80bf3399c.tar.gz
Add gnu-efi-disable-mmx-and-sse.patch from Fedora
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD6
-rw-r--r--gnu-efi-disable-mmx-and-sse.patch53
3 files changed, 61 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c412097712e3..162cb048ed5e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -13,9 +13,11 @@ pkgbase = gnu-efi-libs-git
options = !makeflags
source = gnu-efi::git+git://git.code.sf.net/p/gnu-efi/code#branch=master
source = gnu-efi-fix-makefile-vars.patch
+ source = gnu-efi-disable-mmx-and-sse.patch
source = gnu-efi-disable-USE_MS_ABI.patch
sha1sums = SKIP
sha1sums = eec2b954aa44407b38342be567e767cea302b7c8
+ sha1sums = 9c9ed8bc8bf76105302b9d57a516f3bab5d6ffa9
sha1sums = 5e6b30cdf2c1d89ccb3f5314bb3e0ef0d45b0001
pkgname = gnu-efi-libs-git
diff --git a/PKGBUILD b/PKGBUILD
index 022ade575429..60f1c11f1a52 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,10 +27,12 @@ provides=('gnu-efi-libs')
source=("${_gitname}::git+${_gitroot}#branch=${_gitbranch}"
'gnu-efi-fix-makefile-vars.patch'
+ 'gnu-efi-disable-mmx-and-sse.patch'
'gnu-efi-disable-USE_MS_ABI.patch')
sha1sums=('SKIP'
'eec2b954aa44407b38342be567e767cea302b7c8'
+ '9c9ed8bc8bf76105302b9d57a516f3bab5d6ffa9'
'5e6b30cdf2c1d89ccb3f5314bb3e0ef0d45b0001')
pkgver() {
@@ -86,6 +88,10 @@ build() {
patch -Np1 -i "${srcdir}/gnu-efi-fix-makefile-vars.patch" || true
echo
+ ## Disable MMX and SSE in GCC 4.8
+ patch -Np1 -i "${srcdir}/gnu-efi-disable-mmx-and-sse.patch" || true
+ echo
+
## Disable GCC MS_ABI CFLAGS
# patch -Np1 -i "${srcdir}/gnu-efi-disable-USE_MS_ABI.patch" || true
# echo
diff --git a/gnu-efi-disable-mmx-and-sse.patch b/gnu-efi-disable-mmx-and-sse.patch
new file mode 100644
index 000000000000..563661bec796
--- /dev/null
+++ b/gnu-efi-disable-mmx-and-sse.patch
@@ -0,0 +1,53 @@
+From d703c370c78578b63e7b5e04a3801c7f5fbf0c94 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Fri, 31 May 2013 15:00:11 -0400
+Subject: [PATCH] Disable MMX and SSE.
+
+GCC 4.8.0 adds some optimizations that will use movups/movaps (and use
+%xmm* registers) when they're faster, and of course that won't work at
+all since UEFI firmwares aren't guaranteed to initialize the mmx/sse
+instructions.
+
+This will be even more annoying, since most UEFI firmwares don't
+initialize the #DE or #UD trap handlers, and your backtrace will be a
+random path through uninitialized memory, occasionally including
+whatever address the IDT has for #UD, but also addresses like "0x4" and
+"0x507" that you don't normally expect to see in your call path.
+---
+ Make.defaults | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/Make.defaults b/Make.defaults
+index 0585915..ea7513e 100644
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -60,7 +60,9 @@ CPPFLAGS = -DCONFIG_$(ARCH)
+ ifeq ($(GCCNEWENOUGH),1)
+ CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
+ endif
+-CFLAGS = $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -ffreestanding -fno-stack-protector -fno-stack-check
++CFLAGS = $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing \
++ -fno-merge-constants -ffreestanding -fno-stack-protector \
++ -fno-stack-check
+ ASFLAGS = $(ARCH3264)
+ LDFLAGS = -nostdlib --no-undefined
+ INSTALL = install
+@@ -78,13 +80,14 @@ ifeq ($(ARCH),ia64)
+ endif
+
+ ifeq ($(ARCH), ia32)
++ CFLAGS += -mno-mmx -mno-sse
+ ifeq ($(HOSTARCH), x86_64)
+ ARCH3264 = -m32
+ endif
+ endif
+
+ ifeq ($(ARCH), x86_64)
+- CFLAGS += -mno-red-zone
++ CFLAGS += -mno-red-zone -mno-mmx -mno-sse
+ ifeq ($(HOSTARCH), ia32)
+ ARCH3264 = -m64
+ endif
+--
+1.8.2.1
+