summaryrefslogtreecommitdiffstats
path: root/linuxsampler/build/patches/linuxsampler_nptl-hardened.patch
diff options
context:
space:
mode:
Diffstat (limited to 'linuxsampler/build/patches/linuxsampler_nptl-hardened.patch')
-rw-r--r--linuxsampler/build/patches/linuxsampler_nptl-hardened.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/linuxsampler/build/patches/linuxsampler_nptl-hardened.patch b/linuxsampler/build/patches/linuxsampler_nptl-hardened.patch
new file mode 100644
index 00000000..0c61f096
--- /dev/null
+++ b/linuxsampler/build/patches/linuxsampler_nptl-hardened.patch
@@ -0,0 +1,15 @@
+Fix breakage caused by undefined behaviour. Using PTHREAD_CANCEL_ASYNCHRONOUS
+is only allowed in pure functions.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=537516
+
+--- linuxsampler-2.0.0/m4/nptl_bug.m4
++++ linuxsampler-2.0.0/m4/nptl_bug.m4
+@@ -47,7 +47,7 @@
+ void* __pthread_launcher(void* p) {
+ // let the thread be killable under any circumstances
+ // (without this function call, this test always succeeds !)
+- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
++ pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+
+ // this will block this 2nd thread, since we already
+ // locked this mutex by the main thread