[orc] Fix gstreamer crash on Geode (#746185)
Fabian Deutsch
fabiand at fedoraproject.org
Sun Oct 16 12:44:12 UTC 2011
commit 84217fdd057d8eabc83393efdd1c671786342494
Author: Daniel Drake <dsd at laptop.org>
Date: Fri Oct 14 11:14:42 2011 +0100
Fix gstreamer crash on Geode (#746185)
orc-no-nopl.patch | 40 +++++++++++++++++++++++++++++++++++++
orc-no-nopw.patch | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
orc.spec | 11 ++++++++-
3 files changed, 105 insertions(+), 2 deletions(-)
---
diff --git a/orc-no-nopl.patch b/orc-no-nopl.patch
new file mode 100644
index 0000000..ebac7c5
--- /dev/null
+++ b/orc-no-nopl.patch
@@ -0,0 +1,40 @@
+From 4f813175b93ba44ba3f91cec28f8393d996ff918 Mon Sep 17 00:00:00 2001
+From: David Schleef <ds at schleef.org>
+Date: Thu, 13 Oct 2011 23:02:00 -0700
+Subject: [PATCH] x86insn: quick fix for lack of nopl support
+
+Geode (as well as others) don't have nopl. So don't use it
+for alignment.
+---
+ orc/orcx86insn.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/orc/orcx86insn.c b/orc/orcx86insn.c
+index 659ebc5..78ca30d 100644
+--- a/orc/orcx86insn.c
++++ b/orc/orcx86insn.c
+@@ -520,12 +520,21 @@ orc_uint8 nop_codes[][16] = {
+ { 0 /* MSVC wants something here */ },
+ { 0x90 },
+ { 0x66, 0x90 }, /* xchg %ax,%ax */
++#if 0
+ { 0x0f, 0x1f, 0x00 }, /* nopl (%rax) */
+ { 0x0f, 0x1f, 0x40, 0x00 }, /* nopl 0x0(%rax) */
+ { 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */
+ { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
+ { 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax) */
+ { 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */
++#else
++ { 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++#endif
+ { 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
+ /* Forms of nopw %cs:0x0(%rax,%rax,1) */
+ { 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 },
+--
+1.7.0.4
+
diff --git a/orc-no-nopw.patch b/orc-no-nopw.patch
new file mode 100644
index 0000000..ed0ac20
--- /dev/null
+++ b/orc-no-nopw.patch
@@ -0,0 +1,56 @@
+From 574ee1ee5025d9941e44238e846f6074fbdf2e87 Mon Sep 17 00:00:00 2001
+From: David Schleef <ds at schleef.org>
+Date: Sat, 15 Oct 2011 11:51:17 -0700
+Subject: [PATCH] x86insn: switch to ultra-conservative nops
+
+---
+ orc/orcx86insn.c | 26 ++++++++++++++++++--------
+ 1 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/orc/orcx86insn.c b/orc/orcx86insn.c
+index 78ca30d..33982e2 100644
+--- a/orc/orcx86insn.c
++++ b/orc/orcx86insn.c
+@@ -527,14 +527,6 @@ orc_uint8 nop_codes[][16] = {
+ { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
+ { 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax) */
+ { 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */
+-#else
+- { 0x90, 0x90, 0x90 },
+- { 0x90, 0x90, 0x90, 0x90 },
+- { 0x90, 0x90, 0x90, 0x90, 0x90 },
+- { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
+- { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
+- { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
+-#endif
+ { 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */
+ /* Forms of nopw %cs:0x0(%rax,%rax,1) */
+ { 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 },
+@@ -546,6 +538,24 @@ orc_uint8 nop_codes[][16] = {
+ 0x00, 0x00 },
+ { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00,
+ 0x00, 0x00, 0x00 },
++#else
++ { 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
++ 0x90, },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
++ 0x90, 0x90, },
++ { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
++ 0x90, 0x90, 0x90, },
++#endif
+ };
+
+ void
+--
+1.7.0.4
+
diff --git a/orc.spec b/orc.spec
index 7f616ad..1c0c891 100644
--- a/orc.spec
+++ b/orc.spec
@@ -1,6 +1,6 @@
Name: orc
Version: 0.4.16
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The Oil Run-time Compiler
Group: System Environment/Libraries
@@ -11,6 +11,8 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gtk-doc, libtool
+Patch1: orc-no-nopl.patch
+Patch2: orc-no-nopw.patch
%description
Orc is a library and set of tools for compiling and executing
@@ -51,7 +53,9 @@ The Orc compiler, to produce optimized code.
%prep
-%setup -q
+%setup -q
+%patch1 -p1
+%patch2 -p1
autoreconf -vif
@@ -115,6 +119,9 @@ make check
%changelog
+* Sun Oct 16 2011 Daniel Drake <dsd at laptop.org> - 0.4.16-2
+- Add upstream patches to fix gstreamer crash on Geode (#746185)
+
* Mon Oct 03 2011 Fabian Deutsch <fabiand at fedoraproject.org> - 0.4.16-1
- Update to 0.4.16
- Fixing regression introdcued by 0.4.15 (#742534 and #734911)
More information about the scm-commits
mailing list