forked from pool/llvm14
Accepting request 966700 from home:aaronpuchert:llvm-next
- Update to version 14.0.0. * For details, see the release notes: - https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html - https://releases.llvm.org/14.0.0/tools/clang/docs/ReleaseNotes.html - https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html - https://releases.llvm.org/14.0.0/projects/libcxx/docs/ReleaseNotes.html - https://releases.llvm.org/14.0.0/tools/lld/docs/ReleaseNotes.html * New LLVM tools: - llvm-debuginfod-find: Tool to fetch debuginfod artifacts. - llvm-tli-checker: LLVM TargetLibraryInfo versus SDK checker. * New Clang tools: - clang-linker-wrapper: A wrapper utility over the host linker. - clang-nvlink-wrapper: A wrapper tool over nvlink program. - Add clang-repl-private-deps.patch to make link dependencies of clang-repl private, otherwise CMake can't install. - Add PPCISelLowering-Avoid-emitting-calls-to-__multi3.patch to fix build on PowerPC (32-bit). - Drop llvm-exegesis-link-dylib.patch, instead we don't build llvm-exegesis anymore and add check-no-llvm-exegesis.patch to disable the corresponding tests. - Rebase patches: * lldb-cmake.patch * llvm-do-not-install-static-libraries.patch * lvm-normally-versioned-libllvm.patch - Drop patches that have landed upstream: * llvm-update-extract-section-script.patch OBS-URL: https://build.opensuse.org/request/show/966700 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=1
This commit is contained in:
commit
a5973cd8b1
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.osc
|
132
CMake-Look-up-target-subcomponents-in-LLVM_AVAILABLE_LIBS.patch
Normal file
132
CMake-Look-up-target-subcomponents-in-LLVM_AVAILABLE_LIBS.patch
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
From b49307ef82196729e1ab2508b73fc7fc80192668 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
|
||||||
|
Date: Sun, 14 Feb 2021 22:54:07 +0100
|
||||||
|
Subject: [PATCH] [CMake] Look up target subcomponents in LLVM_AVAILABLE_LIBS
|
||||||
|
|
||||||
|
In an installation using the all-contained libLLVM.so, individual
|
||||||
|
components are not available as targets, so we have to look them up in
|
||||||
|
LLVM_AVAILABLE_LIBS just like llvm_map_components_to_libnames does it.
|
||||||
|
Here I don't think we need the capitalized names though because we know
|
||||||
|
the right capitalization. But I might be wrong.
|
||||||
|
|
||||||
|
This is required by dragonffi, who call llvm_map_components_to_libnames
|
||||||
|
on a list containing ${LLVM_NATIVE_ARCH}. Downstream bug report:
|
||||||
|
https://bugzilla.opensuse.org/show_bug.cgi?id=1180748.
|
||||||
|
|
||||||
|
Differential Revision: https://reviews.llvm.org/D96670
|
||||||
|
---
|
||||||
|
llvm/cmake/modules/LLVM-Config.cmake | 61 +++++++++++++---------------
|
||||||
|
1 file changed, 28 insertions(+), 33 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake
|
||||||
|
index 5d9ec79c7c56..1cd10993b903 100644
|
||||||
|
--- a/llvm/cmake/modules/LLVM-Config.cmake
|
||||||
|
+++ b/llvm/cmake/modules/LLVM-Config.cmake
|
||||||
|
@@ -125,47 +125,38 @@ endfunction(llvm_map_components_to_libraries)
|
||||||
|
# available and not a list of the components.
|
||||||
|
function(llvm_expand_pseudo_components out_components)
|
||||||
|
set( link_components ${ARGN} )
|
||||||
|
+ if(NOT LLVM_AVAILABLE_LIBS)
|
||||||
|
+ # Inside LLVM itself available libs are in a global property.
|
||||||
|
+ get_property(LLVM_AVAILABLE_LIBS GLOBAL PROPERTY LLVM_LIBS)
|
||||||
|
+ endif()
|
||||||
|
foreach(c ${link_components})
|
||||||
|
# add codegen, asmprinter, asmparser, disassembler
|
||||||
|
list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
|
||||||
|
if( NOT idx LESS 0 )
|
||||||
|
- if( TARGET LLVM${c}CodeGen )
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${c}CodeGen lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
list(APPEND expanded_components "${c}CodeGen")
|
||||||
|
else()
|
||||||
|
- if( TARGET LLVM${c} )
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${c} lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
list(APPEND expanded_components "${c}")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Target ${c} is not in the set of libraries.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
- if( TARGET LLVM${c}AsmPrinter )
|
||||||
|
- list(APPEND expanded_components "${c}AsmPrinter")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${c}AsmParser )
|
||||||
|
- list(APPEND expanded_components "${c}AsmParser")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${c}Desc )
|
||||||
|
- list(APPEND expanded_components "${c}Desc")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${c}Disassembler )
|
||||||
|
- list(APPEND expanded_components "${c}Disassembler")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${c}Info )
|
||||||
|
- list(APPEND expanded_components "${c}Info")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${c}Utils )
|
||||||
|
- list(APPEND expanded_components "${c}Utils")
|
||||||
|
- endif()
|
||||||
|
+ foreach(subcomponent IN ITEMS AsmPrinter AsmParser Desc Disassembler Info Utils)
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${c}${subcomponent} lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
+ list(APPEND expanded_components "${c}${subcomponent}")
|
||||||
|
+ endif()
|
||||||
|
+ endforeach()
|
||||||
|
elseif( c STREQUAL "nativecodegen" )
|
||||||
|
- if( TARGET LLVM${LLVM_NATIVE_ARCH}CodeGen )
|
||||||
|
- list(APPEND expanded_components "${LLVM_NATIVE_ARCH}CodeGen")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${LLVM_NATIVE_ARCH}Desc )
|
||||||
|
- list(APPEND expanded_components "${LLVM_NATIVE_ARCH}Desc")
|
||||||
|
- endif()
|
||||||
|
- if( TARGET LLVM${LLVM_NATIVE_ARCH}Info )
|
||||||
|
- list(APPEND expanded_components "${LLVM_NATIVE_ARCH}Info")
|
||||||
|
- endif()
|
||||||
|
+ foreach(subcomponent IN ITEMS CodeGen Desc Info)
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${LLVM_NATIVE_ARCH}${subcomponent} lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
+ list(APPEND expanded_components "${LLVM_NATIVE_ARCH}${subcomponent}")
|
||||||
|
+ endif()
|
||||||
|
+ endforeach()
|
||||||
|
elseif( c STREQUAL "AllTargetsCodeGens" )
|
||||||
|
# Link all the codegens from all the targets
|
||||||
|
foreach(t ${LLVM_TARGETS_TO_BUILD})
|
||||||
|
@@ -176,28 +167,32 @@ function(llvm_expand_pseudo_components out_components)
|
||||||
|
elseif( c STREQUAL "AllTargetsAsmParsers" )
|
||||||
|
# Link all the asm parsers from all the targets
|
||||||
|
foreach(t ${LLVM_TARGETS_TO_BUILD})
|
||||||
|
- if( TARGET LLVM${t}AsmParser )
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${t}AsmParser lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
list(APPEND expanded_components "${t}AsmParser")
|
||||||
|
endif()
|
||||||
|
endforeach(t)
|
||||||
|
elseif( c STREQUAL "AllTargetsDescs" )
|
||||||
|
# Link all the descs from all the targets
|
||||||
|
foreach(t ${LLVM_TARGETS_TO_BUILD})
|
||||||
|
- if( TARGET LLVM${t}Desc )
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${t}Desc lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
list(APPEND expanded_components "${t}Desc")
|
||||||
|
endif()
|
||||||
|
endforeach(t)
|
||||||
|
elseif( c STREQUAL "AllTargetsDisassemblers" )
|
||||||
|
# Link all the disassemblers from all the targets
|
||||||
|
foreach(t ${LLVM_TARGETS_TO_BUILD})
|
||||||
|
- if( TARGET LLVM${t}Disassembler )
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${t}Disassembler lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
list(APPEND expanded_components "${t}Disassembler")
|
||||||
|
endif()
|
||||||
|
endforeach(t)
|
||||||
|
elseif( c STREQUAL "AllTargetsInfos" )
|
||||||
|
# Link all the infos from all the targets
|
||||||
|
foreach(t ${LLVM_TARGETS_TO_BUILD})
|
||||||
|
- if( TARGET LLVM${t}Info )
|
||||||
|
+ list(FIND LLVM_AVAILABLE_LIBS LLVM${t}Info lib_idx)
|
||||||
|
+ if( lib_idx GREATER_EQUAL 0 )
|
||||||
|
list(APPEND expanded_components "${t}Info")
|
||||||
|
endif()
|
||||||
|
endforeach(t)
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
350
PPCISelLowering-Avoid-emitting-calls-to-__multi3.patch
Normal file
350
PPCISelLowering-Avoid-emitting-calls-to-__multi3.patch
Normal file
@ -0,0 +1,350 @@
|
|||||||
|
From eb632027f696aa0f548e17624979054ccf5f3b36 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
|
||||||
|
Date: Sun, 20 Mar 2022 20:59:06 +0100
|
||||||
|
Subject: [PATCH] [PPCISelLowering] Avoid emitting calls to __multi3, __muloti4
|
||||||
|
|
||||||
|
After D108936, @llvm.smul.with.overflow.i64 was lowered to __multi3
|
||||||
|
instead of __mulodi4, which also doesn't exist on PowerPC 32-bit, not
|
||||||
|
even with compiler-rt. Block it as well so that we get inline code.
|
||||||
|
|
||||||
|
Because libgcc doesn't have __muloti4, we block that as well.
|
||||||
|
|
||||||
|
Fixes #54460.
|
||||||
|
|
||||||
|
Reviewed By: craig.topper
|
||||||
|
|
||||||
|
Differential Revision: https://reviews.llvm.org/D122090
|
||||||
|
---
|
||||||
|
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 2 +
|
||||||
|
.../overflow-intrinsic-optimizations.ll | 12 ++
|
||||||
|
.../umulo-128-legalisation-lowering.ll | 169 +++++++++---------
|
||||||
|
.../PowerPC/urem-seteq-illegal-types.ll | 61 ++++---
|
||||||
|
4 files changed, 127 insertions(+), 117 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
|
||||||
|
index cbeae0ab03b8..6c9d43ad8c03 100644
|
||||||
|
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
|
||||||
|
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
|
||||||
|
@@ -1305,11 +1305,13 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
|
||||||
|
setBooleanVectorContents(ZeroOrNegativeOneBooleanContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ setLibcallName(RTLIB::MULO_I128, nullptr);
|
||||||
|
if (!isPPC64) {
|
||||||
|
// These libcalls are not available in 32-bit.
|
||||||
|
setLibcallName(RTLIB::SHL_I128, nullptr);
|
||||||
|
setLibcallName(RTLIB::SRL_I128, nullptr);
|
||||||
|
setLibcallName(RTLIB::SRA_I128, nullptr);
|
||||||
|
+ setLibcallName(RTLIB::MUL_I128, nullptr);
|
||||||
|
setLibcallName(RTLIB::MULO_I64, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/llvm/test/CodeGen/PowerPC/overflow-intrinsic-optimizations.ll b/llvm/test/CodeGen/PowerPC/overflow-intrinsic-optimizations.ll
|
||||||
|
index 83e9d8ee627e..353dac3d2c95 100644
|
||||||
|
--- a/llvm/test/CodeGen/PowerPC/overflow-intrinsic-optimizations.ll
|
||||||
|
+++ b/llvm/test/CodeGen/PowerPC/overflow-intrinsic-optimizations.ll
|
||||||
|
@@ -1,8 +1,10 @@
|
||||||
|
; RUN: llc %s -mtriple=powerpc -o - | FileCheck %s
|
||||||
|
+; RUN: llc %s -mtriple=powerpc64 -o - | FileCheck %s
|
||||||
|
|
||||||
|
define i1 @no__mulodi4(i32 %a, i64 %b, i32* %c) {
|
||||||
|
; CHECK-LABEL: no__mulodi4
|
||||||
|
; CHECK-NOT: bl __mulodi4
|
||||||
|
+; CHECK-NOT: bl __multi3
|
||||||
|
entry:
|
||||||
|
%0 = sext i32 %a to i64
|
||||||
|
%1 = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 %0, i64 %b)
|
||||||
|
@@ -16,4 +18,14 @@ entry:
|
||||||
|
ret i1 %7
|
||||||
|
}
|
||||||
|
|
||||||
|
+define i1 @no__muloti4(i128 %a, i128 %b) {
|
||||||
|
+; CHECK-LABEL: no__muloti4
|
||||||
|
+; CHECK-NOT: bl __muloti4
|
||||||
|
+entry:
|
||||||
|
+ %0 = call { i128, i1 } @llvm.smul.with.overflow.i128(i128 %a, i128 %b)
|
||||||
|
+ %1 = extractvalue { i128, i1 } %0, 1
|
||||||
|
+ ret i1 %1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
declare { i64, i1 } @llvm.smul.with.overflow.i64(i64, i64)
|
||||||
|
+declare { i128, i1 } @llvm.smul.with.overflow.i128(i128, i128)
|
||||||
|
diff --git a/llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll b/llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll
|
||||||
|
index 335946cb24de..778edba2719a 100644
|
||||||
|
--- a/llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll
|
||||||
|
+++ b/llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll
|
||||||
|
@@ -32,110 +32,103 @@ define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
|
||||||
|
;
|
||||||
|
; PPC32-LABEL: muloti_test:
|
||||||
|
; PPC32: # %bb.0: # %start
|
||||||
|
-; PPC32-NEXT: mflr 0
|
||||||
|
-; PPC32-NEXT: stw 0, 4(1)
|
||||||
|
; PPC32-NEXT: stwu 1, -64(1)
|
||||||
|
-; PPC32-NEXT: stw 24, 32(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mfcr 12
|
||||||
|
; PPC32-NEXT: stw 26, 40(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 26, 7
|
||||||
|
-; PPC32-NEXT: stw 28, 48(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 28, 4
|
||||||
|
-; PPC32-NEXT: stw 29, 52(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 29, 8
|
||||||
|
-; PPC32-NEXT: mr 24, 3
|
||||||
|
-; PPC32-NEXT: li 3, 0
|
||||||
|
-; PPC32-NEXT: li 4, 0
|
||||||
|
-; PPC32-NEXT: li 7, 0
|
||||||
|
-; PPC32-NEXT: li 8, 0
|
||||||
|
+; PPC32-NEXT: mulhwu. 26, 7, 6
|
||||||
|
+; PPC32-NEXT: mcrf 1, 0
|
||||||
|
+; PPC32-NEXT: mfcr 12
|
||||||
|
+; PPC32-NEXT: cmpwi 7, 5, 0
|
||||||
|
+; PPC32-NEXT: cmpwi 2, 7, 0
|
||||||
|
+; PPC32-NEXT: stw 22, 24(1) # 4-byte Folded Spill
|
||||||
|
+; PPC32-NEXT: mulhwu. 26, 5, 8
|
||||||
|
+; PPC32-NEXT: mcrf 5, 0
|
||||||
|
; PPC32-NEXT: stw 23, 28(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 23, 5
|
||||||
|
+; PPC32-NEXT: crnor 28, 30, 10
|
||||||
|
+; PPC32-NEXT: stw 29, 52(1) # 4-byte Folded Spill
|
||||||
|
+; PPC32-NEXT: cmpwi 2, 9, 0
|
||||||
|
+; PPC32-NEXT: mulhwu. 26, 3, 10
|
||||||
|
+; PPC32-NEXT: mcrf 6, 0
|
||||||
|
+; PPC32-NEXT: cmpwi 3, 3, 0
|
||||||
|
+; PPC32-NEXT: stw 24, 32(1) # 4-byte Folded Spill
|
||||||
|
+; PPC32-NEXT: crnor 29, 10, 14
|
||||||
|
; PPC32-NEXT: stw 25, 36(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 25, 9
|
||||||
|
+; PPC32-NEXT: mulhwu. 26, 9, 4
|
||||||
|
; PPC32-NEXT: stw 27, 44(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 27, 6
|
||||||
|
+; PPC32-NEXT: crorc 28, 28, 6
|
||||||
|
+; PPC32-NEXT: stw 28, 48(1) # 4-byte Folded Spill
|
||||||
|
+; PPC32-NEXT: crorc 20, 28, 22
|
||||||
|
; PPC32-NEXT: stw 30, 56(1) # 4-byte Folded Spill
|
||||||
|
-; PPC32-NEXT: mr 30, 10
|
||||||
|
-; PPC32-NEXT: stw 12, 24(1)
|
||||||
|
-; PPC32-NEXT: bl __multi3
|
||||||
|
-; PPC32-NEXT: mulhwu. 9, 26, 27
|
||||||
|
-; PPC32-NEXT: mfcr 9 # cr0
|
||||||
|
-; PPC32-NEXT: cmpwi 2, 26, 0
|
||||||
|
-; PPC32-NEXT: stw 9, 20(1)
|
||||||
|
-; PPC32-NEXT: cmpwi 3, 23, 0
|
||||||
|
-; PPC32-NEXT: crnor 12, 14, 10
|
||||||
|
-; PPC32-NEXT: cmpwi 4, 24, 0
|
||||||
|
-; PPC32-NEXT: mulhwu. 9, 23, 29
|
||||||
|
-; PPC32-NEXT: mcrf 5, 0
|
||||||
|
-; PPC32-NEXT: cmpwi 1, 25, 0
|
||||||
|
-; PPC32-NEXT: crnor 4, 6, 18
|
||||||
|
-; PPC32-NEXT: mulhwu. 9, 24, 30
|
||||||
|
-; PPC32-NEXT: mcrf 6, 0
|
||||||
|
-; PPC32-NEXT: mulhwu. 0, 25, 28
|
||||||
|
-; PPC32-NEXT: mcrf 7, 0
|
||||||
|
-; PPC32-NEXT: or. 0, 28, 24
|
||||||
|
-; PPC32-NEXT: mcrf 2, 0
|
||||||
|
-; PPC32-NEXT: or. 0, 29, 26
|
||||||
|
-; PPC32-NEXT: crnor 5, 2, 10
|
||||||
|
-; PPC32-NEXT: mullw 10, 26, 27
|
||||||
|
-; PPC32-NEXT: lwz 26, 20(1)
|
||||||
|
-; PPC32-NEXT: mullw 9, 23, 29
|
||||||
|
-; PPC32-NEXT: add 9, 10, 9
|
||||||
|
-; PPC32-NEXT: mtcrf 128, 26 # cr0
|
||||||
|
-; PPC32-NEXT: crorc 6, 12, 2
|
||||||
|
-; PPC32-NEXT: crorc 20, 6, 22
|
||||||
|
-; PPC32-NEXT: mulhwu 7, 29, 27
|
||||||
|
-; PPC32-NEXT: add 9, 7, 9
|
||||||
|
-; PPC32-NEXT: cmplw 9, 7
|
||||||
|
-; PPC32-NEXT: crorc 21, 4, 26
|
||||||
|
-; PPC32-NEXT: cror 20, 20, 0
|
||||||
|
-; PPC32-NEXT: crorc 21, 21, 30
|
||||||
|
-; PPC32-NEXT: mullw 11, 25, 28
|
||||||
|
-; PPC32-NEXT: mullw 12, 24, 30
|
||||||
|
-; PPC32-NEXT: add 10, 12, 11
|
||||||
|
-; PPC32-NEXT: lwz 12, 24(1)
|
||||||
|
-; PPC32-NEXT: lwz 26, 40(1) # 4-byte Folded Reload
|
||||||
|
-; PPC32-NEXT: mulhwu 8, 28, 30
|
||||||
|
-; PPC32-NEXT: add 10, 8, 10
|
||||||
|
-; PPC32-NEXT: cmplw 10, 8
|
||||||
|
-; PPC32-NEXT: cror 21, 21, 0
|
||||||
|
-; PPC32-NEXT: cror 21, 5, 21
|
||||||
|
+; PPC32-NEXT: mulhwu 0, 6, 10
|
||||||
|
+; PPC32-NEXT: stw 12, 20(1)
|
||||||
|
+; PPC32-NEXT: crorc 21, 29, 26
|
||||||
|
+; PPC32-NEXT: crorc 21, 21, 2
|
||||||
|
+; PPC32-NEXT: li 11, 0
|
||||||
|
+; PPC32-NEXT: mullw 26, 5, 10
|
||||||
|
+; PPC32-NEXT: addc 0, 26, 0
|
||||||
|
+; PPC32-NEXT: mulhwu 29, 5, 10
|
||||||
|
+; PPC32-NEXT: addze 29, 29
|
||||||
|
+; PPC32-NEXT: mullw 23, 5, 8
|
||||||
|
+; PPC32-NEXT: mullw 22, 7, 6
|
||||||
|
+; PPC32-NEXT: mulhwu 30, 6, 9
|
||||||
|
+; PPC32-NEXT: mulhwu 12, 5, 9
|
||||||
|
+; PPC32-NEXT: mulhwu 28, 8, 6
|
||||||
|
+; PPC32-NEXT: mullw 25, 6, 9
|
||||||
|
+; PPC32-NEXT: mullw 24, 5, 9
|
||||||
|
+; PPC32-NEXT: mullw 5, 9, 4
|
||||||
|
+; PPC32-NEXT: add 9, 22, 23
|
||||||
|
+; PPC32-NEXT: add 9, 28, 9
|
||||||
|
+; PPC32-NEXT: cmplw 1, 9, 28
|
||||||
|
+; PPC32-NEXT: cror 20, 20, 4
|
||||||
|
+; PPC32-NEXT: mullw 23, 3, 10
|
||||||
|
+; PPC32-NEXT: add 26, 23, 5
|
||||||
|
+; PPC32-NEXT: addc 5, 25, 0
|
||||||
|
+; PPC32-NEXT: addze 30, 30
|
||||||
|
+; PPC32-NEXT: or. 3, 4, 3
|
||||||
|
+; PPC32-NEXT: mulhwu 27, 4, 10
|
||||||
|
+; PPC32-NEXT: mcrf 1, 0
|
||||||
|
+; PPC32-NEXT: addc 3, 29, 30
|
||||||
|
+; PPC32-NEXT: add 26, 27, 26
|
||||||
|
+; PPC32-NEXT: cmplw 6, 26, 27
|
||||||
|
+; PPC32-NEXT: cror 21, 21, 24
|
||||||
|
+; PPC32-NEXT: mullw 0, 4, 10
|
||||||
|
+; PPC32-NEXT: or. 4, 8, 7
|
||||||
|
+; PPC32-NEXT: addze 4, 11
|
||||||
|
+; PPC32-NEXT: addc 7, 24, 3
|
||||||
|
+; PPC32-NEXT: crnor 22, 2, 6
|
||||||
|
+; PPC32-NEXT: mullw 28, 8, 6
|
||||||
|
+; PPC32-NEXT: adde 8, 12, 4
|
||||||
|
+; PPC32-NEXT: addc 3, 0, 28
|
||||||
|
+; PPC32-NEXT: adde 9, 26, 9
|
||||||
|
+; PPC32-NEXT: addc 4, 7, 3
|
||||||
|
+; PPC32-NEXT: adde 3, 8, 9
|
||||||
|
+; PPC32-NEXT: cror 21, 22, 21
|
||||||
|
+; PPC32-NEXT: cmplw 4, 7
|
||||||
|
+; PPC32-NEXT: cmplw 1, 3, 8
|
||||||
|
+; PPC32-NEXT: lwz 12, 20(1)
|
||||||
|
; PPC32-NEXT: cror 20, 21, 20
|
||||||
|
-; PPC32-NEXT: mullw 0, 29, 27
|
||||||
|
+; PPC32-NEXT: crandc 21, 4, 6
|
||||||
|
+; PPC32-NEXT: crand 22, 6, 0
|
||||||
|
+; PPC32-NEXT: cror 21, 22, 21
|
||||||
|
+; PPC32-NEXT: crnor 20, 20, 21
|
||||||
|
+; PPC32-NEXT: li 7, 1
|
||||||
|
+; PPC32-NEXT: mullw 6, 6, 10
|
||||||
|
+; PPC32-NEXT: bc 12, 20, .LBB0_1
|
||||||
|
+; PPC32-NEXT: b .LBB0_2
|
||||||
|
+; PPC32-NEXT: .LBB0_1: # %start
|
||||||
|
+; PPC32-NEXT: li 7, 0
|
||||||
|
+; PPC32-NEXT: .LBB0_2: # %start
|
||||||
|
; PPC32-NEXT: mtcrf 32, 12 # cr2
|
||||||
|
; PPC32-NEXT: mtcrf 16, 12 # cr3
|
||||||
|
-; PPC32-NEXT: mtcrf 8, 12 # cr4
|
||||||
|
-; PPC32-NEXT: lwz 29, 52(1) # 4-byte Folded Reload
|
||||||
|
-; PPC32-NEXT: mullw 7, 28, 30
|
||||||
|
-; PPC32-NEXT: addc 7, 7, 0
|
||||||
|
-; PPC32-NEXT: adde 11, 10, 9
|
||||||
|
-; PPC32-NEXT: addc 9, 4, 7
|
||||||
|
-; PPC32-NEXT: adde 8, 3, 11
|
||||||
|
-; PPC32-NEXT: cmplw 6, 9, 4
|
||||||
|
-; PPC32-NEXT: cmplw 8, 3
|
||||||
|
-; PPC32-NEXT: crand 22, 2, 24
|
||||||
|
-; PPC32-NEXT: crandc 23, 0, 2
|
||||||
|
-; PPC32-NEXT: cror 22, 22, 23
|
||||||
|
-; PPC32-NEXT: crnor 20, 20, 22
|
||||||
|
-; PPC32-NEXT: li 3, 1
|
||||||
|
-; PPC32-NEXT: bc 12, 20, .LBB0_2
|
||||||
|
-; PPC32-NEXT: # %bb.1: # %start
|
||||||
|
-; PPC32-NEXT: ori 7, 3, 0
|
||||||
|
-; PPC32-NEXT: b .LBB0_3
|
||||||
|
-; PPC32-NEXT: .LBB0_2: # %start
|
||||||
|
-; PPC32-NEXT: li 7, 0
|
||||||
|
-; PPC32-NEXT: .LBB0_3: # %start
|
||||||
|
-; PPC32-NEXT: mr 3, 8
|
||||||
|
-; PPC32-NEXT: mr 4, 9
|
||||||
|
; PPC32-NEXT: lwz 30, 56(1) # 4-byte Folded Reload
|
||||||
|
+; PPC32-NEXT: lwz 29, 52(1) # 4-byte Folded Reload
|
||||||
|
; PPC32-NEXT: lwz 28, 48(1) # 4-byte Folded Reload
|
||||||
|
; PPC32-NEXT: lwz 27, 44(1) # 4-byte Folded Reload
|
||||||
|
+; PPC32-NEXT: lwz 26, 40(1) # 4-byte Folded Reload
|
||||||
|
; PPC32-NEXT: lwz 25, 36(1) # 4-byte Folded Reload
|
||||||
|
; PPC32-NEXT: lwz 24, 32(1) # 4-byte Folded Reload
|
||||||
|
; PPC32-NEXT: lwz 23, 28(1) # 4-byte Folded Reload
|
||||||
|
-; PPC32-NEXT: lwz 0, 68(1)
|
||||||
|
+; PPC32-NEXT: lwz 22, 24(1) # 4-byte Folded Reload
|
||||||
|
; PPC32-NEXT: addi 1, 1, 64
|
||||||
|
-; PPC32-NEXT: mtlr 0
|
||||||
|
; PPC32-NEXT: blr
|
||||||
|
start:
|
||||||
|
%0 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %l, i128 %r) #2
|
||||||
|
diff --git a/llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll b/llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll
|
||||||
|
index ef73fa686b3c..65ea57eaf3b9 100644
|
||||||
|
--- a/llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll
|
||||||
|
+++ b/llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll
|
||||||
|
@@ -208,43 +208,46 @@ define <3 x i1> @test_urem_vec(<3 x i11> %X) nounwind {
|
||||||
|
define i1 @test_urem_oversized(i66 %X) nounwind {
|
||||||
|
; PPC-LABEL: test_urem_oversized:
|
||||||
|
; PPC: # %bb.0:
|
||||||
|
-; PPC-NEXT: mflr 0
|
||||||
|
-; PPC-NEXT: stw 0, 4(1)
|
||||||
|
-; PPC-NEXT: stwu 1, -16(1)
|
||||||
|
-; PPC-NEXT: mr 6, 5
|
||||||
|
-; PPC-NEXT: mr 5, 4
|
||||||
|
-; PPC-NEXT: mr 4, 3
|
||||||
|
-; PPC-NEXT: lis 3, 12057
|
||||||
|
-; PPC-NEXT: lis 7, -12795
|
||||||
|
-; PPC-NEXT: ori 9, 3, 37186
|
||||||
|
-; PPC-NEXT: ori 10, 7, 40665
|
||||||
|
-; PPC-NEXT: li 3, 0
|
||||||
|
-; PPC-NEXT: li 7, 0
|
||||||
|
-; PPC-NEXT: li 8, 2
|
||||||
|
-; PPC-NEXT: bl __multi3
|
||||||
|
-; PPC-NEXT: rotlwi 7, 6, 31
|
||||||
|
-; PPC-NEXT: lis 3, -5526
|
||||||
|
-; PPC-NEXT: rlwimi 7, 5, 31, 0, 0
|
||||||
|
-; PPC-NEXT: rotlwi 5, 5, 31
|
||||||
|
-; PPC-NEXT: rlwimi 5, 4, 31, 0, 0
|
||||||
|
-; PPC-NEXT: ori 3, 3, 61135
|
||||||
|
-; PPC-NEXT: cmplwi 1, 5, 13
|
||||||
|
-; PPC-NEXT: cmplw 7, 3
|
||||||
|
-; PPC-NEXT: rlwinm 4, 4, 31, 31, 31
|
||||||
|
+; PPC-NEXT: lis 6, -12795
|
||||||
|
+; PPC-NEXT: ori 6, 6, 40665
|
||||||
|
+; PPC-NEXT: mulhwu 7, 5, 6
|
||||||
|
+; PPC-NEXT: lis 9, 12057
|
||||||
|
+; PPC-NEXT: ori 9, 9, 37186
|
||||||
|
+; PPC-NEXT: mullw 11, 4, 6
|
||||||
|
+; PPC-NEXT: addc 7, 11, 7
|
||||||
|
+; PPC-NEXT: lis 11, -5526
|
||||||
|
+; PPC-NEXT: ori 11, 11, 61135
|
||||||
|
+; PPC-NEXT: mulhwu 8, 4, 6
|
||||||
|
+; PPC-NEXT: addze 8, 8
|
||||||
|
+; PPC-NEXT: mulhwu 10, 5, 9
|
||||||
|
+; PPC-NEXT: mullw 4, 4, 9
|
||||||
|
+; PPC-NEXT: mullw 9, 5, 9
|
||||||
|
+; PPC-NEXT: addc 7, 9, 7
|
||||||
|
+; PPC-NEXT: addze 9, 10
|
||||||
|
+; PPC-NEXT: rotlwi 10, 7, 31
|
||||||
|
+; PPC-NEXT: mullw 3, 3, 6
|
||||||
|
+; PPC-NEXT: mullw 6, 5, 6
|
||||||
|
+; PPC-NEXT: slwi 5, 5, 1
|
||||||
|
+; PPC-NEXT: add 3, 5, 3
|
||||||
|
+; PPC-NEXT: rotlwi 5, 6, 31
|
||||||
|
+; PPC-NEXT: rlwimi 5, 7, 31, 0, 0
|
||||||
|
+; PPC-NEXT: add 7, 8, 9
|
||||||
|
+; PPC-NEXT: add 4, 4, 7
|
||||||
|
+; PPC-NEXT: add 3, 4, 3
|
||||||
|
+; PPC-NEXT: rlwimi 10, 3, 31, 0, 0
|
||||||
|
+; PPC-NEXT: cmplw 5, 11
|
||||||
|
+; PPC-NEXT: cmplwi 1, 10, 13
|
||||||
|
+; PPC-NEXT: rlwinm 3, 3, 31, 31, 31
|
||||||
|
; PPC-NEXT: crand 20, 6, 0
|
||||||
|
; PPC-NEXT: crandc 21, 4, 6
|
||||||
|
-; PPC-NEXT: rlwimi. 4, 6, 1, 30, 30
|
||||||
|
+; PPC-NEXT: rlwimi. 3, 6, 1, 30, 30
|
||||||
|
; PPC-NEXT: cror 20, 20, 21
|
||||||
|
; PPC-NEXT: crnand 20, 2, 20
|
||||||
|
; PPC-NEXT: li 3, 1
|
||||||
|
; PPC-NEXT: bc 12, 20, .LBB5_1
|
||||||
|
-; PPC-NEXT: b .LBB5_2
|
||||||
|
+; PPC-NEXT: blr
|
||||||
|
; PPC-NEXT: .LBB5_1:
|
||||||
|
; PPC-NEXT: li 3, 0
|
||||||
|
-; PPC-NEXT: .LBB5_2:
|
||||||
|
-; PPC-NEXT: lwz 0, 20(1)
|
||||||
|
-; PPC-NEXT: addi 1, 1, 16
|
||||||
|
-; PPC-NEXT: mtlr 0
|
||||||
|
; PPC-NEXT: blr
|
||||||
|
;
|
||||||
|
; PPC64LE-LABEL: test_urem_oversized:
|
||||||
|
--
|
||||||
|
2.35.1
|
||||||
|
|
42
_constraints
Normal file
42
_constraints
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<constraints>
|
||||||
|
<hardware>
|
||||||
|
<disk>
|
||||||
|
<size unit="G">35</size>
|
||||||
|
</disk>
|
||||||
|
<memory>
|
||||||
|
<size unit="M">4096</size>
|
||||||
|
</memory>
|
||||||
|
</hardware>
|
||||||
|
<overwrite>
|
||||||
|
<!--
|
||||||
|
We have disabled debuginfo on 32 bit architecture because they simply can no address enough memory to link llvm libraries with it.
|
||||||
|
Without debuginfo the disk and memory requirements are much lower.
|
||||||
|
-->
|
||||||
|
<conditions>
|
||||||
|
<arch>armv6l</arch>
|
||||||
|
<arch>armv7l</arch>
|
||||||
|
<arch>i586</arch>
|
||||||
|
<arch>ppc</arch>
|
||||||
|
<arch>s390</arch>
|
||||||
|
</conditions>
|
||||||
|
<hardware>
|
||||||
|
<disk>
|
||||||
|
<size unit="G">10</size>
|
||||||
|
</disk>
|
||||||
|
<memory>
|
||||||
|
<size unit="M">2048</size>
|
||||||
|
</memory>
|
||||||
|
</hardware>
|
||||||
|
</overwrite>
|
||||||
|
<overwrite>
|
||||||
|
<conditions>
|
||||||
|
<arch>riscv64</arch>
|
||||||
|
</conditions>
|
||||||
|
<hardware>
|
||||||
|
<memory>
|
||||||
|
<size unit="M">14000</size>
|
||||||
|
</memory>
|
||||||
|
</hardware>
|
||||||
|
</overwrite>
|
||||||
|
</constraints>
|
34
assume-opensuse.patch
Normal file
34
assume-opensuse.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
Index: clang-12.0.0rc1.src/lib/Driver/Distro.cpp
|
||||||
|
===================================================================
|
||||||
|
--- clang-12.0.0rc1.src.orig/lib/Driver/Distro.cpp
|
||||||
|
+++ clang-12.0.0rc1.src/lib/Driver/Distro.cpp
|
||||||
|
@@ -93,6 +93,8 @@ static Distro::DistroType DetectLsbRelease...
|
||||||
|
}
|
||||||
|
|
||||||
|
static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
|
||||||
|
+ return Distro::OpenSUSE;
|
||||||
|
+/*
|
||||||
|
Distro::DistroType Version = Distro::UnknownDistro;
|
||||||
|
|
||||||
|
// Newer freedesktop.org's compilant systemd-based systems
|
||||||
|
@@ -200,7 +202,7 @@ static Distro::DistroType DetectDistro(l
|
||||||
|
if (VFS.exists("/etc/gentoo-release"))
|
||||||
|
return Distro::Gentoo;
|
||||||
|
|
||||||
|
- return Distro::UnknownDistro;
|
||||||
|
+ return Distro::UnknownDistro;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
static Distro::DistroType GetDistro(llvm::vfs::FileSystem &VFS,
|
||||||
|
Index: clang-12.0.0rc1.src/unittests/Driver/CMakeLists.txt
|
||||||
|
===================================================================
|
||||||
|
--- clang-12.0.0rc1.src.orig/unittests/Driver/CMakeLists.txt
|
||||||
|
+++ clang-12.0.0rc1.src/unittests/Driver/CMakeLists.txt
|
||||||
|
@@ -5,7 +5,6 @@ set(LLVM_LINK_COMPONENTS
|
||||||
|
)
|
||||||
|
|
||||||
|
add_clang_unittest(ClangDriverTests
|
||||||
|
- DistroTest.cpp
|
||||||
|
ToolChainTest.cpp
|
||||||
|
ModuleCacheTest.cpp
|
||||||
|
MultilibTest.cpp
|
8
baselibs.conf
Normal file
8
baselibs.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
libLLVM14
|
||||||
|
libclang-cpp14
|
||||||
|
llvm14-devel
|
||||||
|
provides "llvm-devel-<targettype> = <version>"
|
||||||
|
conflicts "otherproviders(llvm-devel-<targettype>)"
|
||||||
|
clang14-devel
|
||||||
|
provides "clang-devel-<targettype> = <version>"
|
||||||
|
conflicts "otherproviders(clang-devel-<targettype>)"
|
16
check-no-llvm-exegesis.patch
Normal file
16
check-no-llvm-exegesis.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
--- a/llvm/test/CMakeLists.txt
|
||||||
|
+++ b/llvm/test/CMakeLists.txt
|
||||||
|
@@ -81,7 +81,6 @@ set(LLVM_TEST_DEPENDS
|
||||||
|
dsymutil
|
||||||
|
llvm-dwarfdump
|
||||||
|
llvm-dwp
|
||||||
|
- llvm-exegesis
|
||||||
|
llvm-extract
|
||||||
|
llvm-gsymutil
|
||||||
|
llvm-isel-fuzzer
|
||||||
|
--- a/llvm/test/tools/llvm-exegesis/lit.local.cfg
|
||||||
|
+++ b/llvm/test/tools/llvm-exegesis/lit.local.cfg
|
||||||
|
@@ -1,2 +1 @@
|
||||||
|
-if 'native' not in config.available_features:
|
||||||
|
- config.unsupported = True
|
||||||
|
+config.unsupported = True
|
3
clang-14.0.0.src.tar.xz
Normal file
3
clang-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:f5d7ffb86ed57f97d7c471d542c4e5685db4b75fb817c4c3f027bfa49e561b9b
|
||||||
|
size 18536580
|
3
clang-docs-14.0.0.src.tar.xz
Normal file
3
clang-docs-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:278e85a4294440256e2be13c8610f4f6aa8c2e7d3ad2074ab0d6b716f51811a6
|
||||||
|
size 1413280
|
33
clang-repl-private-deps.patch
Normal file
33
clang-repl-private-deps.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 3abb807f6773a980f4150b22336a9a4a8a19c1d5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
|
||||||
|
Date: Sun, 27 Mar 2022 20:56:02 +0200
|
||||||
|
Subject: [PATCH] Let clang-repl link privately against Clang components
|
||||||
|
|
||||||
|
First of all, this is the convention: all other tools have their
|
||||||
|
dependencies private. While it does not have an effect on linking
|
||||||
|
(there is no linking against executables), it does have an effect
|
||||||
|
on exporting: having the targets private allows installing the tools
|
||||||
|
without the libraries in a statically linked build, or a build against
|
||||||
|
libclang-cpp.so.
|
||||||
|
|
||||||
|
Differential Revision: https://reviews.llvm.org/D122546
|
||||||
|
---
|
||||||
|
clang/tools/clang-repl/CMakeLists.txt | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/clang/tools/clang-repl/CMakeLists.txt b/clang/tools/clang-repl/CMakeLists.txt
|
||||||
|
index 30e3b2be9ed3..b51a18c10cdc 100644
|
||||||
|
--- a/clang/tools/clang-repl/CMakeLists.txt
|
||||||
|
+++ b/clang/tools/clang-repl/CMakeLists.txt
|
||||||
|
@@ -11,7 +11,7 @@ add_clang_tool(clang-repl
|
||||||
|
ClangRepl.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
-clang_target_link_libraries(clang-repl PUBLIC
|
||||||
|
+clang_target_link_libraries(clang-repl PRIVATE
|
||||||
|
clangBasic
|
||||||
|
clangFrontend
|
||||||
|
clangInterpreter
|
||||||
|
--
|
||||||
|
2.35.1
|
||||||
|
|
13
clang-resourcedirs.patch
Normal file
13
clang-resourcedirs.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Index: cfe-6.0.0rc1.src/lib/Driver/Driver.cpp
|
||||||
|
===================================================================
|
||||||
|
--- cfe-6.0.0rc1.src.orig/lib/Driver/Driver.cpp
|
||||||
|
+++ cfe-6.0.0rc1.src/lib/Driver/Driver.cpp
|
||||||
|
@@ -115,7 +115,7 @@ Driver::Driver(StringRef ClangExecutable
|
||||||
|
// Dir is bin/ or lib/, depending on where BinaryPath is.
|
||||||
|
std::string Dir = std::string(llvm::sys::path::parent_path(BinaryPath));
|
||||||
|
|
||||||
|
- SmallString<128> P(Dir);
|
||||||
|
+ SmallString<128> P((Dir != "") ? Dir : "/usr/bin/");
|
||||||
|
if (CustomResourceDir != "") {
|
||||||
|
llvm::sys::path::append(P, CustomResourceDir);
|
||||||
|
} else {
|
3
clang-tools-extra-14.0.0.src.tar.xz
Normal file
3
clang-tools-extra-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:f49de4b4502a6608425338e2d93bbe4529cac0a22f2dc1c119ef175a4e1b5bf0
|
||||||
|
size 2849264
|
477
compact_unwind_encoding.h
Normal file
477
compact_unwind_encoding.h
Normal file
@ -0,0 +1,477 @@
|
|||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||||
|
// See https://llvm.org/LICENSE.txt for license information.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Darwin's alternative to DWARF based unwind encodings.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __COMPACT_UNWIND_ENCODING__
|
||||||
|
#define __COMPACT_UNWIND_ENCODING__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
// Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section
|
||||||
|
// of object files. Or compilers can emit compact unwind information in
|
||||||
|
// the __LD,__compact_unwind section.
|
||||||
|
//
|
||||||
|
// When the linker creates a final linked image, it will create a
|
||||||
|
// __TEXT,__unwind_info section. This section is a small and fast way for the
|
||||||
|
// runtime to access unwind info for any given function. If the compiler
|
||||||
|
// emitted compact unwind info for the function, that compact unwind info will
|
||||||
|
// be encoded in the __TEXT,__unwind_info section. If the compiler emitted
|
||||||
|
// DWARF unwind info, the __TEXT,__unwind_info section will contain the offset
|
||||||
|
// of the FDE in the __TEXT,__eh_frame section in the final linked image.
|
||||||
|
//
|
||||||
|
// Note: Previously, the linker would transform some DWARF unwind infos into
|
||||||
|
// compact unwind info. But that is fragile and no longer done.
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// The compact unwind endoding is a 32-bit value which encoded in an
|
||||||
|
// architecture specific way, which registers to restore from where, and how
|
||||||
|
// to unwind out of the function.
|
||||||
|
//
|
||||||
|
typedef uint32_t compact_unwind_encoding_t;
|
||||||
|
|
||||||
|
|
||||||
|
// architecture independent bits
|
||||||
|
enum {
|
||||||
|
UNWIND_IS_NOT_FUNCTION_START = 0x80000000,
|
||||||
|
UNWIND_HAS_LSDA = 0x40000000,
|
||||||
|
UNWIND_PERSONALITY_MASK = 0x30000000,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// x86
|
||||||
|
//
|
||||||
|
// 1-bit: start
|
||||||
|
// 1-bit: has lsda
|
||||||
|
// 2-bit: personality index
|
||||||
|
//
|
||||||
|
// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF
|
||||||
|
// ebp based:
|
||||||
|
// 15-bits (5*3-bits per reg) register permutation
|
||||||
|
// 8-bits for stack offset
|
||||||
|
// frameless:
|
||||||
|
// 8-bits stack size
|
||||||
|
// 3-bits stack adjust
|
||||||
|
// 3-bits register count
|
||||||
|
// 10-bits register permutation
|
||||||
|
//
|
||||||
|
enum {
|
||||||
|
UNWIND_X86_MODE_MASK = 0x0F000000,
|
||||||
|
UNWIND_X86_MODE_EBP_FRAME = 0x01000000,
|
||||||
|
UNWIND_X86_MODE_STACK_IMMD = 0x02000000,
|
||||||
|
UNWIND_X86_MODE_STACK_IND = 0x03000000,
|
||||||
|
UNWIND_X86_MODE_DWARF = 0x04000000,
|
||||||
|
|
||||||
|
UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF,
|
||||||
|
UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000,
|
||||||
|
|
||||||
|
UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000,
|
||||||
|
UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000,
|
||||||
|
UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
|
||||||
|
UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
|
||||||
|
|
||||||
|
UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
UNWIND_X86_REG_NONE = 0,
|
||||||
|
UNWIND_X86_REG_EBX = 1,
|
||||||
|
UNWIND_X86_REG_ECX = 2,
|
||||||
|
UNWIND_X86_REG_EDX = 3,
|
||||||
|
UNWIND_X86_REG_EDI = 4,
|
||||||
|
UNWIND_X86_REG_ESI = 5,
|
||||||
|
UNWIND_X86_REG_EBP = 6,
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// For x86 there are four modes for the compact unwind encoding:
|
||||||
|
// UNWIND_X86_MODE_EBP_FRAME:
|
||||||
|
// EBP based frame where EBP is push on stack immediately after return address,
|
||||||
|
// then ESP is moved to EBP. Thus, to unwind ESP is restored with the current
|
||||||
|
// EPB value, then EBP is restored by popping off the stack, and the return
|
||||||
|
// is done by popping the stack once more into the pc.
|
||||||
|
// All non-volatile registers that need to be restored must have been saved
|
||||||
|
// in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4
|
||||||
|
// is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved
|
||||||
|
// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
|
||||||
|
// Each entry contains which register to restore.
|
||||||
|
// UNWIND_X86_MODE_STACK_IMMD:
|
||||||
|
// A "frameless" (EBP not used as frame pointer) function with a small
|
||||||
|
// constant stack size. To return, a constant (encoded in the compact
|
||||||
|
// unwind encoding) is added to the ESP. Then the return is done by
|
||||||
|
// popping the stack into the pc.
|
||||||
|
// All non-volatile registers that need to be restored must have been saved
|
||||||
|
// on the stack immediately after the return address. The stack_size/4 is
|
||||||
|
// encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024).
|
||||||
|
// The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT.
|
||||||
|
// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
|
||||||
|
// saved and their order.
|
||||||
|
// UNWIND_X86_MODE_STACK_IND:
|
||||||
|
// A "frameless" (EBP not used as frame pointer) function large constant
|
||||||
|
// stack size. This case is like the previous, except the stack size is too
|
||||||
|
// large to encode in the compact unwind encoding. Instead it requires that
|
||||||
|
// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
|
||||||
|
// encoding contains the offset to the nnnnnnnn value in the function in
|
||||||
|
// UNWIND_X86_FRAMELESS_STACK_SIZE.
|
||||||
|
// UNWIND_X86_MODE_DWARF:
|
||||||
|
// No compact unwind encoding is available. Instead the low 24-bits of the
|
||||||
|
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
|
||||||
|
// This mode is never used in object files. It is only generated by the
|
||||||
|
// linker in final linked images which have only DWARF unwind info for a
|
||||||
|
// function.
|
||||||
|
//
|
||||||
|
// The permutation encoding is a Lehmer code sequence encoded into a
|
||||||
|
// single variable-base number so we can encode the ordering of up to
|
||||||
|
// six registers in a 10-bit space.
|
||||||
|
//
|
||||||
|
// The following is the algorithm used to create the permutation encoding used
|
||||||
|
// with frameless stacks. It is passed the number of registers to be saved and
|
||||||
|
// an array of the register numbers saved.
|
||||||
|
//
|
||||||
|
//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6])
|
||||||
|
//{
|
||||||
|
// uint32_t renumregs[6];
|
||||||
|
// for (int i=6-registerCount; i < 6; ++i) {
|
||||||
|
// int countless = 0;
|
||||||
|
// for (int j=6-registerCount; j < i; ++j) {
|
||||||
|
// if ( registers[j] < registers[i] )
|
||||||
|
// ++countless;
|
||||||
|
// }
|
||||||
|
// renumregs[i] = registers[i] - countless -1;
|
||||||
|
// }
|
||||||
|
// uint32_t permutationEncoding = 0;
|
||||||
|
// switch ( registerCount ) {
|
||||||
|
// case 6:
|
||||||
|
// permutationEncoding |= (120*renumregs[0] + 24*renumregs[1]
|
||||||
|
// + 6*renumregs[2] + 2*renumregs[3]
|
||||||
|
// + renumregs[4]);
|
||||||
|
// break;
|
||||||
|
// case 5:
|
||||||
|
// permutationEncoding |= (120*renumregs[1] + 24*renumregs[2]
|
||||||
|
// + 6*renumregs[3] + 2*renumregs[4]
|
||||||
|
// + renumregs[5]);
|
||||||
|
// break;
|
||||||
|
// case 4:
|
||||||
|
// permutationEncoding |= (60*renumregs[2] + 12*renumregs[3]
|
||||||
|
// + 3*renumregs[4] + renumregs[5]);
|
||||||
|
// break;
|
||||||
|
// case 3:
|
||||||
|
// permutationEncoding |= (20*renumregs[3] + 4*renumregs[4]
|
||||||
|
// + renumregs[5]);
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// permutationEncoding |= (5*renumregs[4] + renumregs[5]);
|
||||||
|
// break;
|
||||||
|
// case 1:
|
||||||
|
// permutationEncoding |= (renumregs[5]);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// return permutationEncoding;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// x86_64
|
||||||
|
//
|
||||||
|
// 1-bit: start
|
||||||
|
// 1-bit: has lsda
|
||||||
|
// 2-bit: personality index
|
||||||
|
//
|
||||||
|
// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=DWARF
|
||||||
|
// rbp based:
|
||||||
|
// 15-bits (5*3-bits per reg) register permutation
|
||||||
|
// 8-bits for stack offset
|
||||||
|
// frameless:
|
||||||
|
// 8-bits stack size
|
||||||
|
// 3-bits stack adjust
|
||||||
|
// 3-bits register count
|
||||||
|
// 10-bits register permutation
|
||||||
|
//
|
||||||
|
enum {
|
||||||
|
UNWIND_X86_64_MODE_MASK = 0x0F000000,
|
||||||
|
UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000,
|
||||||
|
UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000,
|
||||||
|
UNWIND_X86_64_MODE_STACK_IND = 0x03000000,
|
||||||
|
UNWIND_X86_64_MODE_DWARF = 0x04000000,
|
||||||
|
|
||||||
|
UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF,
|
||||||
|
UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000,
|
||||||
|
|
||||||
|
UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000,
|
||||||
|
UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000,
|
||||||
|
UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
|
||||||
|
UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
|
||||||
|
|
||||||
|
UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
UNWIND_X86_64_REG_NONE = 0,
|
||||||
|
UNWIND_X86_64_REG_RBX = 1,
|
||||||
|
UNWIND_X86_64_REG_R12 = 2,
|
||||||
|
UNWIND_X86_64_REG_R13 = 3,
|
||||||
|
UNWIND_X86_64_REG_R14 = 4,
|
||||||
|
UNWIND_X86_64_REG_R15 = 5,
|
||||||
|
UNWIND_X86_64_REG_RBP = 6,
|
||||||
|
};
|
||||||
|
//
|
||||||
|
// For x86_64 there are four modes for the compact unwind encoding:
|
||||||
|
// UNWIND_X86_64_MODE_RBP_FRAME:
|
||||||
|
// RBP based frame where RBP is push on stack immediately after return address,
|
||||||
|
// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
|
||||||
|
// EPB value, then RBP is restored by popping off the stack, and the return
|
||||||
|
// is done by popping the stack once more into the pc.
|
||||||
|
// All non-volatile registers that need to be restored must have been saved
|
||||||
|
// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
|
||||||
|
// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
|
||||||
|
// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
|
||||||
|
// Each entry contains which register to restore.
|
||||||
|
// UNWIND_X86_64_MODE_STACK_IMMD:
|
||||||
|
// A "frameless" (RBP not used as frame pointer) function with a small
|
||||||
|
// constant stack size. To return, a constant (encoded in the compact
|
||||||
|
// unwind encoding) is added to the RSP. Then the return is done by
|
||||||
|
// popping the stack into the pc.
|
||||||
|
// All non-volatile registers that need to be restored must have been saved
|
||||||
|
// on the stack immediately after the return address. The stack_size/8 is
|
||||||
|
// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
|
||||||
|
// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
|
||||||
|
// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
|
||||||
|
// saved and their order.
|
||||||
|
// UNWIND_X86_64_MODE_STACK_IND:
|
||||||
|
// A "frameless" (RBP not used as frame pointer) function large constant
|
||||||
|
// stack size. This case is like the previous, except the stack size is too
|
||||||
|
// large to encode in the compact unwind encoding. Instead it requires that
|
||||||
|
// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
|
||||||
|
// encoding contains the offset to the nnnnnnnn value in the function in
|
||||||
|
// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
|
||||||
|
// UNWIND_X86_64_MODE_DWARF:
|
||||||
|
// No compact unwind encoding is available. Instead the low 24-bits of the
|
||||||
|
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
|
||||||
|
// This mode is never used in object files. It is only generated by the
|
||||||
|
// linker in final linked images which have only DWARF unwind info for a
|
||||||
|
// function.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// ARM64
|
||||||
|
//
|
||||||
|
// 1-bit: start
|
||||||
|
// 1-bit: has lsda
|
||||||
|
// 2-bit: personality index
|
||||||
|
//
|
||||||
|
// 4-bits: 4=frame-based, 3=DWARF, 2=frameless
|
||||||
|
// frameless:
|
||||||
|
// 12-bits of stack size
|
||||||
|
// frame-based:
|
||||||
|
// 4-bits D reg pairs saved
|
||||||
|
// 5-bits X reg pairs saved
|
||||||
|
// DWARF:
|
||||||
|
// 24-bits offset of DWARF FDE in __eh_frame section
|
||||||
|
//
|
||||||
|
enum {
|
||||||
|
UNWIND_ARM64_MODE_MASK = 0x0F000000,
|
||||||
|
UNWIND_ARM64_MODE_FRAMELESS = 0x02000000,
|
||||||
|
UNWIND_ARM64_MODE_DWARF = 0x03000000,
|
||||||
|
UNWIND_ARM64_MODE_FRAME = 0x04000000,
|
||||||
|
|
||||||
|
UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001,
|
||||||
|
UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002,
|
||||||
|
UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004,
|
||||||
|
UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008,
|
||||||
|
UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010,
|
||||||
|
UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100,
|
||||||
|
UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200,
|
||||||
|
UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400,
|
||||||
|
UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800,
|
||||||
|
|
||||||
|
UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000,
|
||||||
|
UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
|
||||||
|
};
|
||||||
|
// For arm64 there are three modes for the compact unwind encoding:
|
||||||
|
// UNWIND_ARM64_MODE_FRAME:
|
||||||
|
// This is a standard arm64 prolog where FP/LR are immediately pushed on the
|
||||||
|
// stack, then SP is copied to FP. If there are any non-volatile registers
|
||||||
|
// saved, then are copied into the stack frame in pairs in a contiguous
|
||||||
|
// range right below the saved FP/LR pair. Any subset of the five X pairs
|
||||||
|
// and four D pairs can be saved, but the memory layout must be in register
|
||||||
|
// number order.
|
||||||
|
// UNWIND_ARM64_MODE_FRAMELESS:
|
||||||
|
// A "frameless" leaf function, where FP/LR are not saved. The return address
|
||||||
|
// remains in LR throughout the function. If any non-volatile registers
|
||||||
|
// are saved, they must be pushed onto the stack before any stack space is
|
||||||
|
// allocated for local variables. The stack sized (including any saved
|
||||||
|
// non-volatile registers) divided by 16 is encoded in the bits
|
||||||
|
// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
|
||||||
|
// UNWIND_ARM64_MODE_DWARF:
|
||||||
|
// No compact unwind encoding is available. Instead the low 24-bits of the
|
||||||
|
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
|
||||||
|
// This mode is never used in object files. It is only generated by the
|
||||||
|
// linker in final linked images which have only DWARF unwind info for a
|
||||||
|
// function.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Relocatable Object Files: __LD,__compact_unwind
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//
|
||||||
|
// A compiler can generated compact unwind information for a function by adding
|
||||||
|
// a "row" to the __LD,__compact_unwind section. This section has the
|
||||||
|
// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
|
||||||
|
// It is removed by the new linker, so never ends up in final executables.
|
||||||
|
// This section is a table, initially with one row per function (that needs
|
||||||
|
// unwind info). The table columns and some conceptual entries are:
|
||||||
|
//
|
||||||
|
// range-start pointer to start of function/range
|
||||||
|
// range-length
|
||||||
|
// compact-unwind-encoding 32-bit encoding
|
||||||
|
// personality-function or zero if no personality function
|
||||||
|
// lsda or zero if no LSDA data
|
||||||
|
//
|
||||||
|
// The length and encoding fields are 32-bits. The other are all pointer sized.
|
||||||
|
//
|
||||||
|
// In x86_64 assembly, these entry would look like:
|
||||||
|
//
|
||||||
|
// .section __LD,__compact_unwind,regular,debug
|
||||||
|
//
|
||||||
|
// #compact unwind for _foo
|
||||||
|
// .quad _foo
|
||||||
|
// .set L1,LfooEnd-_foo
|
||||||
|
// .long L1
|
||||||
|
// .long 0x01010001
|
||||||
|
// .quad 0
|
||||||
|
// .quad 0
|
||||||
|
//
|
||||||
|
// #compact unwind for _bar
|
||||||
|
// .quad _bar
|
||||||
|
// .set L2,LbarEnd-_bar
|
||||||
|
// .long L2
|
||||||
|
// .long 0x01020011
|
||||||
|
// .quad __gxx_personality
|
||||||
|
// .quad except_tab1
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Notes: There is no need for any labels in the the __compact_unwind section.
|
||||||
|
// The use of the .set directive is to force the evaluation of the
|
||||||
|
// range-length at assembly time, instead of generating relocations.
|
||||||
|
//
|
||||||
|
// To support future compiler optimizations where which non-volatile registers
|
||||||
|
// are saved changes within a function (e.g. delay saving non-volatiles until
|
||||||
|
// necessary), there can by multiple lines in the __compact_unwind table for one
|
||||||
|
// function, each with a different (non-overlapping) range and each with
|
||||||
|
// different compact unwind encodings that correspond to the non-volatiles
|
||||||
|
// saved at that range of the function.
|
||||||
|
//
|
||||||
|
// If a particular function is so wacky that there is no compact unwind way
|
||||||
|
// to encode it, then the compiler can emit traditional DWARF unwind info.
|
||||||
|
// The runtime will use which ever is available.
|
||||||
|
//
|
||||||
|
// Runtime support for compact unwind encodings are only available on 10.6
|
||||||
|
// and later. So, the compiler should not generate it when targeting pre-10.6.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Final Linked Images: __TEXT,__unwind_info
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//
|
||||||
|
// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
|
||||||
|
// The header of the section contains a coarse index that maps function address
|
||||||
|
// to the page (4096 byte block) containing the unwind info for that function.
|
||||||
|
//
|
||||||
|
|
||||||
|
#define UNWIND_SECTION_VERSION 1
|
||||||
|
struct unwind_info_section_header
|
||||||
|
{
|
||||||
|
uint32_t version; // UNWIND_SECTION_VERSION
|
||||||
|
uint32_t commonEncodingsArraySectionOffset;
|
||||||
|
uint32_t commonEncodingsArrayCount;
|
||||||
|
uint32_t personalityArraySectionOffset;
|
||||||
|
uint32_t personalityArrayCount;
|
||||||
|
uint32_t indexSectionOffset;
|
||||||
|
uint32_t indexCount;
|
||||||
|
// compact_unwind_encoding_t[]
|
||||||
|
// uint32_t personalities[]
|
||||||
|
// unwind_info_section_header_index_entry[]
|
||||||
|
// unwind_info_section_header_lsda_index_entry[]
|
||||||
|
};
|
||||||
|
|
||||||
|
struct unwind_info_section_header_index_entry
|
||||||
|
{
|
||||||
|
uint32_t functionOffset;
|
||||||
|
uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page
|
||||||
|
uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range
|
||||||
|
};
|
||||||
|
|
||||||
|
struct unwind_info_section_header_lsda_index_entry
|
||||||
|
{
|
||||||
|
uint32_t functionOffset;
|
||||||
|
uint32_t lsdaOffset;
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// There are two kinds of second level index pages: regular and compressed.
|
||||||
|
// A compressed page can hold up to 1021 entries, but it cannot be used
|
||||||
|
// if too many different encoding types are used. The regular page holds
|
||||||
|
// 511 entries.
|
||||||
|
//
|
||||||
|
|
||||||
|
struct unwind_info_regular_second_level_entry
|
||||||
|
{
|
||||||
|
uint32_t functionOffset;
|
||||||
|
compact_unwind_encoding_t encoding;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define UNWIND_SECOND_LEVEL_REGULAR 2
|
||||||
|
struct unwind_info_regular_second_level_page_header
|
||||||
|
{
|
||||||
|
uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
|
||||||
|
uint16_t entryPageOffset;
|
||||||
|
uint16_t entryCount;
|
||||||
|
// entry array
|
||||||
|
};
|
||||||
|
|
||||||
|
#define UNWIND_SECOND_LEVEL_COMPRESSED 3
|
||||||
|
struct unwind_info_compressed_second_level_page_header
|
||||||
|
{
|
||||||
|
uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
|
||||||
|
uint16_t entryPageOffset;
|
||||||
|
uint16_t entryCount;
|
||||||
|
uint16_t encodingsPageOffset;
|
||||||
|
uint16_t encodingsCount;
|
||||||
|
// 32-bit entry array
|
||||||
|
// encodings array
|
||||||
|
};
|
||||||
|
|
||||||
|
#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF)
|
||||||
|
#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
3
compiler-rt-14.0.0.src.tar.xz
Normal file
3
compiler-rt-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:27ab7fcfb21d108093c0be766a9ed5fe18c04e4f74f936069711a312c8ae0377
|
||||||
|
size 2327888
|
15
default-to-i586.patch
Normal file
15
default-to-i586.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Index: cfe-6.0.0rc1.src/lib/Driver/ToolChains/Arch/X86.cpp
|
||||||
|
===================================================================
|
||||||
|
--- cfe-6.0.0rc1.src.orig/lib/Driver/ToolChains/Arch/X86.cpp
|
||||||
|
+++ cfe-6.0.0rc1.src/lib/Driver/ToolChains/Arch/X86.cpp
|
||||||
|
@@ -102,8 +102,8 @@ const char *x86::getX86TargetCPU(const A
|
||||||
|
case llvm::Triple::FreeBSD:
|
||||||
|
return "i686";
|
||||||
|
default:
|
||||||
|
- // Fallback to p4.
|
||||||
|
- return "pentium4";
|
||||||
|
+ // Fallback to i586.
|
||||||
|
+ return "i586";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
3
libcxx-14.0.0.src.tar.xz
Normal file
3
libcxx-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:2afa906b1a9c6fef0c83af576f54191c33b5170de3c4adf01aab66a510af3fd6
|
||||||
|
size 3065196
|
3
libcxxabi-14.0.0.src.tar.xz
Normal file
3
libcxxabi-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b6fd1b53ced3c9a230bf0660c58a0a26ef9b0e8257e4ef70d1f690fa84e77074
|
||||||
|
size 561952
|
58
link-clang-shared.patch
Normal file
58
link-clang-shared.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
diff --git a/clang/tools/c-index-test/CMakeLists.txt b/clang/tools/c-index-test/CMakeLists.txt
|
||||||
|
index ceef4b08637..606149ad74f 100644
|
||||||
|
--- a/clang/tools/c-index-test/CMakeLists.txt
|
||||||
|
+++ b/clang/tools/c-index-test/CMakeLists.txt
|
||||||
|
@@ -18,6 +18,9 @@ if (LLVM_BUILD_STATIC)
|
||||||
|
target_link_libraries(c-index-test
|
||||||
|
PRIVATE
|
||||||
|
libclang_static
|
||||||
|
+ )
|
||||||
|
+ clang_target_link_libraries(c-index-test
|
||||||
|
+ PRIVATE
|
||||||
|
clangCodeGen
|
||||||
|
clangIndex
|
||||||
|
)
|
||||||
|
@@ -25,6 +28,9 @@ else()
|
||||||
|
target_link_libraries(c-index-test
|
||||||
|
PRIVATE
|
||||||
|
libclang
|
||||||
|
+ )
|
||||||
|
+ clang_target_link_libraries(c-index-test
|
||||||
|
+ PRIVATE
|
||||||
|
clangAST
|
||||||
|
clangBasic
|
||||||
|
clangCodeGen
|
||||||
|
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
|
||||||
|
index 613ead1a36b..f86be77b8e7 100644
|
||||||
|
--- a/clang/tools/libclang/CMakeLists.txt
|
||||||
|
+++ b/clang/tools/libclang/CMakeLists.txt
|
||||||
|
@@ -33,7 +33,7 @@ set(SOURCES
|
||||||
|
../../include/clang-c/Index.h
|
||||||
|
)
|
||||||
|
|
||||||
|
-set(LIBS
|
||||||
|
+set(CLANG_LIB_DEPS
|
||||||
|
clangAST
|
||||||
|
clangBasic
|
||||||
|
clangDriver
|
||||||
|
@@ -46,7 +46,7 @@ set(LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CLANG_ENABLE_ARCMT)
|
||||||
|
- list(APPEND LIBS clangARCMigrate)
|
||||||
|
+ list(APPEND CLANG_LIB_DEPS clangARCMigrate)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (HAVE_LIBDL)
|
||||||
|
@@ -108,6 +108,11 @@ add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} INSTALL_WITH_TOOLCH
|
||||||
|
Support
|
||||||
|
)
|
||||||
|
|
||||||
|
+clang_target_link_libraries(libclang
|
||||||
|
+ PRIVATE
|
||||||
|
+ ${CLANG_LIB_DEPS}
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
if(ENABLE_STATIC)
|
||||||
|
foreach(name libclang obj.libclang libclang_static)
|
||||||
|
if (TARGET ${name})
|
48
link-clang-tools-extra-shared.patch
Normal file
48
link-clang-tools-extra-shared.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
diff --git a/clang-tools-extra/clang-include-fixer/plugin/CMakeLists.txt b/clang-tools-extra/clang-include-fixer/plugin/CMakeLists.txt
|
||||||
|
index 6d0328ed831..d531e44743a 100644
|
||||||
|
--- a/clang-tools-extra/clang-include-fixer/plugin/CMakeLists.txt
|
||||||
|
+++ b/clang-tools-extra/clang-include-fixer/plugin/CMakeLists.txt
|
||||||
|
@@ -2,15 +2,18 @@ add_clang_library(clangIncludeFixerPlugin
|
||||||
|
IncludeFixerPlugin.cpp
|
||||||
|
|
||||||
|
LINK_LIBS
|
||||||
|
+ clangIncludeFixer
|
||||||
|
+ ${LLVM_PTHREAD_LIB}
|
||||||
|
+
|
||||||
|
+ DEPENDS
|
||||||
|
+ omp_gen
|
||||||
|
+ )
|
||||||
|
+clang_target_link_libraries(clangIncludeFixerPlugin
|
||||||
|
+ PRIVATE
|
||||||
|
clangAST
|
||||||
|
clangBasic
|
||||||
|
clangFrontend
|
||||||
|
- clangIncludeFixer
|
||||||
|
clangParse
|
||||||
|
clangSema
|
||||||
|
clangTooling
|
||||||
|
- ${LLVM_PTHREAD_LIB}
|
||||||
|
-
|
||||||
|
- DEPENDS
|
||||||
|
- omp_gen
|
||||||
|
)
|
||||||
|
diff --git a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
|
||||||
|
index 8f708cacfdf..b08e9cee954 100644
|
||||||
|
--- a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
|
||||||
|
+++ b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
|
||||||
|
@@ -27,10 +27,13 @@ add_clang_library(clangDaemonTweaks OBJECT
|
||||||
|
SwapIfBranches.cpp
|
||||||
|
|
||||||
|
LINK_LIBS
|
||||||
|
- clangAST
|
||||||
|
- clangBasic
|
||||||
|
clangDaemon
|
||||||
|
clangdSupport
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
+clang_target_link_libraries(clangDaemonTweaks INTERFACE
|
||||||
|
+ clangAST
|
||||||
|
+ clangBasic
|
||||||
|
clangFormat
|
||||||
|
clangLex
|
||||||
|
clangToolingCore
|
3
lld-14.0.0.src.tar.xz
Normal file
3
lld-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:88fc0f028aa8c0d9287920b101f288b03c7fabb584077326c5a0be482eb9115c
|
||||||
|
size 1362316
|
13
lld-default-sha1.patch
Normal file
13
lld-default-sha1.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Index: lld-10.0.0.src/ELF/Driver.cpp
|
||||||
|
===================================================================
|
||||||
|
--- lld-10.0.0.src.orig/ELF/Driver.cpp
|
||||||
|
+++ lld-10.0.0.src/ELF/Driver.cpp
|
||||||
|
@@ -693,7 +693,7 @@ getBuildId(opt::InputArgList &args) {
|
||||||
|
return {BuildIdKind::None, {}};
|
||||||
|
|
||||||
|
if (arg->getOption().getID() == OPT_build_id)
|
||||||
|
- return {BuildIdKind::Fast, {}};
|
||||||
|
+ return {BuildIdKind::Sha1, {}};
|
||||||
|
|
||||||
|
StringRef s = arg->getValue();
|
||||||
|
if (s == "fast")
|
3
lldb-14.0.0.src.tar.xz
Normal file
3
lldb-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:39c814255a905722587bd6aeb44d013d34cd510699ebc5901c9e1f8afe46faeb
|
||||||
|
size 10088792
|
13
lldb-cmake.patch
Normal file
13
lldb-cmake.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Index: lldb-10.0.0rc1.src/source/Host/CMakeLists.txt
|
||||||
|
===================================================================
|
||||||
|
--- lldb-10.0.0rc1.src.orig/source/Host/CMakeLists.txt
|
||||||
|
+++ lldb-10.0.0rc1.src/source/Host/CMakeLists.txt
|
||||||
|
@@ -143,6 +143,8 @@ endif()
|
||||||
|
set(EXTRA_LIBS)
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||||
|
list(APPEND EXTRA_LIBS kvm)
|
||||||
|
+elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
+ list(APPEND EXTRA_LIBS dl pthread)
|
||||||
|
endif()
|
||||||
|
if (LLDB_ENABLE_LIBXML2)
|
||||||
|
list(APPEND EXTRA_LIBS LibXml2::LibXml2)
|
3
llvm-14.0.0.src.tar.xz
Normal file
3
llvm-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:4df7ed50b8b7017b90dc22202f6b59e9006a29a9568238c6af28df9c049c7b9b
|
||||||
|
size 49650544
|
22
llvm-better-detect-64bit-atomics-support.patch
Normal file
22
llvm-better-detect-64bit-atomics-support.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
Better detect 64bit atomics support.
|
||||||
|
|
||||||
|
It appears that on i586 std::atomic<uint64_t>::load is compiled into
|
||||||
|
instruction, but std::atomic<double>::load uses __atomic_load_8. This must
|
||||||
|
be detected so the build system links it to libatomic.
|
||||||
|
Index: llvm-12.0.0.src/cmake/modules/CheckAtomic.cmake
|
||||||
|
===================================================================
|
||||||
|
--- llvm-12.0.0.src.orig/cmake/modules/CheckAtomic.cmake
|
||||||
|
+++ llvm-12.0.0.src/cmake/modules/CheckAtomic.cmake
|
||||||
|
@@ -30,9 +30,12 @@ function(check_working_cxx_atomics64 var
|
||||||
|
#include <atomic>
|
||||||
|
#include <cstdint>
|
||||||
|
std::atomic<uint64_t> x (0);
|
||||||
|
+std::atomic<double> y (0);
|
||||||
|
int main() {
|
||||||
|
uint64_t i = x.load(std::memory_order_relaxed);
|
||||||
|
+ double j = y.load(std::memory_order_relaxed);
|
||||||
|
(void)i;
|
||||||
|
+ (void)j;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" ${varname})
|
134
llvm-do-not-install-static-libraries.patch
Normal file
134
llvm-do-not-install-static-libraries.patch
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
This has similar effect as simply deleting the static libraries which we don't
|
||||||
|
want after installation. By not copying them in the first place we reduce the
|
||||||
|
disk usage during installation.
|
||||||
|
|
||||||
|
Index: clang-14.0.0.src/cmake/modules/AddClang.cmake
|
||||||
|
===================================================================
|
||||||
|
--- a/clang-14.0.0.src/cmake/modules/AddClang.cmake
|
||||||
|
+++ b/clang-14.0.0.src/cmake/modules/AddClang.cmake
|
||||||
|
@@ -106,12 +106,15 @@ macro(add_clang_library name)
|
||||||
|
|
||||||
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
|
||||||
|
get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries)
|
||||||
|
- install(TARGETS ${lib}
|
||||||
|
- COMPONENT ${lib}
|
||||||
|
- ${export_to_clangtargets}
|
||||||
|
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
+ if (ARG_SHARED OR ARG_MODULE)
|
||||||
|
+ install(TARGETS ${lib}
|
||||||
|
+ COMPONENT ${lib}
|
||||||
|
+ ${export_to_clangtargets}
|
||||||
|
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
+ set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${lib})
|
||||||
|
+ endif()
|
||||||
|
|
||||||
|
if (NOT LLVM_ENABLE_IDE)
|
||||||
|
add_llvm_install_targets(install-${lib}
|
||||||
|
@@ -121,7 +124,6 @@ macro(add_clang_library name)
|
||||||
|
|
||||||
|
set_property(GLOBAL APPEND PROPERTY CLANG_LIBS ${lib})
|
||||||
|
endif()
|
||||||
|
- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${lib})
|
||||||
|
else()
|
||||||
|
# Add empty "phony" target
|
||||||
|
add_custom_target(${lib})
|
||||||
|
Index: cmake/modules/AddLLVM.cmake
|
||||||
|
===================================================================
|
||||||
|
--- a/cmake/modules/AddLLVM.cmake
|
||||||
|
+++ b/cmake/modules/AddLLVM.cmake
|
||||||
|
@@ -730,11 +730,14 @@ macro(add_llvm_library name)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
|
||||||
|
- install(TARGETS ${name}
|
||||||
|
- ${export_to_llvmexports}
|
||||||
|
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
|
||||||
|
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
|
||||||
|
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
|
||||||
|
+ if(ARG_SHARED OR ARG_MODULE OR NOT LLVM_BUILD_LLVM_DYLIB)
|
||||||
|
+ install(TARGETS ${name}
|
||||||
|
+ ${export_to_llvmexports}
|
||||||
|
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
|
||||||
|
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
|
||||||
|
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
|
||||||
|
+ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||||
|
+ endif()
|
||||||
|
|
||||||
|
if (NOT LLVM_ENABLE_IDE)
|
||||||
|
add_llvm_install_targets(install-${name}
|
||||||
|
@@ -742,7 +745,6 @@ macro(add_llvm_library name)
|
||||||
|
COMPONENT ${name})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||||
|
endif()
|
||||||
|
if (ARG_MODULE)
|
||||||
|
set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
|
||||||
|
Index: lld-14.0.0.src/cmake/modules/AddLLD.cmake
|
||||||
|
===================================================================
|
||||||
|
--- a/lld-14.0.0.src/cmake/modules/AddLLD.cmake
|
||||||
|
+++ b/lld-14.0.0.src/cmake/modules/AddLLD.cmake
|
||||||
|
@@ -17,13 +17,6 @@ macro(add_lld_library name)
|
||||||
|
|
||||||
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||||
|
get_target_export_arg(${name} LLD export_to_lldtargets)
|
||||||
|
- install(TARGETS ${name}
|
||||||
|
- COMPONENT ${name}
|
||||||
|
- ${export_to_lldtargets}
|
||||||
|
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
-
|
||||||
|
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
add_llvm_install_targets(install-${name}
|
||||||
|
DEPENDS ${name}
|
||||||
|
Index: polly-14.0.0.src/cmake/polly_macros.cmake
|
||||||
|
===================================================================
|
||||||
|
--- a/polly-14.0.0.src/cmake/polly_macros.cmake
|
||||||
|
+++ b/polly-14.0.0.src/cmake/polly_macros.cmake
|
||||||
|
@@ -42,12 +42,14 @@ macro(add_polly_library name)
|
||||||
|
llvm_config(${name} ${LLVM_LINK_COMPONENTS})
|
||||||
|
endif( LLVM_LINK_COMPONENTS )
|
||||||
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly")
|
||||||
|
- install(TARGETS ${name}
|
||||||
|
- EXPORT LLVMExports
|
||||||
|
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
||||||
|
+ if (MODULE OR SHARED_LIBRARY OR NOT LLVM_BUILD_LLVM_DYLIB)
|
||||||
|
+ install(TARGETS ${name}
|
||||||
|
+ EXPORT LLVMExports
|
||||||
|
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
||||||
|
+ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||||
|
+ endif()
|
||||||
|
endif()
|
||||||
|
- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||||
|
endmacro(add_polly_library)
|
||||||
|
|
||||||
|
macro(add_polly_loadable_module name)
|
||||||
|
Index: polly-14.0.0.src/lib/CMakeLists.txt
|
||||||
|
===================================================================
|
||||||
|
--- a/polly-14.0.0.src/lib/CMakeLists.txt
|
||||||
|
+++ b/polly-14.0.0.src/lib/CMakeLists.txt
|
||||||
|
@@ -74,7 +74,7 @@ set_target_properties(PollyCore PROPERTI
|
||||||
|
# It depends on all library it needs, such that with
|
||||||
|
# LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
|
||||||
|
# well.
|
||||||
|
-target_link_libraries(Polly PUBLIC
|
||||||
|
+target_link_libraries(Polly PRIVATE
|
||||||
|
${ISL_TARGET}
|
||||||
|
)
|
||||||
|
|
||||||
|
@@ -143,7 +143,7 @@ else ()
|
||||||
|
# hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
|
||||||
|
# instead which will automatically resolve the additional dependencies by
|
||||||
|
# Polly.
|
||||||
|
- target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET})
|
||||||
|
+ target_link_libraries(LLVMPolly PRIVATE ${ISL_TARGET})
|
||||||
|
if (GPU_CODEGEN)
|
||||||
|
target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
|
||||||
|
endif ()
|
3
llvm-docs-14.0.0.src.tar.xz
Normal file
3
llvm-docs-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:8e9fcada110499d0c1bc7c12f79e9fc2cfa0989f520e6ae6afa808c4f01e2914
|
||||||
|
size 6601284
|
14
llvm-fix-find-gcc5-install.patch
Normal file
14
llvm-fix-find-gcc5-install.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Index: cfe-7.0.0rc1.src/lib/Driver/ToolChains/Gnu.cpp
|
||||||
|
===================================================================
|
||||||
|
--- cfe-7.0.0rc1.src.orig/lib/Driver/ToolChains/Gnu.cpp
|
||||||
|
+++ cfe-7.0.0rc1.src/lib/Driver/ToolChains/Gnu.cpp
|
||||||
|
@@ -1596,7 +1596,8 @@ Generic_GCC::GCCVersion Generic_GCC::GCC
|
||||||
|
MinorStr = MinorStr.slice(0, EndNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- if (MinorStr.getAsInteger(10, GoodVersion.Minor) || GoodVersion.Minor < 0)
|
||||||
|
+ if (!MinorStr.str().empty() &&
|
||||||
|
+ (MinorStr.getAsInteger(10, GoodVersion.Minor) || GoodVersion.Minor < 0))
|
||||||
|
return BadVersion;
|
||||||
|
GoodVersion.MinorStr = MinorStr.str();
|
||||||
|
|
78
llvm-normally-versioned-libllvm.patch
Normal file
78
llvm-normally-versioned-libllvm.patch
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
Before llvm4, both major and minor version updates of llvm were regularly
|
||||||
|
breaking API. Because of that, the libLLVM library was named in following
|
||||||
|
format: libLLVM-${major}-${minor}.so
|
||||||
|
|
||||||
|
(https://bugs.llvm.org/show_bug.cgi?id=25059)
|
||||||
|
(https://reviews.llvm.org/D13841)
|
||||||
|
|
||||||
|
The package containing this library was called libLLVM${major}_${minor} which
|
||||||
|
follows our guidelines.
|
||||||
|
|
||||||
|
Since llvm4, llvm decided to follow semantic versioning and only break API if
|
||||||
|
the major version was increased. In addition they do not intend to ever have
|
||||||
|
minor version other than 0.
|
||||||
|
(http://blog.llvm.org/2016/12/llvms-new-versioning-scheme.html)
|
||||||
|
|
||||||
|
The package was renamed to libLLVM${major}, which no longer follows the naming
|
||||||
|
guidelines, but since the package contained multiple libraries, it was not
|
||||||
|
detected.
|
||||||
|
|
||||||
|
Since bnc#1049703 the libLLVM${major} package contains only the
|
||||||
|
libLLVM-${major}-${minor}.so library and no others. This triggers the
|
||||||
|
shlib-policy-name-error check in our packaging system.
|
||||||
|
|
||||||
|
Because the reasons for using the libLLVM-${major}-${minor}.so format are no
|
||||||
|
longer valid, lets revert back to libLLVM.so.${major}.${minor}.${version}
|
||||||
|
format. That way the package name matches our guidelines.
|
||||||
|
|
||||||
|
Index: llvm-8.0.0rc3.src/tools/llvm-config/llvm-config.cpp
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/tools/llvm-config/llvm-config.cpp
|
||||||
|
+++ llvm-8.0.0rc3.src/tools/llvm-config/llvm-config.cpp
|
||||||
|
@@ -380,7 +380,6 @@ int main(int argc, char **argv) {
|
||||||
|
} else {
|
||||||
|
// default to the unix values:
|
||||||
|
SharedExt = "so";
|
||||||
|
- SharedVersionedExt = LLVM_DYLIB_VERSION ".so";
|
||||||
|
StaticExt = "a";
|
||||||
|
StaticDir = SharedDir = ActiveLibDir;
|
||||||
|
StaticPrefix = SharedPrefix = "lib";
|
||||||
|
@@ -393,7 +392,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
bool DyLibExists = false;
|
||||||
|
const std::string DyLibName =
|
||||||
|
- (SharedPrefix + "LLVM-" + SharedVersionedExt).str();
|
||||||
|
+ (SharedPrefix + "LLVM." + SharedExt).str();
|
||||||
|
|
||||||
|
// If LLVM_LINK_DYLIB is ON, the single shared library will be returned
|
||||||
|
// for "--libs", etc, if they exist. This behaviour can be overridden with
|
||||||
|
Index: llvm-8.0.0rc3.src/tools/llvm-shlib/CMakeLists.txt
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/tools/llvm-shlib/CMakeLists.txt
|
||||||
|
+++ llvm-8.0.0rc3.src/tools/llvm-shlib/CMakeLists.txt
|
||||||
|
@@ -42,7 +42,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||||
|
if (LLVM_LINK_LLVM_DYLIB)
|
||||||
|
set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
|
||||||
|
endif()
|
||||||
|
- add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
|
||||||
|
+ add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
|
||||||
|
|
||||||
|
list(REMOVE_DUPLICATES LIB_NAMES)
|
||||||
|
if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
|
||||||
|
Index: llvm-14.0.0rc2.src/test/lit.cfg.py
|
||||||
|
===================================================================
|
||||||
|
--- llvm-14.0.0rc2.src.orig/test/lit.cfg.py
|
||||||
|
+++ llvm-14.0.0rc2.src/test/lit.cfg.py
|
||||||
|
@@ -244,9 +244,9 @@ if config.link_llvm_dylib:
|
||||||
|
config.available_features.add('llvm-dylib')
|
||||||
|
config.substitutions.append(
|
||||||
|
('%llvmdylib',
|
||||||
|
- '{}/libLLVM-{}{}'.format(config.llvm_shlib_dir,
|
||||||
|
- config.llvm_dylib_version,
|
||||||
|
- config.llvm_shlib_ext)))
|
||||||
|
+ '{}/libLLVM{}.{}'.format(config.llvm_shlib_dir,
|
||||||
|
+ config.llvm_shlib_ext,
|
||||||
|
+ config.llvm_dylib_version)))
|
||||||
|
|
||||||
|
if config.have_tf_aot:
|
||||||
|
config.available_features.add("have_tf_aot")
|
21
llvm-remove-clang-only-flags.patch
Normal file
21
llvm-remove-clang-only-flags.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
Index: llvm-8.0.0rc3.src/cmake/modules/HandleLLVMOptions.cmake
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/cmake/modules/HandleLLVMOptions.cmake
|
||||||
|
+++ llvm-8.0.0rc3.src/cmake/modules/HandleLLVMOptions.cmake
|
||||||
|
@@ -413,8 +413,6 @@ if( MSVC )
|
||||||
|
|
||||||
|
# Specific default warnings-as-errors for compilers accepting GCC-compatible warning flags:
|
||||||
|
if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
|
||||||
|
- add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
|
||||||
|
- add_flag_if_supported("-Werror=unguarded-availability-new" WERROR_UNGUARDED_AVAILABILITY_NEW)
|
||||||
|
endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
|
||||||
|
|
||||||
|
# Modules enablement for GCC-compatible compilers:
|
||||||
|
@@ -586,7 +584,6 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPI
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_flag_if_supported("-Wimplicit-fallthrough" IMPLICIT_FALLTHROUGH_FLAG)
|
||||||
|
- add_flag_if_supported("-Wcovered-switch-default" COVERED_SWITCH_DEFAULT_FLAG)
|
||||||
|
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
|
||||||
|
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
|
||||||
|
|
15
llvm14-rpmlintrc
Normal file
15
llvm14-rpmlintrc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# This line is mandatory to access the configuration functions
|
||||||
|
from Config import *
|
||||||
|
|
||||||
|
addFilter("devel-file-in-non-devel-package .*/clang/.*/include/.*")
|
||||||
|
addFilter("devel-file-in-non-devel-package .*/clang/.*/lib/.*")
|
||||||
|
addFilter("devel-file-in-non-devel-package .*/usr/include/.*")
|
||||||
|
|
||||||
|
addFilter("devel-file-in-non-devel-package .*/lib.*/*.a")
|
||||||
|
addFilter("devel-file-in-non-devel-package .*/lib.*/*.so")
|
||||||
|
|
||||||
|
# We're deliberately conflicting with SLE. (https://code.opensuse.org/leap/features/issue/55)
|
||||||
|
addFilter("SUSE_Backports_policy-SLE_conflict")
|
||||||
|
|
||||||
|
# Archive seems to be deliberately empty on some architectures.
|
||||||
|
addFilter("lto-no-text-in-archive .*/lib.*/clang/.*/lib/linux/libclang_rt.asan_static-.*.a")
|
2520
llvm14.changes
Normal file
2520
llvm14.changes
Normal file
File diff suppressed because it is too large
Load Diff
2078
llvm14.spec
Normal file
2078
llvm14.spec
Normal file
File diff suppressed because it is too large
Load Diff
57
llvm_build_tablegen_component_as_shared_library.patch
Normal file
57
llvm_build_tablegen_component_as_shared_library.patch
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
The LLVMTableGen component is a special case that is excluded from libLLVM and
|
||||||
|
normally is only built as static library and linked into llvm-tblgen.
|
||||||
|
|
||||||
|
We need to have it as a shared library to be available for other projects such
|
||||||
|
as ldc.
|
||||||
|
|
||||||
|
This patch makes it even more special and forces it to be build and installed
|
||||||
|
as separate shared library.
|
||||||
|
|
||||||
|
Index: llvm-8.0.0rc3.src/cmake/modules/AddLLVM.cmake
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/cmake/modules/AddLLVM.cmake
|
||||||
|
+++ llvm-8.0.0rc3.src/cmake/modules/AddLLVM.cmake
|
||||||
|
@@ -541,7 +541,7 @@ function(llvm_add_library name)
|
||||||
|
if(ARG_MODULE AND LLVM_EXPORT_SYMBOLS_FOR_PLUGINS AND ARG_PLUGIN_TOOL AND (WIN32 OR CYGWIN))
|
||||||
|
# On DLL platforms symbols are imported from the tool by linking against it.
|
||||||
|
set(llvm_libs ${ARG_PLUGIN_TOOL})
|
||||||
|
- elseif (NOT ARG_COMPONENT_LIB)
|
||||||
|
+ elseif (NOT ARG_COMPONENT_LIB OR (${name} STREQUAL "LLVMTableGen" AND LLVM_BUILD_LLVM_DYLIB))
|
||||||
|
if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
|
||||||
|
set(llvm_libs LLVM)
|
||||||
|
else()
|
||||||
|
Index: llvm-8.0.0rc3.src/cmake/modules/TableGen.cmake
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/cmake/modules/TableGen.cmake
|
||||||
|
+++ llvm-8.0.0rc3.src/cmake/modules/TableGen.cmake
|
||||||
|
@@ -115,7 +115,8 @@ macro(add_tablegen target project)
|
||||||
|
set(LLVM_ENABLE_OBJLIB ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
- add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
|
||||||
|
+ add_llvm_executable(${target} ${ARGN})
|
||||||
|
+ target_link_libraries(${target} PRIVATE LLVMTableGen)
|
||||||
|
set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS})
|
||||||
|
|
||||||
|
set(${project}_TABLEGEN "${target}" CACHE
|
||||||
|
Index: llvm-8.0.0rc3.src/lib/TableGen/CMakeLists.txt
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/lib/TableGen/CMakeLists.txt
|
||||||
|
+++ llvm-8.0.0rc3.src/lib/TableGen/CMakeLists.txt
|
||||||
|
@@ -1,3 +1,7 @@
|
||||||
|
+if (LLVM_BUILD_LLVM_DYLIB)
|
||||||
|
+ set(MAYBE_SHARED SHARED)
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
add_llvm_component_library(LLVMTableGen
|
||||||
|
DetailedRecordsBackend.cpp
|
||||||
|
Error.cpp
|
||||||
|
@@ -9,6 +13,8 @@ add_llvm_library(LLVMTableGen
|
||||||
|
TGLexer.cpp
|
||||||
|
TGParser.cpp
|
||||||
|
|
||||||
|
+ ${MAYBE_SHARED}
|
||||||
|
+
|
||||||
|
ADDITIONAL_HEADER_DIRS
|
||||||
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/TableGen
|
||||||
|
|
28
lto-disable-cache.patch
Normal file
28
lto-disable-cache.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||||
|
index 5e57a3b8234..23f9ed5fb56 100644
|
||||||
|
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||||
|
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||||
|
@@ -889,23 +889,6 @@ if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
|
||||||
|
if(NOT LINKER_IS_LLD_LINK)
|
||||||
|
append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
|
||||||
|
endif()
|
||||||
|
- # If the linker supports it, enable the lto cache. This improves initial build
|
||||||
|
- # time a little since we re-link a lot of the same objects, and significantly
|
||||||
|
- # improves incremental build time.
|
||||||
|
- # FIXME: We should move all this logic into the clang driver.
|
||||||
|
- if(APPLE)
|
||||||
|
- append("-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
|
||||||
|
- CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
|
||||||
|
- elseif((UNIX OR MINGW) AND LLVM_USE_LINKER STREQUAL "lld")
|
||||||
|
- append("-Wl,--thinlto-cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
|
||||||
|
- CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
|
||||||
|
- elseif(LLVM_USE_LINKER STREQUAL "gold")
|
||||||
|
- append("-Wl,--plugin-opt,cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
|
||||||
|
- CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
|
||||||
|
- elseif(LINKER_IS_LLD_LINK)
|
||||||
|
- append("/lldltocache:${PROJECT_BINARY_DIR}/lto.cache"
|
||||||
|
- CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
|
||||||
|
- endif()
|
||||||
|
elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
|
||||||
|
append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
|
||||||
|
if(NOT LINKER_IS_LLD_LINK)
|
3
openmp-14.0.0.src.tar.xz
Normal file
3
openmp-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:28a1cbdd3dfdd331e4ed2dda2b4477fc418e455c883bd0d1d6acc331118e4688
|
||||||
|
size 1205564
|
14
opt-viewer-Find-style-css-in-usr-share.patch
Normal file
14
opt-viewer-Find-style-css-in-usr-share.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Index: llvm-7.0.0.src/tools/opt-viewer/opt-viewer.py
|
||||||
|
===================================================================
|
||||||
|
--- llvm-7.0.0.src.orig/tools/opt-viewer/opt-viewer.py
|
||||||
|
+++ llvm-7.0.0.src/tools/opt-viewer/opt-viewer.py
|
||||||
|
@@ -252,8 +252,7 @@ def generate_report(all_remarks,
|
||||||
|
sorted_remarks = sorted(optrecord.itervalues(all_remarks), key=lambda r: (r.File, r.Line, r.Column, r.PassWithDiffPrefix, r.yaml_tag, r.Function))
|
||||||
|
IndexRenderer(output_dir, should_display_hotness, max_hottest_remarks_on_index).render(sorted_remarks)
|
||||||
|
|
||||||
|
- shutil.copy(os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||||
|
- "style.css"), output_dir)
|
||||||
|
+ shutil.copy("/usr/share/opt-viewer/style.css", output_dir)
|
||||||
|
|
||||||
|
_render_file_bound = functools.partial(_render_file, source_dir, output_dir, context, no_highlight)
|
||||||
|
if should_print_progress:
|
3
polly-14.0.0.src.tar.xz
Normal file
3
polly-14.0.0.src.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:5a486acc8d5baadb2358fc03d1220773dc8d5283f4c864eaca9c5afd8ee2fe0e
|
||||||
|
size 9362224
|
30
tests-use-python3.patch
Normal file
30
tests-use-python3.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
Index: llvm-8.0.0rc3.src/test/BugPoint/compile-custom.ll.py
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/test/BugPoint/compile-custom.ll.py
|
||||||
|
+++ llvm-8.0.0rc3.src/test/BugPoint/compile-custom.ll.py
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/usr/bin/env python
|
||||||
|
+#!/usr/bin/python3
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
Index: llvm-8.0.0rc3.src/test/Other/opt-bisect-helper.py
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/test/Other/opt-bisect-helper.py
|
||||||
|
+++ llvm-8.0.0rc3.src/test/Other/opt-bisect-helper.py
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/usr/bin/env python
|
||||||
|
+#!/usr/bin/python3
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
Index: llvm-8.0.0rc3.src/test/TableGen/JSON-check.py
|
||||||
|
===================================================================
|
||||||
|
--- llvm-8.0.0rc3.src.orig/test/TableGen/JSON-check.py
|
||||||
|
+++ llvm-8.0.0rc3.src/test/TableGen/JSON-check.py
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/usr/bin/env python
|
||||||
|
+#!/usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import subprocess
|
Loading…
Reference in New Issue
Block a user