summaryrefslogtreecommitdiff
path: root/5.3/0014-GNU-libstdc-enable-linux-futex.patch
blob: 5aa37a65cb802c44f40bb87eb721afb95fc0577f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 5de3d2a95e4aec65a063a1b3262aca1766933c95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
 <Bernhard.Rosenkranzer@linaro.org>
Date: Mon, 6 Jan 2014 00:10:10 +0100
Subject: [PATCH 14/17] GNU libstdc++ --enable-linux-futex
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
---
 libstdc++-v3/configure          | 12 ++++++++++++
 libstdc++-v3/libsupc++/guard.cc |  5 +++++
 2 files changed, 17 insertions(+)

diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index a943808..6fe69df 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -70978,6 +70978,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
 	   int lk;
+#if !defined(SYS_gettid)
+#define SYS_gettid __NR_gettid
+#endif
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
 int
 main ()
 {
@@ -71036,6 +71042,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
 	   int lk;
+#if !defined(SYS_gettid)
+#define SYS_gettid __NR_gettid
+#endif
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
 int
 main ()
 {
diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
index 54f7458..45de1bb 100644
--- a/libstdc++-v3/libsupc++/guard.cc
+++ b/libstdc++-v3/libsupc++/guard.cc
@@ -33,7 +33,12 @@
 #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
   && (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
 # include <climits>
+#if defined(__ANDROID__)
+# include <sys/syscall.h>
+# define SYS_futex __NR_futex
+#else
 # include <syscall.h>
+#endif
 # include <unistd.h>
 # define _GLIBCXX_USE_FUTEX
 # define _GLIBCXX_FUTEX_WAIT 0
-- 
1.8.4.5