[packages/llvm] on platforms without all native atomic ops link libatomic together with libLLVM

atler atler at pld-linux.org
Mon Oct 17 17:50:38 CEST 2022


commit 5acac09f3708f662570349cac56f632480b476e8
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon Oct 17 17:48:01 2022 +0200

    on platforms without all native atomic ops link libatomic together with libLLVM
    
    see: https://github.com/llvm/llvm-project/issues/55880

 atomic.patch | 22 ++++++++++++++++++++++
 llvm.spec    |  2 ++
 2 files changed, 24 insertions(+)
---
diff --git a/llvm.spec b/llvm.spec
index 7f680b8..cf86ee3 100644
--- 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},
diff --git a/atomic.patch b/atomic.patch
new file mode 100644
index 0000000..8ddd38e
--- /dev/null
+++ b/atomic.patch
@@ -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)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/llvm.git/commitdiff/5acac09f3708f662570349cac56f632480b476e8



More information about the pld-cvs-commit mailing list