Skip to content
Permalink
Browse files
[CMake] Build fails on RISC-V with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=222959

Patch by Khem Raj <raj.khem@gmail.com> on 2021-03-16
Reviewed by Carlos Alberto Lopez Perez.

.:

Check for 1 byte atomic operations along with 64bit ones, some
architevtures (e.g. RISCV) operations on less than 4 bytes are not lock-free

* Source/cmake/WebKitCompilerFlags.cmake:

Source/JavaScriptCore:

Use renamed variable ATOMICS_REQUIRE_LIBATOMIC instead of ATOMIC_INT64_REQUIRES_LIBATOMIC

* CMakeLists.txt:

Source/WebKit:

Use renamed ATOMICS_REQUIRE_LIBATOMIC instead of ATOMIC_INT64_REQUIRES_LIBATOMIC.

* CMakeLists.txt:

Source/WTF:

Link with libatomic if ATOMICS_REQUIRE_LIBATOMIC is set.

* wtf/CMakeLists.txt:

Canonical link: https://commits.webkit.org/235332@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kraj authored and webkit-commit-queue committed Mar 16, 2021
1 parent 5e44cd0 commit e11ec777c7d8a8471a54e5374d6eb98984659fae
Showing 8 changed files with 62 additions and 6 deletions.
@@ -1,3 +1,15 @@
2021-03-16 Khem Raj <raj.khem@gmail.com>

[CMake] Build fails on RISC-V with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=222959

Reviewed by Carlos Alberto Lopez Perez.

Check for 1 byte atomic operations along with 64bit ones, some
architevtures (e.g. RISCV) operations on less than 4 bytes are not lock-free

* Source/cmake/WebKitCompilerFlags.cmake:

2021-03-14 Lauro Moura <lmoura@igalia.com>

[GLIB] Keep GPUProcess disabled when using experimental features
@@ -139,7 +139,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 ()

@@ -1,3 +1,14 @@
2021-03-16 Khem Raj <raj.khem@gmail.com>

[CMake] Build fails on RISC-V with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=222959

Reviewed by Carlos Alberto Lopez Perez.

Use renamed variable ATOMICS_REQUIRE_LIBATOMIC instead of ATOMIC_INT64_REQUIRES_LIBATOMIC

* CMakeLists.txt:

2021-03-15 Angelos Oikonomopoulos <angelos@igalia.com>

postprocess-asm/resolve-asm-file-conflicts.rb build failure after upgrading to F34
@@ -1,3 +1,14 @@
2021-03-16 Khem Raj <raj.khem@gmail.com>

[CMake] Build fails on RISC-V with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=222959

Reviewed by Carlos Alberto Lopez Perez.

Link with libatomic if ATOMICS_REQUIRE_LIBATOMIC is set.

* wtf/CMakeLists.txt:

2021-03-15 Alex Christensen <achristensen@webkit.org>

REGRESSION: (r255611) [ Mac ] 3 lldb tests failing related to HashMap
@@ -531,6 +531,10 @@ if (NOT USE_SYSTEM_MALLOC)
set(WTF_FRAMEWORKS bmalloc)
endif ()

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)
@@ -346,7 +346,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 ()

@@ -1,3 +1,14 @@
2021-03-16 Khem Raj <raj.khem@gmail.com>

[CMake] Build fails on RISC-V with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=222959

Reviewed by Carlos Alberto Lopez Perez.

Use renamed ATOMICS_REQUIRE_LIBATOMIC instead of ATOMIC_INT64_REQUIRES_LIBATOMIC.

* CMakeLists.txt:

2021-03-16 Lauro Moura <lmoura@igalia.com>

[SOUP] Fix SOUP3 debug build
@@ -274,12 +274,19 @@ 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<bool> y (false);
std::atomic<uint64_t> x (0);
bool expected = true;
bool j = y.compare_exchange_weak(expected,false);
x++;
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 ()

0 comments on commit e11ec77

Please sign in to comment.