Title: [231973] releases/WebKitGTK/webkit-2.20
Revision
231973
Author
[email protected]
Date
2018-05-18 11:42:40 -0700 (Fri, 18 May 2018)

Log Message

Merged r231843 - [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
https://bugs.webkit.org/show_bug.cgi?id=182622

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsWPE.cmake:
Enable THREADS_PREFER_PTHREAD_FLAG. This uses -pthread instead of
-lpthread, fixing the 64-bit RISC-V build of the GTK+ port due to
missing atomic primitives.

* Source/cmake/WebKitCompilerFlags.cmake:
Move the test to detect whether we need to link against libatomic
to a common CMake file so it can be used from both _javascript_Core
and WebKit.

Source/_javascript_Core:

We were linking _javascript_Core against libatomic in MIPS because
in that architecture __atomic_fetch_add_8() is not a compiler
intrinsic and is provided by that library instead. However other
architectures (e.g armel) are in the same situation, so we need a
generic test.

That test already exists in WebKit/CMakeLists.txt, so we just have
to move it to a common file (WebKitCompilerFlags.cmake) and use
its result (ATOMIC_INT64_REQUIRES_LIBATOMIC) here.

* CMakeLists.txt:

Source/WebKit:

Move the test to determine whether we need to link against
libatomic to the common file WebKitCompilerFlags.cmake so it can
also be used for _javascript_Core.

* CMakeLists.txt:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/ChangeLog (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/ChangeLog	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/ChangeLog	2018-05-18 18:42:40 UTC (rev 231973)
@@ -1,3 +1,22 @@
+2018-05-16  Alberto Garcia  <[email protected]>
+
+        [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
+        https://bugs.webkit.org/show_bug.cgi?id=182622
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/OptionsGTK.cmake:
+        * Source/cmake/OptionsJSCOnly.cmake:
+        * Source/cmake/OptionsWPE.cmake:
+        Enable THREADS_PREFER_PTHREAD_FLAG. This uses -pthread instead of
+        -lpthread, fixing the 64-bit RISC-V build of the GTK+ port due to
+        missing atomic primitives.
+
+        * Source/cmake/WebKitCompilerFlags.cmake:
+        Move the test to detect whether we need to link against libatomic
+        to a common CMake file so it can be used from both _javascript_Core
+        and WebKit.
+
 2018-05-17  Carlos Alberto Lopez Perez  <[email protected]>
 
         [WPE] Implement and enable FULLSCREEN_API

Modified: releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/CMakeLists.txt (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/CMakeLists.txt	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/CMakeLists.txt	2018-05-18 18:42:40 UTC (rev 231973)
@@ -116,14 +116,8 @@
     ${LLVM_LIBRARIES}
 )
 
-# Since r228149, on MIPS we need to link with -latomic, because
-# __atomic_fetch_add_8 is not available as a compiler intrinsic. It is
-# available on other platforms (including 32-bit Arm), so the link with
-# libatomic is only neede on MIPS.
-if (WTF_CPU_MIPS)
-    list(APPEND _javascript_Core_LIBRARIES
-        -latomic
-    )
+if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
+    list(APPEND _javascript_Core_LIBRARIES atomic)
 endif ()
 
 set(_javascript_Core_SCRIPTS_SOURCES_DIR "${_javascript_CORE_DIR}/Scripts")

Modified: releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/ChangeLog (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/ChangeLog	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/ChangeLog	2018-05-18 18:42:40 UTC (rev 231973)
@@ -1,3 +1,22 @@
+2018-05-16  Alberto Garcia  <[email protected]>
+
+        [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
+        https://bugs.webkit.org/show_bug.cgi?id=182622
+
+        Reviewed by Michael Catanzaro.
+
+        We were linking _javascript_Core against libatomic in MIPS because
+        in that architecture __atomic_fetch_add_8() is not a compiler
+        intrinsic and is provided by that library instead. However other
+        architectures (e.g armel) are in the same situation, so we need a
+        generic test.
+
+        That test already exists in WebKit/CMakeLists.txt, so we just have
+        to move it to a common file (WebKitCompilerFlags.cmake) and use
+        its result (ATOMIC_INT64_REQUIRES_LIBATOMIC) here.
+
+        * CMakeLists.txt:
+
 2018-05-10  Michael Catanzaro  <[email protected]>
 
         Unreviewed, silence a couple more build warnings on the stable branch

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/CMakeLists.txt (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/CMakeLists.txt	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/CMakeLists.txt	2018-05-18 18:42:40 UTC (rev 231973)
@@ -778,22 +778,8 @@
     set(_javascript_Core_SCRIPTS_DIR "${FORWARDING_HEADERS_DIR}/_javascript_Core/Scripts")
 endif ()
 
-if (COMPILER_IS_GCC_OR_CLANG)
-    set(ATOMIC_TEST_SOURCE
-    "
-        #include <atomic>
-        int main() { std::atomic<int64_t> i(0); i++; return 0; }
-    "
-    )
-    check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_IS_BUILTIN)
-    if (NOT ATOMIC_INT64_IS_BUILTIN)
-        set(CMAKE_REQUIRED_LIBRARIES atomic)
-        check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_REQUIRES_LIBATOMIC)
-        if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
-            list(APPEND WebKit_LIBRARIES atomic)
-        endif ()
-        unset(CMAKE_REQUIRED_LIBRARIES)
-    endif ()
+if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
+    list(APPEND WebKit_LIBRARIES PRIVATE atomic)
 endif ()
 
 if (UNIX)

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-05-18 18:42:40 UTC (rev 231973)
@@ -1,3 +1,16 @@
+2018-05-16  Alberto Garcia  <[email protected]>
+
+        [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
+        https://bugs.webkit.org/show_bug.cgi?id=182622
+
+        Reviewed by Michael Catanzaro.
+
+        Move the test to determine whether we need to link against
+        libatomic to the common file WebKitCompilerFlags.cmake so it can
+        also be used for _javascript_Core.
+
+        * CMakeLists.txt:
+
 2018-05-17  Carlos Alberto Lopez Perez  <[email protected]>
 
         [WPE] Implement and enable FULLSCREEN_API

Modified: releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsGTK.cmake (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsGTK.cmake	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsGTK.cmake	2018-05-18 18:42:40 UTC (rev 231973)
@@ -19,6 +19,8 @@
 set(INTROSPECTION_INSTALL_GIRDIR "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0")
 set(INTROSPECTION_INSTALL_TYPELIBDIR "${LIB_INSTALL_DIR}/girepository-1.0")
 
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+
 find_package(Cairo 1.10.2 REQUIRED)
 find_package(Fontconfig 2.8.0 REQUIRED)
 find_package(Freetype2 2.4.2 REQUIRED)

Modified: releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsJSCOnly.cmake (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsJSCOnly.cmake	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsJSCOnly.cmake	2018-05-18 18:42:40 UTC (rev 231973)
@@ -1,3 +1,4 @@
+set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
 
 if (MSVC)

Modified: releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsWPE.cmake (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsWPE.cmake	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/cmake/OptionsWPE.cmake	2018-05-18 18:42:40 UTC (rev 231973)
@@ -12,6 +12,8 @@
 set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Absolute path to executable installation directory")
 set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/wpe-webkit-${WPE_API_VERSION}" CACHE PATH "Absolute path to install executables executed by the library")
 
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+
 WEBKIT_OPTION_BEGIN()
 
 include(GStreamerDefinitions)

Modified: releases/WebKitGTK/webkit-2.20/Source/cmake/WebKitCompilerFlags.cmake (231972 => 231973)


--- releases/WebKitGTK/webkit-2.20/Source/cmake/WebKitCompilerFlags.cmake	2018-05-18 18:42:33 UTC (rev 231972)
+++ releases/WebKitGTK/webkit-2.20/Source/cmake/WebKitCompilerFlags.cmake	2018-05-18 18:42:40 UTC (rev 231973)
@@ -219,3 +219,16 @@
    DETERMINE_GCC_SYSTEM_INCLUDE_DIRS("c++" "${CMAKE_CXX_COMPILER}" "${CMAKE_CXX_FLAGS}" SYSTEM_INCLUDE_DIRS)
    set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${SYSTEM_INCLUDE_DIRS})
 endif ()
+
+if (COMPILER_IS_GCC_OR_CLANG)
+    set(ATOMIC_TEST_SOURCE "
+        #include <atomic>
+        int main() { std::atomic<int64_t> i(0); i++; return 0; }
+    ")
+    check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_IS_BUILTIN)
+    if (NOT ATOMIC_INT64_IS_BUILTIN)
+        set(CMAKE_REQUIRED_LIBRARIES atomic)
+        check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_REQUIRES_LIBATOMIC)
+        unset(CMAKE_REQUIRED_LIBRARIES)
+    endif ()
+endif ()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to