Skip to content

Commit

Permalink
Update LLVM to version 14.0.6 (#8201)
Browse files Browse the repository at this point in the history
* Update llvm to 14.0.6

* set gcc-toolchain for llvm compiler definition

* applu llvmlite patch for llvm14

* update py3-dxr.spec patched for llvm14

* use latest llvmlite commit

* update rust 1.61.0 and cleanup llvmlite patches

* rust patch
  • Loading branch information
smuzaffar authored Nov 30, 2022
1 parent 2e174f0 commit 9843d18
Show file tree
Hide file tree
Showing 12 changed files with 3,178 additions and 50 deletions.
10 changes: 5 additions & 5 deletions llvm.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external llvm 12.0.1
### RPM external llvm 14.0.6
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64
## INITENV +PATH PYTHON3PATH %{i}/lib64/python%{cms_python3_major_minor_version}/site-packages

Expand All @@ -7,10 +7,10 @@ Requires: gcc zlib python3
Requires: cuda
AutoReq: no

%define llvmCommit 9f4ab770e61b68d2037cc7cda1f868a8ba52da85
%define llvmBranch cms/release/12.x/fed4134
%define iwyuCommit 5db414ac448004fe019871c977905cb7c2cff23f
%define iwyuBranch clang_11
%define llvmCommit d88fe2a1cafb6621210a7a0ae968c1e8e797d2bb
%define llvmBranch cms/release/14.x/f28c006
%define iwyuCommit d888efc52646dcf3e4e3a56af13aa23dd26abde0
%define iwyuBranch master

Source0: git+https://github.com/cms-externals/llvm-project.git?obj=%{llvmBranch}/%{llvmCommit}&export=llvm-%{realversion}-%{llvmCommit}&module=llvm-%{realversion}-%{llvmCommit}&output=/llvm-%{realversion}-%{llvmCommit}.tgz
Source1: git+https://github.com/include-what-you-use/include-what-you-use.git?obj=%{iwyuBranch}/%{iwyuCommit}&export=iwyu-%{realversion}-%{iwyuCommit}&module=iwyu-%{realversion}-%{iwyuCommit}&output=/iwyu-%{realversion}-%{iwyuCommit}.tgz
Expand Down
6 changes: 2 additions & 4 deletions pip/llvmlite.file
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Requires: llvm
Patch0: py3-llvmlite-fpic-flag
Patch1: py3-llvmlite-version
Patch3: py3-llvmlite-removeMethod
Patch0: py3-llvmlite-14

%define source0 git+https://github.com/numba/llvmlite?obj=release0.35/v%{realversion}&export=llvmlite-%{realversion}&output=/source.tar.gz
%define source0 git+https://github.com/numba/llvmlite?obj=main/%{realversion}&export=llvmlite-%{realversion}&output=/source.tar.gz
%define PipPreBuild export LLVM_CONFIG=${LLVM_ROOT}/bin/llvm-config
2 changes: 1 addition & 1 deletion pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ kiwisolver==1.4.4
law==0.1.7
lazy-object-proxy==1.7.1
lizard==1.17.10
llvmlite==0.38.1
llvmlite==778380378bb856b10d4d77f45aa9386f8de4d940
lockfile==0.12.2
luigi==3.1.1
lxml==4.9.1
Expand Down
2 changes: 1 addition & 1 deletion py3-dxr.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## INITENV +PATH PYTHON3PATH %i/${PYTHON3_LIB_SITE_PACKAGES}
Requires: zlib llvm sqlite
Requires: py3-Jinja2 py3-parsimonious py3-pysqlite3 py3-Pygments
%define dxrCommit de41946bc5601d100efb44780f11db71dafaeb1e
%define dxrCommit e79425eded8ca0ae882b4ccceaf27ae1aab446d3
%define branch cms/6ea764102a/py3

Source0: git+https://github.com/cms-externals/dxr.git?obj=%{branch}/%{dxrCommit}&export=dxr-%{dxrCommit}&module=dxr-%dxrCommit&output=/dxr-%{dxrCommit}.tgz
Expand Down
3,129 changes: 3,129 additions & 0 deletions py3-llvmlite-14.patch

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions py3-llvmlite-fpic-flag.patch

This file was deleted.

12 changes: 0 additions & 12 deletions py3-llvmlite-removeMethod.patch

This file was deleted.

13 changes: 0 additions & 13 deletions py3-llvmlite-version.patch

This file was deleted.

35 changes: 35 additions & 0 deletions rust-libstdc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index ac758c1..11abfac 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -347,18 +347,18 @@ fn main() {

// C++ runtime library
if !target.contains("msvc") {
- if let Some(s) = llvm_static_stdcpp {
- assert!(!cxxflags.contains("stdlib=libc++"));
- let path = PathBuf::from(s);
- println!("cargo:rustc-link-search=native={}", path.parent().unwrap().display());
- if target.contains("windows") {
- println!("cargo:rustc-link-lib=static:-bundle={}", stdcppname);
- } else {
- println!("cargo:rustc-link-lib=static={}", stdcppname);
- }
- } else if cxxflags.contains("stdlib=libc++") {
- println!("cargo:rustc-link-lib=c++");
- } else {
+ if let Some(_s) = llvm_static_stdcpp {
+ // assert!(!cxxflags.contains("stdlib=libc++"));
+ // let path = PathBuf::from(s);
+ // println!("cargo:rustc-link-search=native={}", path.parent().unwrap().display());
+ // if target.contains("windows") {
+ // println!("cargo:rustc-link-lib=static:-bundle={}", stdcppname);
+ // } else {
+ // println!("cargo:rustc-link-lib=static={}", stdcppname);
+ // }
+ //} else if cxxflags.contains("stdlib=libc++") {
+ // println!("cargo:rustc-link-lib=c++");
+ //} else {
println!("cargo:rustc-link-lib={}", stdcppname);
}
}
4 changes: 3 additions & 1 deletion rust.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external rust 1.57.0
### RPM external rust 1.61.0
%ifarch ppc64le
%define build_arch powerpc64le-unknown-linux-gnu
%else
Expand All @@ -8,11 +8,13 @@
%define branch master
%define tag %{realversion}
Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Patch0: rust-libstdc
BuildRequires: python3
Requires: llvm

%prep
%setup -n %{n}-%{realversion}
%patch0 -p1

%build
cat << EOF > config.toml
Expand Down
1 change: 1 addition & 0 deletions scram-tools.file/tools/llvm/llvm-ccompiler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<environment name="LLVM_CCOMPILER_BASE" default="@TOOL_ROOT@"/>
<environment name="CC" value="$LLVM_CCOMPILER_BASE/bin/clang"/>
</client>
<flags CFLAGS="--gcc-toolchain=@GCC_ROOT@"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/llvm/llvm-cxxcompiler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<flags CXXFLAGS="-Wno-error=potentially-evaluated-expression"/>
<flags CXXFLAGS="-Wno-tautological-type-limit-compare"/>
<flags CXXFLAGS="-fsized-deallocation"/>
<flags CXXFLAGS="--gcc-toolchain=@GCC_ROOT@"/>
<runtime name="@OS_RUNTIME_LDPATH_NAME@" value="$LLVM_CXXCOMPILER_BASE/lib64" type="path"/>
<runtime name="PATH" value="$LLVM_CXXCOMPILER_BASE/bin" type="path"/>
</tool>

0 comments on commit 9843d18

Please sign in to comment.