Fix gstreamer crash on Geode (#746185)

This commit is contained in:
Daniel Drake 2011-10-14 11:14:42 +01:00 committed by Fabian Deutsch
parent 1ce530b2ea
commit 84217fdd05
3 changed files with 105 additions and 2 deletions

40
orc-no-nopl.patch Normal file
View File

@ -0,0 +1,40 @@
From 4f813175b93ba44ba3f91cec28f8393d996ff918 Mon Sep 17 00:00:00 2001
From: David Schleef <ds@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

56
orc-no-nopw.patch Normal file
View File

@ -0,0 +1,56 @@
From 574ee1ee5025d9941e44238e846f6074fbdf2e87 Mon Sep 17 00:00:00 2001
From: David Schleef <ds@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

View File

@ -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@laptop.org> - 0.4.16-2
- Add upstream patches to fix gstreamer crash on Geode (#746185)
* Mon Oct 03 2011 Fabian Deutsch <fabiand@fedoraproject.org> - 0.4.16-1
- Update to 0.4.16
- Fixing regression introdcued by 0.4.15 (#742534 and #734911)