contrib: pthreads: Don't use x86 inline asm on non-x86 platforms
authorMartin Storsjö <martin@martin.st>
Wed, 10 Jan 2018 12:54:49 +0000 (14:54 +0200)
committerMartin Storsjö <martin@martin.st>
Sun, 25 Feb 2018 22:32:12 +0000 (00:32 +0200)
contrib/src/pthreads/rules.mak
contrib/src/pthreads/x86-inline-asm.patch [new file with mode: 0644]

index 8aeaf90..9bc9014 100644 (file)
@@ -21,6 +21,7 @@ ifdef HAVE_WINSTORE
 endif
        $(APPLY) $(SRC)/pthreads/implib.patch
        $(APPLY) $(SRC)/pthreads/remove-inline.patch
+       $(APPLY) $(SRC)/pthreads/x86-inline-asm.patch
        $(MOVE)
 
 ifdef HAVE_CROSS_COMPILE
diff --git a/contrib/src/pthreads/x86-inline-asm.patch b/contrib/src/pthreads/x86-inline-asm.patch
new file mode 100644 (file)
index 0000000..0169a19
--- /dev/null
@@ -0,0 +1,12 @@
+diff -u pthreads-orig/implement.h pthreads/implement.h
+--- pthreads-orig/implement.h  2012-03-18 07:11:43.000000000 +0200
++++ pthreads/implement.h       2018-01-10 14:53:53.596756881 +0200
+@@ -746,7 +746,7 @@
+  *
+  * The above aren't available in Mingw32 as of gcc 4.5.2 so define our own.
+  */
+-#if defined(__GNUC__)
++#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+ # if defined(_WIN64)
+ # define PTW32_INTERLOCKED_COMPARE_EXCHANGE_64(location, value, comparand)    \
+     ({                                                                     \