This fixes linking failures
Source/WTF/wtf/text/StringImpl.h:1115: undefined reference to 
`__atomic_compare_exchange_1'

Signed-off-by: Khem Raj <[email protected]>
---
v2: Switch to upstream submitted patch instead of making RISCV specific

 ...ics-check-to-include-1-byte-CAS-test.patch | 77 +++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.30.5.bb  |  2 +
 2 files changed, 79 insertions(+)
 create mode 100644 
meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch

diff --git 
a/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch
 
b/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch
new file mode 100644
index 0000000000..93bda4d754
--- /dev/null
+++ 
b/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch
@@ -0,0 +1,77 @@
+From 40520b0de69d8ca8e659248f5ffe641f33cc6dee Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 9 Mar 2021 14:16:58 -0800
+Subject: [PATCH] Extend atomics check to include 1-byte CAS test
+
+Rename ATOMIC_INT64_REQUIRES_LIBATOMIC to ATOMICS_REQUIRE_LIBATOMIC so
+it can reflect broader range which is now checked
+
+Rename ATOMIC_INT64_IS_BUILTIN to ATOMICS_ARE_BUILTIN
+
+Upstream-Status: Submitted 
[https://bugs.webkit.org/attachment.cgi?bugid=222959]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Source/JavaScriptCore/CMakeLists.txt   |  2 +-
+ Source/WebKit/CMakeLists.txt           |  2 +-
+ Source/cmake/WebKitCompilerFlags.cmake | 15 ++++++++++-----
+ 3 files changed, 12 insertions(+), 7 deletions(-)
+
+--- a/Source/JavaScriptCore/CMakeLists.txt
++++ b/Source/JavaScriptCore/CMakeLists.txt
+@@ -129,7 +129,7 @@ if (USE_CAPSTONE)
+     list(APPEND JavaScriptCore_LIBRARIES capstone)
+ endif ()
+ 
+-if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
++if (ATOMICS_REQUIRE_LIBATOMIC)
+     list(APPEND JavaScriptCore_LIBRARIES atomic)
+ endif ()
+ 
+--- a/Source/WebKit/CMakeLists.txt
++++ b/Source/WebKit/CMakeLists.txt
+@@ -337,7 +337,7 @@ if (USE_LIBWEBRTC)
+     list(APPEND WebKit_LIBRARIES webrtc)
+ endif ()
+ 
+-if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
++if (ATOMICS_REQUIRE_LIBATOMIC)
+     list(APPEND WebKit_PRIVATE_LIBRARIES atomic)
+ endif ()
+ 
+--- a/Source/cmake/WebKitCompilerFlags.cmake
++++ b/Source/cmake/WebKitCompilerFlags.cmake
+@@ -280,12 +280,17 @@ endif ()
+ if (COMPILER_IS_GCC_OR_CLANG)
+     set(ATOMIC_TEST_SOURCE "
+         #include <atomic>
+-        int main() { std::atomic<int64_t> i(0); i++; return 0; }
++        int main() {
++          std::atomic<int64_t> i(0);
++          std::atomic<int8_t> j(0);
++          i++; j++;
++          return 0;
++        }
+     ")
+-    check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_IS_BUILTIN)
+-    if (NOT ATOMIC_INT64_IS_BUILTIN)
++    check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMICS_ARE_BUILTIN)
++    if (NOT ATOMICS_ARE_BUILTIN)
+         set(CMAKE_REQUIRED_LIBRARIES atomic)
+-        check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" 
ATOMIC_INT64_REQUIRES_LIBATOMIC)
++        check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" 
ATOMICS_REQUIRE_LIBATOMIC)
+         unset(CMAKE_REQUIRED_LIBRARIES)
+     endif ()
+ endif ()
+--- a/Source/WTF/wtf/CMakeLists.txt
++++ b/Source/WTF/wtf/CMakeLists.txt
+@@ -529,6 +529,10 @@ list(APPEND WTF_LIBRARIES
+     ICU::uc
+ )
+ 
++if (ATOMICS_REQUIRE_LIBATOMIC)
++    list(APPEND WTF_LIBRARIES atomic)
++endif ()
++
+ set(WTF_INTERFACE_LIBRARIES WTF)
+ set(WTF_INTERFACE_INCLUDE_DIRECTORIES ${WTF_FRAMEWORK_HEADERS_DIR})
+ set(WTF_INTERFACE_DEPENDENCIES WTF_CopyHeaders)
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb 
b/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb
index a1dd76ce81..d0a41f48c7 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb
@@ -19,7 +19,9 @@ SRC_URI = 
"https://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
            file://include_array.patch \
            file://include_xutil.patch \
            file://reduce-memory-overheads.patch \
+           file://0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch \
            "
+
 SRC_URI[sha256sum] = 
"7d0dab08e3c5ae07bec80b2822ef42e952765d5724cac86eb23999bfed5a7f1f"
 
 inherit cmake pkgconfig gobject-introspection perlnative features_check 
upstream-version-is-even gtk-doc
-- 
2.30.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149196): 
https://lists.openembedded.org/g/openembedded-core/message/149196
Mute This Topic: https://lists.openembedded.org/mt/81214160/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to