[vlc-commits] contrib: goom: Fix building for i386 with clang

Martin Storsjö git at videolan.org
Fri Jun 19 09:06:26 CEST 2020


vlc/vlc-3.0 | branch: master | Martin Storsjö <martin at martin.st> | Sat Feb 24 00:14:13 2018 +0200| [1436ac0de104af7664d7c0769cb0015a39164734] | committer: Steve Lhomme

contrib: goom: Fix building for i386 with clang

This is based on a patch from gst-plugins-good (which bundles a copy
of the goom sources), based on a patch from FreeBSD ports.

(cherry picked from commit 8743195a1a6b58efb79eeac74d375fb2ff414ce7)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=1436ac0de104af7664d7c0769cb0015a39164734
---

 contrib/src/goom/clang-emms.patch | 54 +++++++++++++++++++++++++++++++++++++++
 contrib/src/goom/rules.mak        |  1 +
 2 files changed, 55 insertions(+)

diff --git a/contrib/src/goom/clang-emms.patch b/contrib/src/goom/clang-emms.patch
new file mode 100644
index 0000000000..6fa423cd5e
--- /dev/null
+++ b/contrib/src/goom/clang-emms.patch
@@ -0,0 +1,54 @@
+From 94ad6724ba5c0136d385cc0f052db636bf99a86c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <slomo at circular-chaos.org>
+Date: Sat, 21 Sep 2013 18:46:29 +0200
+Subject: goom: Fix MMX assembly compilation with clang
+
+clang does not want or need a clobber list for emms:
+error: clobbers must be last on the x87 stack
+
+Patch taken from the FreeBSD ports, provided by
+Dan McGregor <dan.mcgregor at usask.ca>
+---
+Adapted from here:
+https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=94ad6724ba5c0136d385cc0f052db636bf99a86c
+---
+ src/mmx.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/mmx.h b/src/mmx.h
+index 3fae26b..2649e10 100644
+--- a/src/mmx.h
++++ b/src/mmx.h
+@@ -711,17 +711,29 @@ void zoom_filter_xmmx (int prevX, int prevY, Pixel *expix1, Pixel *expix2,
+ */
+ #ifdef	MMX_TRACE
+ 
++#ifdef __clang__
++#define emms() \
++	{ \
++		printf("emms()\n"); \
++		__asm__ __volatile__ ("emms"); \
++	}
++#else
+ #define	emms() \
+ 	{ \
+ 		printf("emms()\n"); \
+ 		__asm__ __volatile__ ("emms" \
+                         "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)"); \
+ 	}
++#endif
+ 
+ #else
+ 
++#ifdef __clang__
++#define	emms() __asm__ __volatile__ ("emms")
++#else
+ #define	emms() __asm__ __volatile__ ("emms"::: \
+                       "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)")
++#endif
+ 
+ #endif
+ 
+-- 
+cgit v1.1
+
diff --git a/contrib/src/goom/rules.mak b/contrib/src/goom/rules.mak
index 7bc27c255d..64e96e6e1e 100644
--- a/contrib/src/goom/rules.mak
+++ b/contrib/src/goom/rules.mak
@@ -26,6 +26,7 @@ endif
 ifdef HAVE_MACOSX
 	$(APPLY) $(SRC)/goom/goom2k4-osx.patch
 endif
+	$(APPLY) $(SRC)/goom/clang-emms.patch
 	$(MOVE)
 
 .goom: goom



More information about the vlc-commits mailing list