WebKit Bugzilla
Attachment 340490 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 for the 2.20 branch
182622.diff (text/plain), 7.20 KB, created by
Alberto Garcia
on 2018-05-16 07:31:56 PDT
(
hide
)
Description:
Patch for the 2.20 branch
Filename:
MIME Type:
Creator:
Alberto Garcia
Created:
2018-05-16 07:31:56 PDT
Size:
7.20 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index d1f0d1472b1..5c964149242 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-16 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 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 JavaScriptCore >+ and WebKit. >+ > 2018-05-10 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed. Update OptionsWPE.cmake and NEWS for 2.19.93 release. >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index 94036df9213..1d5a8d2d934 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -116,14 +116,8 @@ set(JavaScriptCore_LIBRARIES > ${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 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 6b3e5c70629..c7fdc4b737d 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-16 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 Michael Catanzaro. >+ >+ 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-10 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, silence a couple more build warnings on the stable branch >diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt >index d98f3c4ba68..aaff8c77d1f 100644 >--- a/Source/WebKit/CMakeLists.txt >+++ b/Source/WebKit/CMakeLists.txt >@@ -778,22 +778,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 atomic) >- endif () >- unset(CMAKE_REQUIRED_LIBRARIES) >- endif () >+if (ATOMIC_INT64_REQUIRES_LIBATOMIC) >+ list(APPEND WebKit_LIBRARIES atomic) > endif () > > if (UNIX) >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8b4aed823c6..722860f3ec5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-16 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 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 JavaScriptCore. >+ >+ * CMakeLists.txt: >+ > 2018-05-10 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed. Update OptionsWPE.cmake and NEWS for 2.19.93 release. >diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake >index 7b27c71897b..3f033307e42 100644 >--- a/Source/cmake/OptionsGTK.cmake >+++ b/Source/cmake/OptionsGTK.cmake >@@ -19,6 +19,8 @@ set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/webkitgtk-${WEBKIT > 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) >diff --git a/Source/cmake/OptionsJSCOnly.cmake b/Source/cmake/OptionsJSCOnly.cmake >index 51caa4353d8..7b197a438ee 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 d08bdfcb4df..a9a078d91b6 100644 >--- a/Source/cmake/OptionsWPE.cmake >+++ b/Source/cmake/OptionsWPE.cmake >@@ -12,6 +12,8 @@ set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to > 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) >diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake >index cd17ddd7217..8de72ecc519 100644 >--- a/Source/cmake/WebKitCompilerFlags.cmake >+++ b/Source/cmake/WebKitCompilerFlags.cmake >@@ -219,3 +219,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