aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch
blob: c6157e10378cf57ae76fe9f82c2e50215b6c0bb0 (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
From 0b3811771ae6385503f2d949f9433d8f810d2ff9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 17 May 2017 22:34:24 -0700
Subject: [PATCH 8/9] webkitgtk: Fix build for armv5

Taken from
https://bugs.webkit.org/show_bug.cgi?id=161900

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 Source/WTF/wtf/CMakeLists.txt | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt
index 6b5e45b9..46ee3c22 100644
--- a/Source/WTF/wtf/CMakeLists.txt
+++ b/Source/WTF/wtf/CMakeLists.txt
@@ -205,7 +205,6 @@ set(WTF_HEADERS
 
 set(WTF_SOURCES
     Assertions.cpp
-    Atomics.cpp
     AutomaticThread.cpp
     BitVector.cpp
     CPUTime.cpp
@@ -336,6 +335,15 @@ if (NOT USE_SYSTEM_MALLOC)
     list(APPEND WTF_LIBRARIES bmalloc)
 endif ()
 
+file(WRITE ${CMAKE_BINARY_DIR}/test_atomics.cpp
+     "int main(void)\n"
+     "{ long long x = 1; return (int) __sync_add_and_fetch_8(&x, 1); }\n")
+try_compile(ATOMICS_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomics.cpp)
+if (NOT ATOMICS_BUILD_SUCCEEDED)
+    list(APPEND WTF_SOURCES Atomics.cpp)
+endif ()
+file(REMOVE ${CMAKE_BINARY_DIR}/test_atomics.cpp)
+
 list(APPEND WTF_SOURCES
     unicode/icu/CollatorICU.cpp
 )
-- 
2.14.1