diff --git a/.gitignore b/.gitignore index d368b74..5db6633 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/llvm-14.0.6.src.tar.xz -SOURCES/tstellar-gpg-key.asc +SOURCES/cmake-15.0.0.src.tar.xz +SOURCES/llvm-15.0.0.src.tar.xz +SOURCES/release-keys.asc diff --git a/.llvm.metadata b/.llvm.metadata index 0c6a26d..55780a6 100644 --- a/.llvm.metadata +++ b/.llvm.metadata @@ -1,2 +1,3 @@ -975020d4f7164d84a89f0f9b2153dd870d06e02d SOURCES/llvm-14.0.6.src.tar.xz -b8d2648a01d36ed0186fd2c5af325fd28797f9a0 SOURCES/tstellar-gpg-key.asc +56ca883308b1b30cb981c86038eb677db9cc8eb5 SOURCES/cmake-15.0.0.src.tar.xz +6f7f53d45ae8d207a6d72fd8ac380160f240d37e SOURCES/llvm-15.0.0.src.tar.xz +347bdd5ee6d6b93c9644c268511815912c0fb2dc SOURCES/release-keys.asc diff --git a/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch b/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch index 4c4a9cf..0f4acd3 100644 --- a/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch +++ b/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch @@ -1,6 +1,6 @@ -From 9320ffeda3915c8f7be744c983a3470a89107bd7 Mon Sep 17 00:00:00 2001 +From 01529ba2c76be37e41713cf7f3eca8b61833e320 Mon Sep 17 00:00:00 2001 From: Tom Stellard -Date: Tue, 14 Sep 2021 20:21:20 -0700 +Date: Tue, 9 Nov 2021 15:05:07 +0100 Subject: [PATCH] XFAIL missing-abstract-variable.ll test on ppc64le It's seems the strategy with this test is to XFAIL it on all @@ -16,18 +16,18 @@ Differential Revision: https://reviews.llvm.org/D109806 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll -index bd0de60268b6..cc5d56b0c512 100644 +index 8f8d404..07a8778 100644 --- a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll +++ b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll @@ -4,7 +4,7 @@ ; powerpc64 (and on x86_64 at at least -O2). Presumably this is a SelectionDAG ; issue. ; FIXME: arm64 is an alias for aarch64 on macs, apparently? --; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv -+; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv, ppc64le +-; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv, sparc ++; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv, sparc, ppc64le ; Build from the following source with clang -O2. -- -2.31.1 +1.8.3.1 diff --git a/SOURCES/cmake-15.0.0.src.tar.xz.sig b/SOURCES/cmake-15.0.0.src.tar.xz.sig new file mode 100644 index 0000000..a7d4549 Binary files /dev/null and b/SOURCES/cmake-15.0.0.src.tar.xz.sig differ diff --git a/SOURCES/llvm-14.0.6.src.tar.xz.sig b/SOURCES/llvm-14.0.6.src.tar.xz.sig deleted file mode 100644 index 5629b21..0000000 Binary files a/SOURCES/llvm-14.0.6.src.tar.xz.sig and /dev/null differ diff --git a/SOURCES/llvm-15.0.0.src.tar.xz.sig b/SOURCES/llvm-15.0.0.src.tar.xz.sig new file mode 100644 index 0000000..2a06f04 Binary files /dev/null and b/SOURCES/llvm-15.0.0.src.tar.xz.sig differ diff --git a/SPECS/llvm.spec b/SPECS/llvm.spec index c7f55b4..c1de18c 100644 --- a/SPECS/llvm.spec +++ b/SPECS/llvm.spec @@ -13,16 +13,12 @@ %bcond_with compat_build %bcond_without check -%global llvm_libdir %{_libdir}/%{name} -%global build_llvm_libdir %{buildroot}%{llvm_libdir} -#global rc_ver 4 -%global maj_ver 14 +#global rc_ver 3 +%global maj_ver 15 %global min_ver 0 -%global patch_ver 6 -%if !%{maj_ver} && 0%{?rc_ver} -%global abi_revision 2 -%endif +%global patch_ver 0 %global llvm_srcdir llvm-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src +%global cmake_srcdir cmake-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src %if %{with compat_build} %global pkg_name llvm%{maj_ver} @@ -44,54 +40,64 @@ %global exec_suffix %{nil} %endif -%if 0%{?rhel} -%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly" -%global experimental_targets_to_build "" -%global _smp_mflags -j8 -%else -%global targets_to_build "all" -%global experimental_targets_to_build "AVR" -%endif - %global build_install_prefix %{buildroot}%{install_prefix} # Lower memory usage of dwz on s390x %global _dwz_low_mem_die_limit_s390x 1 %global _dwz_max_die_limit_s390x 1000000 -%ifarch %{arm} -# koji overrides the _gnu variable to be gnu, which is not correct for clang, so -# we need to hard-code the correct triple here. -%global llvm_triple armv7l-redhat-linux-gnueabihf -%else +# https://fedoraproject.org/wiki/Changes/PythonSafePath#Opting_out +# Don't add -P to Python shebangs +# The executable Python scripts in /usr/share/opt-viewer/ import each other +%undefine _py3_shebang_P + %global llvm_triple %{_host} -%endif +################################################################################ +# OS Specific Configuration +################################################################################ + +######## +# RHEL # +######## +%if 0%{?rhel} +%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly" +%global experimental_targets_to_build "" +%global _smp_mflags -j8 -%if !0%{?rhel} # libedit-devel is a buildroot-only package in RHEL8, so we can't have a # any run-time depencies on it. -%global use_libedit 1 +%global use_libedit 0 + +%else +########## +# FEDORA # +########## +%global targets_to_build "all" +%global experimental_targets_to_build "AVR" %endif +################################################################################ +# Spec File +################################################################################ + Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Low Level Virtual Machine License: NCSA URL: http://llvm.org Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig -Source2: tstellar-gpg-key.asc +Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig +Source4: release-keys.asc %if %{without compat_build} -Source3: run-lit-tests -Source4: lit.fedora.cfg.py +Source5: run-lit-tests +Source6: lit.fedora.cfg.py %endif -%if 0%{?abi_revision} -Patch0: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch -%endif Patch2: 0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch # RHEL-specific patches. @@ -107,7 +113,6 @@ BuildRequires: libffi-devel BuildRequires: ncurses-devel BuildRequires: python3-psutil BuildRequires: python3-sphinx -BuildRequires: pandoc BuildRequires: multilib-rpm-config %if %{with gold} BuildRequires: binutils-devel @@ -120,7 +125,14 @@ BuildRequires: valgrind-devel # LLVM's LineEditor library will use libedit if it is available. BuildRequires: libedit-devel %endif -# We need python3-devel for pathfix.py. +# Need pandoc to cover markdown to rst, because RHEL does not have recommonmark, +# so we can't build the documentation as is. +%if 0%{?rhel} +BuildRequires: pandoc +%else +BuildRequires: python3-recommonmark +%endif +# We need python3-devel for pathfix.py and %%py3_shebang_fix. BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -211,8 +223,28 @@ LLVM's modified googletest sources. %endif +%if 0%{?rhel} +%package toolset +Summary: Package that installs llvm-toolset +Requires: clang = %{version} + +Requires: llvm = %{version} +%ifnarch s390x +Requires: lld = %{version} +%endif + +%description toolset +This is the main package for llvm-toolset +%endif + %prep -%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE2}' +%setup -T -q -b 2 -n %{cmake_srcdir} +# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir}, +# but this is not a CACHED variable, so we can't actually set it externally :( +cd .. +mv %{cmake_srcdir} cmake %autosetup -n %{llvm_srcdir} -p2 %py3_shebang_fix \ @@ -220,15 +252,14 @@ LLVM's modified googletest sources. tools/opt-viewer/*.py \ utils/update_cc_test_checks.py +%if 0%{?rhel} # Convert markdown files to rst to cope with the absence of compatible md parser in rhel. # The sed expression takes care of a slight difference between pandoc markdown and sphinx markdown. find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pandoc -f markdown -o ${md%.md}.rst ; done +%endif %build -mkdir -p %{_vpath_builddir} -cd %{_vpath_builddir} - %ifarch s390 s390x # Fails with "exceeded PCRE's backtracking limit" %global _lto_cflags %nil @@ -236,8 +267,9 @@ cd %{_vpath_builddir} %global _lto_cflags -flto=thin %endif -%ifarch s390 s390x %{arm} %ix86 +%ifarch s390 s390x %{arm} %ix86 ppc64le # Decrease debuginfo verbosity to reduce memory consumption during final library linking +# On ppc64le, this is done to reduce disk usage. %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif @@ -246,7 +278,7 @@ cd %{_vpath_builddir} export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5" # force off shared libs as cmake macros turns it on. -%cmake .. -G Ninja \ +%cmake -G Ninja -S . -B %{_vpath_builddir} \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_PARALLEL_LINK_JOBS=1 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ @@ -307,7 +339,6 @@ export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5" -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \ -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \ - %{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \ \ -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \ @@ -319,8 +350,8 @@ export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5" # Build libLLVM.so first. This ensures that when libLLVM.so is linking, there # are no other compile jobs running. This will help reduce OOM errors on the # builders without having to artificially limit the number of concurrent jobs. -%ninja_build LLVM -%ninja_build +%ninja_build -C %{_vpath_builddir} LLVM +%ninja_build -C %{_vpath_builddir} %install %ninja_install -C %{_vpath_builddir} @@ -355,9 +386,6 @@ rm -rf test/tools/UpdateTestChecks install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir} %global install_srcdir %{buildroot}%{_datadir}/llvm/src -%global lit_cfg test/%{_arch}.site.cfg.py -%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py -%global lit_fedora_cfg %{_datadir}/llvm/lit.fedora.cfg.py # Install gtest sources so clang can use them for gtest install -d %{install_srcdir} @@ -371,7 +399,7 @@ cp -R utils/UpdateTestChecks %{install_srcdir}/utils/ %if %{with gold} # Add symlink to lto plugin in the binutils plugin directory. %{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/ -ln -s %{_libdir}/LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/ +ln -s -t %{buildroot}%{_libdir}/bfd-plugins/ ../LLVMgold.so %endif %else @@ -507,7 +535,7 @@ fi %{_libdir}/bfd-plugins/LLVMgold.so %endif %{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so -%{_libdir}/libLLVM-%{maj_ver}.so%{?abi_revision:.%{abi_revision}} +%{_libdir}/libLLVM-%{maj_ver}.so %{_libdir}/libLTO.so* %else %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf @@ -575,7 +603,17 @@ fi %endif +%if 0%{?rhel} +%files toolset +%endif + %changelog +* Mon Oct 31 2022 Tom Stellard - 15.0.0-2 +- Re-enable debuginfo for ppc64le + +* Tue Sep 06 2022 Nikita Popov - 15.0.0-1 +- Update to LLVM 15.0.0 + * Mon Jun 27 2022 Tom Stellard - 14.0.6-1 - 14.0.6 Release