WebKit Bugzilla
Attachment 340984 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 without THREADS_PREFER_PTHREAD_FLAG
182622.diff (text/plain), 5.40 KB, created by
Alberto Garcia
on 2018-05-22 08:43:35 PDT
(
hide
)
Description:
Patch without THREADS_PREFER_PTHREAD_FLAG
Filename:
MIME Type:
Creator:
Alberto Garcia
Created:
2018-05-22 08:43:35 PDT
Size:
5.40 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index 665712e11c8..921fc973cbf 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-22 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 >+ <rdar://problem/40292317> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, rolling out r231843. >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 b10e5659f38..22f895a801e 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-05-22 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 >+ <rdar://problem/40292317> >+ >+ 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-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, rolling out r231843. >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 0d1c94da56c..c78202d7c27 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-22 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 >+ <rdar://problem/40292317> >+ >+ 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-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, rolling out r231843. >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
Flags:
mcatanzaro
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182622
:
340248
|
340404
|
340430
|
340473
|
340490
| 340984