]> git.pld-linux.org Git - packages/llvm.git/commitdiff
on platforms without all native atomic ops link libatomic together with libLLVM auto/th/llvm-15.0.2-1
authorJan Palus <atler@pld-linux.org>
Mon, 17 Oct 2022 15:48:01 +0000 (17:48 +0200)
committerJan Palus <atler@pld-linux.org>
Mon, 17 Oct 2022 15:48:01 +0000 (17:48 +0200)
see: https://github.com/llvm/llvm-project/issues/55880

atomic.patch [new file with mode: 0644]
llvm.spec

diff --git a/atomic.patch b/atomic.patch
new file mode 100644 (file)
index 0000000..8ddd38e
--- /dev/null
@@ -0,0 +1,22 @@
+--- llvm-15.0.2.src/cmake/modules/AddLLVM.cmake.orig   2022-10-04 11:29:17.000000000 +0200
++++ llvm-15.0.2.src/cmake/modules/AddLLVM.cmake        2022-10-16 23:47:37.416529186 +0200
+@@ -657,6 +657,9 @@
+   elseif (NOT ARG_COMPONENT_LIB)
+     if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
+       set(llvm_libs LLVM)
++      if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)  
++        list(APPEND llvm_libs "atomic")
++      endif()
+     else()
+       llvm_map_components_to_libnames(llvm_libs
+        ${ARG_LINK_COMPONENTS}
+@@ -993,6 +996,9 @@
+     # API for all shared libaries loaded by this executable.
+     target_link_libraries(${name} PRIVATE ${LLVM_PTHREAD_LIB})
+   endif()
++  if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)  
++    target_link_libraries(${name} PRIVATE "atomic")
++  endif()
+   llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS} BUNDLE_PATH ${ARG_BUNDLE_PATH})
+ endmacro(add_llvm_executable name)
index 7f680b82588ec72ac1ef87b23612013dfeae99d7..cf86ee3a513fcd414f57ad72888ecdae5011b3a0 100644 (file)
--- a/llvm.spec
+++ b/llvm.spec
@@ -120,6 +120,7 @@ Patch9:             %{name}-libexecdir.patch
 Patch10:       compiler-rt-paths.patch
 Patch11:       cmake-utils-path-override.patch
 Patch12:       x32-compiler-rt.patch
+Patch13:       atomic.patch
 URL:           https://llvm.org/
 BuildRequires: bash
 BuildRequires: binutils-devel
@@ -712,6 +713,7 @@ Integracja narzÄ™dzi Clang do formatowania i zmiany nazw z Vimem.
 %patch12 -p1
 %endif
 %patch11 -p1
+%patch13 -p1
 
 grep -rl /usr/bin/env projects tools utils | xargs sed -i -e '1{
        s,^#!.*bin/env python3\?,#!%{__python3},
This page took 0.446258 seconds and 4 git commands to generate.