Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 798979 Details for
Bug 864421
media-tv/kodi-19.4-r2: undefined reference to `__atomic_exchange_1
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
kodi-atomic.patch
kodi-atomic.patch (text/plain), 2.35 KB, created by
Yixun Lan
on 2022-08-09 08:34:38 UTC
(
hide
)
Description:
kodi-atomic.patch
Filename:
MIME Type:
Creator:
Yixun Lan
Created:
2022-08-09 08:34:38 UTC
Size:
2.35 KB
patch
obsolete
>diff --git a/CMakeLists.txt b/CMakeLists.txt >index e1e1147..55d746a 100644 >--- a/CMakeLists.txt >+++ b/CMakeLists.txt >@@ -112,6 +112,9 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) > find_package(Threads REQUIRED QUIET) > list(APPEND DEPLIBS ${CMAKE_THREAD_LIBS_INIT}) > >+# Atomics >+find_package(Atomics REQUIRED) >+list(APPEND DEPLIBS ${ATOMICS_LIBRARIES}) > > foreach(depspec ${PLATFORM_REQUIRED_DEPS}) > # We need to specify ENABLE_${PLATFORM_REQUIRED_DEPS} in order for the >diff --git a/cmake/modules/FindAtomics.cmake b/cmake/modules/FindAtomics.cmake >new file mode 100644 >index 0000000..9a6cdc3 >--- /dev/null >+++ b/cmake/modules/FindAtomics.cmake >@@ -0,0 +1,53 @@ >+# Original issue: >+# * https://gitlab.kitware.com/cmake/cmake/-/issues/23021#note_1098733 >+# >+# For reference: >+# * https://gcc.gnu.org/wiki/Atomic/GCCMM >+# >+# riscv64 specific: >+# * https://lists.debian.org/debian-riscv/2022/01/msg00009.html >+# >+# ATOMICS_FOUND - system has c++ atomics >+# ATOMICS_LIBRARIES - libraries needed to use c++ atomics >+ >+include(CheckCXXSourceCompiles) >+ >+# RISC-V only has 32-bit and 64-bit atomic instructions. GCC is supposed >+# to convert smaller atomics to those larger ones via masking and >+# shifting like LLVM, but itâs a known bug that it does not. This means >+# anything that wants to use atomics on 1-byte or 2-byte types needs >+# -latomic, but not 4-byte or 8-byte (though it does no harm). >+set(atomic_code >+ " >+ #include <atomic> >+ #include <cstdint> >+ std::atomic<uint8_t> n8 (0); // riscv64 >+ std::atomic<uint64_t> n64 (0); // armel, mipsel, powerpc >+ int main() { >+ ++n8; >+ ++n64; >+ return 0; >+ }") >+ >+check_cxx_source_compiles("${atomic_code}" ATOMICS_LOCK_FREE_INSTRUCTIONS) >+ >+if(ATOMICS_LOCK_FREE_INSTRUCTIONS) >+ set(ATOMICS_FOUND TRUE) >+ set(ATOMICS_LIBRARIES) >+else() >+ set(CMAKE_REQUIRED_LIBRARIES "-latomic") >+ check_cxx_source_compiles("${atomic_code}" ATOMICS_IN_LIBRARY) >+ set(CMAKE_REQUIRED_LIBRARIES) >+ if(ATOMICS_IN_LIBRARY) >+ set(ATOMICS_LIBRARY atomic) >+ include(FindPackageHandleStandardArgs) >+ find_package_handle_standard_args(Atomics DEFAULT_MSG ATOMICS_LIBRARY) >+ set(ATOMICS_LIBRARIES ${ATOMICS_LIBRARY}) >+ unset(ATOMICS_LIBRARY) >+ else() >+ if(Atomics_FIND_REQUIRED) >+ message(FATAL_ERROR "Neither lock free instructions nor -latomic found.") >+ endif() >+ endif() >+endif() >+unset(atomic_code)
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
|
Diff
Attachments on
bug 864421
:
798877
|
798880
| 798979