aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2006-05-29 01:32:39 +0800
committertegge <tegge@FreeBSD.org>2006-05-29 01:32:39 +0800
commitfd96ab04d32c94509f89203462b6f50c92103b06 (patch)
tree1b22229c8201b671ab7c00d1848eb98eda2eb3c8 /devel
parent2974154c67bf2e4482b2d2bd6d6e39983468fd0b (diff)
downloadfreebsd-ports-gnome-fd96ab04d32c94509f89203462b6f50c92103b06.tar.gz
freebsd-ports-gnome-fd96ab04d32c94509f89203462b6f50c92103b06.tar.zst
freebsd-ports-gnome-fd96ab04d32c94509f89203462b6f50c92103b06.zip
Backport 2002-03-22 fix from newer linuxthreads versions defining
MEMORY_BARRIER() as a asm op which clobbers memory to avoid unintended reordering by the compiler.
Diffstat (limited to 'devel')
-rw-r--r--devel/linuxthreads/files/patch-barrier21
1 files changed, 21 insertions, 0 deletions
diff --git a/devel/linuxthreads/files/patch-barrier b/devel/linuxthreads/files/patch-barrier
new file mode 100644
index 000000000000..f60402d634c0
--- /dev/null
+++ b/devel/linuxthreads/files/patch-barrier
@@ -0,0 +1,21 @@
+--- internals.h.orig Tue May 16 00:23:50 2006
++++ internals.h Tue May 16 00:24:21 2006
+@@ -395,12 +395,14 @@
+ #endif
+ }
+
+-/* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the architecture
+- doesn't need a memory barrier instruction (e.g. Intel x86). Some
+- architectures distinguish between full, read and write barriers. */
++/* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the
++ architecture doesn't need a memory barrier instruction (e.g. Intel
++ x86). Still we need the compiler to respect the barrier and emit
++ all outstanding operations which modify memory. Some architectures
++ distinguish between full, read and write barriers. */
+
+ #ifndef MEMORY_BARRIER
+-#define MEMORY_BARRIER()
++#define MEMORY_BARRIER() asm ("" : : : "memory")
+ #endif
+ #ifndef READ_MEMORY_BARRIER
+ #define READ_MEMORY_BARRIER() MEMORY_BARRIER()