[packages/llvm] apply x32 abi stripping patch only when building with rt

atler atler at pld-linux.org
Mon Oct 17 00:01:21 CEST 2022


commit 91cd1ec737722ecb25f282aa8f85cf821bad1116
Author: Jan Palus <jpalus at fastmail.com>
Date:   Sun Oct 16 23:59:43 2022 +0200

    apply x32 abi stripping patch only when building with rt

 llvm.spec               |  2 ++
 x32-compiler-rt.patch   | 12 ++++++++++++
 x32-gcc-toolchain.patch | 12 ------------
 3 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/llvm.spec b/llvm.spec
index df98848..7f680b8 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -119,6 +119,7 @@ Patch8:		%{name}-selective_bindings.patch
 Patch9:		%{name}-libexecdir.patch
 Patch10:	compiler-rt-paths.patch
 Patch11:	cmake-utils-path-override.patch
+Patch12:	x32-compiler-rt.patch
 URL:		https://llvm.org/
 BuildRequires:	bash
 BuildRequires:	binutils-devel
@@ -708,6 +709,7 @@ Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem.
 %patch9 -p1
 %if %{with rt}
 %patch10 -p1
+%patch12 -p1
 %endif
 %patch11 -p1
 
diff --git a/x32-compiler-rt.patch b/x32-compiler-rt.patch
new file mode 100644
index 0000000..e8b85ff
--- /dev/null
+++ b/x32-compiler-rt.patch
@@ -0,0 +1,12 @@
+--- llvm-15.0.2.src/projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake.orig	2022-10-04 11:29:17.000000000 +0200
++++ llvm-15.0.2.src/projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake	2022-10-16 22:33:08.014906010 +0200
+@@ -478,7 +478,8 @@
+ 
+ function(get_compiler_rt_target arch variable)
+   string(FIND ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} "-" dash_index)
+-  string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix)
++  string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix_with_abi)
++  string(REPLACE "-gnux32" "" triple_suffix ${triple_suffix_with_abi})
+   if(COMPILER_RT_DEFAULT_TARGET_ONLY)
+     # Use exact spelling when building only for the target specified to CMake.
+     set(target "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
diff --git a/x32-gcc-toolchain.patch b/x32-gcc-toolchain.patch
index 4087f7a..b551b90 100644
--- a/x32-gcc-toolchain.patch
+++ b/x32-gcc-toolchain.patch
@@ -29,15 +29,3 @@
      }
      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
      BiarchTripleAliases.append(begin(X86Triples), end(X86Triples));
---- llvm-15.0.2.src/projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake.orig	2022-10-04 11:29:17.000000000 +0200
-+++ llvm-15.0.2.src/projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake	2022-10-16 22:33:08.014906010 +0200
-@@ -478,7 +478,8 @@
- 
- function(get_compiler_rt_target arch variable)
-   string(FIND ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} "-" dash_index)
--  string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix)
-+  string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix_with_abi)
-+  string(REPLACE "-gnux32" "" triple_suffix ${triple_suffix_with_abi})
-   if(COMPILER_RT_DEFAULT_TARGET_ONLY)
-     # Use exact spelling when building only for the target specified to CMake.
-     set(target "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/llvm.git/commitdiff/91cd1ec737722ecb25f282aa8f85cf821bad1116



More information about the pld-cvs-commit mailing list