WebKit Bugzilla
Attachment 340473 Details for
Bug 182622
: [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
182622.patch (text/plain), 7.34 KB, created by
Alberto Garcia
on 2018-05-16 00:41:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alberto Garcia
Created:
2018-05-16 00:41:53 PDT
Size:
7.34 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index 3067fc2bebd..bea67333d01 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-15 Alberto Garcia <berto@igalia.com> >+ >+ [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 NOBODY (OOPS!). >+ >+ * 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 JavaScriptCore >+ and WebKit. >+ > 2018-05-14 Zan Dobersek <zdobersek@igalia.com> > > [GTK] REGRESSION(r231170) Build broken with Clang 5.0 >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index dd9a6f8c86e..5e56d50dd09 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -124,14 +124,8 @@ if (USE_CAPSTONE) > list(APPEND JavaScriptCore_LIBRARIES capstone) > endif () > >-# 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 JavaScriptCore_LIBRARIES >- -latomic >- ) >+if (ATOMIC_INT64_REQUIRES_LIBATOMIC) >+ list(APPEND JavaScriptCore_LIBRARIES atomic) > endif () > > set(JavaScriptCore_SCRIPTS_SOURCES_DIR "${JAVASCRIPTCORE_DIR}/Scripts") >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 2c26de374c6..4b420ebec96 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-15 Alberto Garcia <berto@igalia.com> >+ >+ [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 NOBODY (OOPS!). >+ >+ We were linking JavaScriptCore 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-15 Devin Rousso <webkit@devinrousso.com> > > Web Inspector: Add rulers and guides >diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt >index f1d03e4736b..bd9de34ed2b 100644 >--- a/Source/WebKit/CMakeLists.txt >+++ b/Source/WebKit/CMakeLists.txt >@@ -810,22 +810,8 @@ else () > set(JavaScriptCore_SCRIPTS_DIR "${FORWARDING_HEADERS_DIR}/JavaScriptCore/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 PRIVATE atomic) >- endif () >- unset(CMAKE_REQUIRED_LIBRARIES) >- endif () >+if (ATOMIC_INT64_REQUIRES_LIBATOMIC) >+ list(APPEND WebKit_LIBRARIES PRIVATE atomic) > endif () > > if (UNIX) >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d4f4e18125b..f0e1b9b9f97 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-15 Alberto Garcia <berto@igalia.com> >+ >+ [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 NOBODY (OOPS!). >+ >+ 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 JavaScriptCore. >+ >+ * CMakeLists.txt: >+ > 2018-05-15 Sihui Liu <sihui_liu@apple.com> > > StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close >diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake >index 7d31a78d774..5243b4956e2 100644 >--- a/Source/cmake/OptionsGTK.cmake >+++ b/Source/cmake/OptionsGTK.cmake >@@ -16,6 +16,7 @@ set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/webkit2gtk-${WEBKITGTK > set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/webkitgtk-${WEBKITGTK_API_VERSION}") > 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) >diff --git a/Source/cmake/OptionsJSCOnly.cmake b/Source/cmake/OptionsJSCOnly.cmake >index 37f683e3e00..3c5f78b8acd 100644 >--- a/Source/cmake/OptionsJSCOnly.cmake >+++ b/Source/cmake/OptionsJSCOnly.cmake >@@ -1,3 +1,4 @@ >+set(THREADS_PREFER_PTHREAD_FLAG ON) > find_package(Threads REQUIRED) > > if (MSVC) >diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake >index b42183c3398..22a3827ea96 100644 >--- a/Source/cmake/OptionsWPE.cmake >+++ b/Source/cmake/OptionsWPE.cmake >@@ -11,6 +11,7 @@ CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 2 0 0) > set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to library installation directory") > 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() > >diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake >index 12b7bc8ef45..5512aa7dfe0 100644 >--- a/Source/cmake/WebKitCompilerFlags.cmake >+++ b/Source/cmake/WebKitCompilerFlags.cmake >@@ -230,3 +230,16 @@ if (COMPILER_IS_GCC_OR_CLANG) > 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 ()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182622
:
340248
|
340404
|
340430
| 340473 |
340490
|
340984