From ab194f104bc36cf9227e70517e212c757b05c658 Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Thu, 12 Oct 2023 11:15:14 +0200 Subject: [PATCH] merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree --- .copr/Makefile | 6 +- .copr/snapshot-info.sh | 76 ++ .gitignore | 5 + ...-funwind-tables-the-default-on-all-a.patch | 27 + 0001-Produce-DWARF4-by-default.patch | 113 +++ ...p-implicit-rpath-disabled-by-default.patch | 108 +++ 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch | 30 + ...a-Make-test-dependency-on-LLVMHello-.patch | 84 ++ ...ed-libraries-to-customize-the-soname.patch | 39 + ...clang-Don-t-install-static-libraries.patch | 25 + 0009-disable-myst-parser.patch | 26 + 0101-Deactivate-markdown-doc.patch | 13 +- DistributionFedora-stage2.cmake | 33 + DistributionFedora.cmake | 55 ++ Makefile | 96 +++ build.spec.inc | 213 +++++ changelog.spec.inc | 754 ++++++++++++++++++ check.spec.inc | 205 +++++ files.spec.inc | 295 +++++++ globals.spec.inc | 136 ++++ install.spec.inc | 226 ++++++ llvm.rpmlintrc | 31 + llvm.spec | 35 +- macros.clang | 11 + packages.spec.inc | 296 +++++++ patches.spec.inc | 32 + post_devel.spec.inc | 4 + postun_devel.spec.inc | 6 + prep.spec.inc | 50 ++ sources.spec.inc | 27 + version.spec.inc | 16 + 31 files changed, 3045 insertions(+), 28 deletions(-) create mode 100755 .copr/snapshot-info.sh create mode 100644 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch create mode 100644 0001-Produce-DWARF4-by-default.patch create mode 100644 0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch create mode 100644 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch create mode 100644 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch create mode 100644 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch create mode 100644 0003-PATCH-clang-Don-t-install-static-libraries.patch create mode 100644 0009-disable-myst-parser.patch create mode 100644 DistributionFedora-stage2.cmake create mode 100644 DistributionFedora.cmake create mode 100644 Makefile create mode 100644 build.spec.inc create mode 100644 changelog.spec.inc create mode 100644 check.spec.inc create mode 100644 files.spec.inc create mode 100644 globals.spec.inc create mode 100644 install.spec.inc create mode 100644 macros.clang create mode 100644 packages.spec.inc create mode 100644 patches.spec.inc create mode 100644 post_devel.spec.inc create mode 100644 postun_devel.spec.inc create mode 100644 prep.spec.inc create mode 100644 sources.spec.inc create mode 100644 version.spec.inc diff --git a/.copr/Makefile b/.copr/Makefile index 753982b..230f2d7 100644 --- a/.copr/Makefile +++ b/.copr/Makefile @@ -4,12 +4,12 @@ COPR_USERNAME=$(shell rpm --eval %copr_username) COPR_PROJECT=$(shell rpm --eval %copr_projectname) +YYYYMMDD=$(shell date +%Y%m%d) .PHONY: srpm srpm: - dnf install -y dnf-plugins-core fedora-packager - dnf copr enable -y --setopt=reposdir=/tmp/yum.repos.d $(COPR_USERNAME)/$(COPR_PROJECT) - dnf install -y --setopt=reposdir=/tmp/yum.repos.d llvm-snapshot-builder + dnf install -y git tar xz curl --setopt=install_weak_deps=False + YYYYMMDD=$(YYYYMMDD) ./.copr/snapshot-info.sh > version.spec.inc rpmbuild \ --define "_srcrpmdir $(outdir)" \ --define "_sourcedir $(shell pwd)" \ diff --git a/.copr/snapshot-info.sh b/.copr/snapshot-info.sh new file mode 100755 index 0000000..2d95354 --- /dev/null +++ b/.copr/snapshot-info.sh @@ -0,0 +1,76 @@ +#!/usr/bin/bash + +# You need these packages to run this script: git tar xz curl-minimal + +set -e +set +x + +# This is important for systems that have a different local but want to produce +# a valid changelog date. +LANG=en_EN + +function loginfo() { + local msg=$1 + >&2 echo "[INFO]" $msg +} + +loginfo "Determine date in YYYYMMDD form" +llvm_snapshot_yyyymmdd=$(date +%Y%m%d) +[[ ! -z "${YYYYMMDD}" ]] && llvm_snapshot_yyyymmdd=$YYYYMMDD + +loginfo "Get the source tarball" +tarball_url=https://github.com/kwk/llvm-daily-fedora-rpms/releases/download/source-snapshot/llvm-project-${llvm_snapshot_yyyymmdd}.src.tar.xz +tarball=llvm-project-${llvm_snapshot_yyyymmdd}.src.tar.xz +if [ -e $tarball ]; then + loginfo "Source tarball already exists: $tarball" +else + loginfo "Downloading source tarball $tarball from $tarball_url" + curl -sL -o $tarball ${tarball_url} +fi + +loginfo "Grab git revision from tarball" +llvm_snapshot_git_revision=$(xzcat $tarball | git get-tar-commit-id) +llvm_snapshot_git_revision_short=$(echo "${llvm_snapshot_git_revision:0:14}") + +versionfile=llvm-project*.src/cmake/Modules/LLVMVersion.cmake +loginfo "Extract the ${versionfile} file from the source tarball" +if [ -e $versionfile ]; then + loginfo "CMakeLists.txt already exists: ${versionfile}" +else + tar -xf $tarball $versionfile +fi + +loginfo "Parse ${versionfile} for the LLVM version" +llvm_snapshot_version=$(grep -ioP 'set\(\s*LLVM_VERSION_(MAJOR|MINOR|PATCH)\s\K[0-9]+' ${versionfile} | paste -sd '.') +llvm_snapshot_version_major=$(echo $llvm_snapshot_version | cut -f1 -d.) +llvm_snapshot_version_minor=$(echo $llvm_snapshot_version | cut -f2 -d.) +llvm_snapshot_version_patch=$(echo $llvm_snapshot_version | cut -f3 -d.) +llvm_snapshot_version_suffix=pre${llvm_snapshot_yyyymmdd}.g${llvm_snapshot_git_revision_short} +llvm_snapshot_version_tag=${llvm_snapshot_version}~${llvm_snapshot_version_suffix} +llvm_snapshot_changelog_entry="* $(date +'%a %b %d %Y') LLVM snapshot - ${llvm_snapshot_version_tag}" + +tempfile=$(mktemp) +cat > $tempfile <&2 + +# One to redirect it away +cat $tempfile diff --git a/.gitignore b/.gitignore index d4e7b84..78c2c60 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ /llvm-*.src/ /results_llvm/ /third-party/ +/llvm-git-revision-*.txt +/llvm-release-*.txt +/BUILD +/BUILDROOT +/out diff --git a/0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch b/0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch new file mode 100644 index 0000000..113f2a7 --- /dev/null +++ b/0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch @@ -0,0 +1,27 @@ +From 49f827b09db549de62dcaf8b90b3fcb3e08c0ee5 Mon Sep 17 00:00:00 2001 +From: Serge Guelton +Date: Mon, 6 Mar 2023 12:37:48 +0100 +Subject: [PATCH] Make -funwind-tables the default on all archs + +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 24fbdcffc07b..8fed46b49515 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2904,6 +2904,10 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const { + case llvm::Triple::riscv64: + case llvm::Triple::x86: + case llvm::Triple::x86_64: ++ // Enable -funwind-tables on all architectures supported by Fedora: ++ // rhbz#1655546 ++ case llvm::Triple::systemz: ++ case llvm::Triple::arm: + return UnwindTableLevel::Asynchronous; + default: + return UnwindTableLevel::None; +-- +2.39.1 + diff --git a/0001-Produce-DWARF4-by-default.patch b/0001-Produce-DWARF4-by-default.patch new file mode 100644 index 0000000..195a982 --- /dev/null +++ b/0001-Produce-DWARF4-by-default.patch @@ -0,0 +1,113 @@ +From c51e7e9bcc3c5a0be34040c1f12a2bb50335cd6b Mon Sep 17 00:00:00 2001 +From: Konrad Kleine +Date: Thu, 24 Mar 2022 09:44:21 +0100 +Subject: [PATCH] Produce DWARF4 by default + +Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream: + +https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8f5b4?diff=unified +--- + clang/test/CodeGen/dwarf-version.c | 8 ++++---- + clang/test/Driver/as-options.s | 4 ++-- + clang/test/Driver/cl-options.c | 2 +- + clang/test/Driver/clang-g-opts.c | 2 +- + clang/test/Driver/ve-toolchain.c | 2 +- + clang/test/Driver/ve-toolchain.cpp | 2 +- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c +index e63316ace69c..3d68b06c58ff 100644 +--- a/clang/test/CodeGen/dwarf-version.c ++++ b/clang/test/CodeGen/dwarf-version.c +@@ -2,10 +2,10 @@ + // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3 + // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 + // RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 +-// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 +-// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 +-// RUN: %clang --target=i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 +-// RUN: %clang --target=i386-pc-solaris -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 ++// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 ++// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 ++// RUN: %clang --target=i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 ++// RUN: %clang --target=i386-pc-solaris -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 + + // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT + // environment variable which indirecty overrides the version in the target +diff --git a/clang/test/Driver/as-options.s b/clang/test/Driver/as-options.s +index 73d002c7ef7e..71d55f7fd537 100644 +--- a/clang/test/Driver/as-options.s ++++ b/clang/test/Driver/as-options.s +@@ -122,7 +122,7 @@ + // RUN: FileCheck --check-prefix=DEBUG %s + // RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g0 -g %s -### 2>&1 | \ + // RUN: FileCheck --check-prefix=DEBUG %s +-// DEBUG: "-g" "-gdwarf-5" ++// DEBUG: "-g" "-gdwarf-4" + // RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g -g0 %s -### 2>&1 | \ + // RUN: FileCheck --check-prefix=NODEBUG %s + // RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 -g0 %s -### 2>&1 | \ +@@ -141,7 +141,7 @@ + // RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-2 %s -### 2>&1 | \ + // RUN: FileCheck --check-prefix=GDWARF2 %s + // RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf %s -### 2>&1 | \ +-// RUN: FileCheck --check-prefix=GDWARF5 %s ++// RUN: FileCheck --check-prefix=GDWARF4 %s + + // RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 %s -### 2>&1 | \ + // RUN: FileCheck --check-prefix=GDWARF5 %s +diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c +index 6d929b19e7e2..373905c2e0fc 100644 +--- a/clang/test/Driver/cl-options.c ++++ b/clang/test/Driver/cl-options.c +@@ -569,7 +569,7 @@ + // RUN: %clang_cl -gdwarf /Z7 /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s + // Z7_gdwarf-NOT: "-gcodeview" + // Z7_gdwarf: "-debug-info-kind=constructor" +-// Z7_gdwarf: "-dwarf-version= ++// Z7_gdwarf: "-dwarf-version=4 + + // RUN: %clang_cl /ZH:MD5 /c -### -- %s 2>&1 | FileCheck -check-prefix=ZH_MD5 %s + // ZH_MD5: "-gsrc-hash=md5" +diff --git a/clang/test/Driver/clang-g-opts.c b/clang/test/Driver/clang-g-opts.c +index b1cdf411925a..082162f2cc30 100644 +--- a/clang/test/Driver/clang-g-opts.c ++++ b/clang/test/Driver/clang-g-opts.c +@@ -36,7 +36,7 @@ + + // CHECK-WITHOUT-G-NOT: -debug-info-kind + // CHECK-WITH-G: "-debug-info-kind=constructor" +-// CHECK-WITH-G: "-dwarf-version=5" ++// CHECK-WITH-G: "-dwarf-version=4" + // CHECK-WITH-G-DWARF4: "-dwarf-version=4" + // CHECK-WITH-G-DWARF2: "-dwarf-version=2" + +diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c +index 078341eb1202..6ccbef6a0c36 100644 +--- a/clang/test/Driver/ve-toolchain.c ++++ b/clang/test/Driver/ve-toolchain.c +@@ -6,7 +6,7 @@ + /// Checking dwarf-version + + // RUN: %clang -### -g --target=ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s +-// DWARF_VER: "-dwarf-version=5" ++// DWARF_VER: "-dwarf-version=4" + + ///----------------------------------------------------------------------------- + /// Checking include-path +diff --git a/clang/test/Driver/ve-toolchain.cpp b/clang/test/Driver/ve-toolchain.cpp +index cd48dd792f85..f77781d4c6fa 100644 +--- a/clang/test/Driver/ve-toolchain.cpp ++++ b/clang/test/Driver/ve-toolchain.cpp +@@ -7,7 +7,7 @@ + + // RUN: %clangxx -### -g --target=ve-unknown-linux-gnu \ + // RUN: %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s +-// DWARF_VER: "-dwarf-version=5" ++// DWARF_VER: "-dwarf-version=4" + + ///----------------------------------------------------------------------------- + /// Checking include-path +-- +2.41.0 + diff --git a/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch b/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch new file mode 100644 index 0000000..3269365 --- /dev/null +++ b/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch @@ -0,0 +1,108 @@ +From e3a1070bbd5f29190cb7b12d02cd8a63b03bbe79 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Thu, 9 Mar 2023 21:52:41 -0800 +Subject: Restore -fopenmp-implicit-rpath, disabled by default + +Used by redhat-rpm-config on older Fedora versions. +--- + clang/include/clang/Driver/Options.td | 6 ++++ + clang/lib/Driver/ToolChains/CommonArgs.cpp | 35 ++++++++++++++++++++++ + clang/lib/Driver/ToolChains/CommonArgs.h | 3 ++ + clang/test/OpenMP/Inputs/libomp.a | 1 + + 4 files changed, 45 insertions(+) + create mode 100644 clang/test/OpenMP/Inputs/libomp.a + +diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td +index 3a028fadb25b..6a3ac3f61e1b 100644 +--- a/clang/include/clang/Driver/Options.td ++++ b/clang/include/clang/Driver/Options.td +@@ -5415,6 +5415,12 @@ def offload_add_rpath: Flag<["--"], "offload-add-rpath">, + def no_offload_add_rpath: Flag<["--"], "no-offload-add-rpath">, + Flags<[NoArgumentUnused]>, + Alias; ++defm openmp_implicit_rpath: BoolFOption<"openmp-implicit-rpath", ++ LangOpts<"OpenMP">, ++ DefaultFalse, ++ PosFlag, ++ NegFlag, ++ BothFlags<[NoArgumentUnused]>>; + def r : Flag<["-"], "r">, Flags<[LinkerInput, NoArgumentUnused]>, + Group; + def regcall4 : Flag<["-"], "regcall4">, Group, +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index faceee85a2f8..c058df97160b 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -1124,6 +1124,39 @@ static void addOpenMPDeviceLibC(const ToolChain &TC, const ArgList &Args, + llvm::append_range(CmdArgs, Libraries); + } + ++void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, ++ const ArgList &Args, ++ ArgStringList &CmdArgs) { ++ ++ if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, ++ options::OPT_fno_openmp_implicit_rpath, false)) { ++ // Default to clang lib / lib64 folder, i.e. the same location as device ++ // runtime ++ SmallString<256> DefaultLibPath = ++ llvm::sys::path::parent_path(TC.getDriver().Dir); ++ llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); ++ CmdArgs.push_back("-rpath"); ++ CmdArgs.push_back(Args.MakeArgString(DefaultLibPath)); ++ } ++} ++ ++ ++void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, ++ const ArgList &Args, ++ ArgStringList &CmdArgs) { ++ ++ if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, ++ options::OPT_fno_openmp_implicit_rpath, false)) { ++ // Default to clang lib / lib64 folder, i.e. the same location as device ++ // runtime ++ SmallString<256> DefaultLibPath = ++ llvm::sys::path::parent_path(TC.getDriver().Dir); ++ llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); ++ CmdArgs.push_back("-rpath"); ++ CmdArgs.push_back(Args.MakeArgString(DefaultLibPath)); ++ } ++} ++ + void tools::addOpenMPRuntimeLibraryPath(const ToolChain &TC, + const ArgList &Args, + ArgStringList &CmdArgs) { +@@ -1195,6 +1228,8 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, + addOpenMPDeviceLibC(TC, Args, CmdArgs); + + addArchSpecificRPath(TC, Args, CmdArgs); ++ if (RTKind == Driver::OMPRT_OMP) ++ addOpenMPRuntimeSpecificRPath(TC, Args, CmdArgs); + addOpenMPRuntimeLibraryPath(TC, Args, CmdArgs); + + return true; +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.h b/clang/lib/Driver/ToolChains/CommonArgs.h +index 2db0f889ca82..ab756a181970 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.h ++++ b/clang/lib/Driver/ToolChains/CommonArgs.h +@@ -105,6 +105,9 @@ void AddAssemblerKPIC(const ToolChain &ToolChain, + const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs); + ++void addOpenMPRuntimeSpecificRPath(const ToolChain &TC, ++ const llvm::opt::ArgList &Args, ++ llvm::opt::ArgStringList &CmdArgs); + void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs); + void addOpenMPRuntimeLibraryPath(const ToolChain &TC, +diff --git a/clang/test/OpenMP/Inputs/libomp.a b/clang/test/OpenMP/Inputs/libomp.a +new file mode 100644 +index 000000000000..8b277f0dd5dc +--- /dev/null ++++ b/clang/test/OpenMP/Inputs/libomp.a +@@ -0,0 +1 @@ ++! +-- +2.43.0 + diff --git a/0001-Workaround-a-bug-in-ORC-on-ppc64le.patch b/0001-Workaround-a-bug-in-ORC-on-ppc64le.patch new file mode 100644 index 0000000..af236a1 --- /dev/null +++ b/0001-Workaround-a-bug-in-ORC-on-ppc64le.patch @@ -0,0 +1,30 @@ +From a2449cee8c995b56f1892502aab3dfad3d6f3ca1 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho +Date: Fri, 8 Sep 2023 11:45:34 -0300 +Subject: [PATCH] Workaround a bug in ORC on ppc64le + +The Jit code appears to be returning the wrong printf symbol on ppc64le +after the transition of the default long double to IEEE 128-bit floating +point. +--- + clang/unittests/Interpreter/InterpreterTest.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp +index abb8e6377aab..7b6697ebc6ed 100644 +--- a/clang/unittests/Interpreter/InterpreterTest.cpp ++++ b/clang/unittests/Interpreter/InterpreterTest.cpp +@@ -243,7 +243,9 @@ TEST(IncrementalProcessing, FindMangledNameSymbol) { + EXPECT_FALSE(!Addr); + + // FIXME: Re-enable when we investigate the way we handle dllimports on Win. +-#ifndef _WIN32 ++ // FIXME: The printf symbol returned from the Jit may not be correct on ++ // ppc64le when the default long double is IEEE 128-bit fp. ++#if !defined _WIN32 && !(defined __PPC64__ && defined __LITTLE_ENDIAN__) + EXPECT_EQ((uintptr_t)&printf, Addr->getValue()); + #endif // _WIN32 + } +-- +2.41.0 + diff --git a/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch b/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch new file mode 100644 index 0000000..37284a2 --- /dev/null +++ b/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch @@ -0,0 +1,84 @@ +From 22d62b32cd3be5fb0ae10723b35a781e0f862b71 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 24 Jan 2023 22:46:25 +0000 +Subject: [PATCH] clang-tools-extra: Make test dependency on LLVMHello optional + +This fixes clang + clang-tools-extra standalone build after +--- + clang-tools-extra/test/CMakeLists.txt | 10 +++++++++- + clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp | 2 +- + clang-tools-extra/test/lit.cfg.py | 3 +++ + clang-tools-extra/test/lit.site.cfg.py.in | 1 + + 4 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt +index f4c529ee8af2..1cfb4dd529aa 100644 +--- a/clang-tools-extra/test/CMakeLists.txt ++++ b/clang-tools-extra/test/CMakeLists.txt +@@ -7,10 +7,15 @@ + set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") + set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") + ++if (TARGET LLVMHello) ++ set (LLVM_HAS_LLVM_HELLO 1) ++endif() ++ + llvm_canonicalize_cmake_booleans( + CLANG_TIDY_ENABLE_STATIC_ANALYZER + CLANG_PLUGIN_SUPPORT + LLVM_INSTALL_TOOLCHAIN_ONLY ++ LLVM_HAS_LLVM_HELLO + ) + + configure_lit_site_cfg( +@@ -86,7 +91,10 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + endif() + + if(TARGET CTTestTidyModule) +- list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello) ++ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule) ++ if (TARGET LLVMHello) ++ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule) ++ endif() + target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}") + if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN)) + set(LLVM_LINK_COMPONENTS +diff --git a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp +index c66a94f458cf..b4e7a5d691e5 100644 +--- a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp ++++ b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp +@@ -1,4 +1,4 @@ +-// REQUIRES: plugins ++// REQUIRES: plugins, llvm-hello + // RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s + // CHECK-LIST: Enabled checks: + // CHECK-LIST-NEXT: mytest1 +diff --git a/clang-tools-extra/test/lit.cfg.py b/clang-tools-extra/test/lit.cfg.py +index 9f64fd3d2ffa..1b258a00ddf9 100644 +--- a/clang-tools-extra/test/lit.cfg.py ++++ b/clang-tools-extra/test/lit.cfg.py +@@ -75,6 +75,9 @@ config.substitutions.append(("%clang_tidy_headers", clang_tidy_headers)) + if config.has_plugins and config.llvm_plugin_ext: + config.available_features.add("plugins") + ++if config.has_llvm_hello: ++ config.available_features.add("llvm-hello") ++ + # It is not realistically possible to account for all options that could + # possibly be present in system and user configuration files, so disable + # default configs for the test runs. +diff --git a/clang-tools-extra/test/lit.site.cfg.py.in b/clang-tools-extra/test/lit.site.cfg.py.in +index 4eb830a1baf1..6e5559348454 100644 +--- a/clang-tools-extra/test/lit.site.cfg.py.in ++++ b/clang-tools-extra/test/lit.site.cfg.py.in +@@ -11,6 +11,7 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" + config.host_triple = "@LLVM_HOST_TRIPLE@" + config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@ + config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@ ++config.has_llvm_hello = @LLVM_HAS_LLVM_HELLO@ + # Support substitution of the tools and libs dirs with user parameters. This is + # used when we can't determine the tool dir at configuration time. + config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +-- +2.40.1 + diff --git a/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch b/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch new file mode 100644 index 0000000..e425475 --- /dev/null +++ b/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch @@ -0,0 +1,39 @@ +From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Wed, 4 Aug 2021 14:05:38 -0700 +Subject: [PATCH] cmake: Allow shared libraries to customize the soname using + LLVM_ABI_REVISION + +The LLVM_ABI_REVISION variable is intended to be used for release +candidates which introduce an ABI change to a shared library. This +variable can be specified per library, so there is not one global value +for all of LLVM. + +For example, if we LLVM X.0.0-rc2 introduces an ABI change for a library +compared with LLVM X.0.0-rc1, then the LLVM_ABI_REVISION number for +library will be incremented by 1. + +In the main branch, LLVM_ABI_REVISION should always be 0, it is only +meant to be used in the release branch. + +Differential Revision: https://reviews.llvm.org/D105594 +--- + clang/tools/clang-shlib/CMakeLists.txt | 5 +++++ + 3 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/clang/tools/clang-shlib/CMakeLists.txt b/clang/tools/clang-shlib/CMakeLists.txt +index 9c1f8ea452b3..4d785924e4bb 100644 +--- a/clang/tools/clang-shlib/CMakeLists.txt ++++ b/clang/tools/clang-shlib/CMakeLists.txt +@@ -1,3 +1,8 @@ ++# In the main branch, LLVM_ABI_REVISION should always be 0. In the release ++# branches, this should be incremented before each release candidate every ++# time the ABI of libclang-cpp.so changes. ++set(LLVM_ABI_REVISION 0) ++ + # Building libclang-cpp.so fails if LLVM_ENABLE_PIC=Off + if (NOT LLVM_ENABLE_PIC) + return() +-- +2.27.0 + diff --git a/0003-PATCH-clang-Don-t-install-static-libraries.patch b/0003-PATCH-clang-Don-t-install-static-libraries.patch new file mode 100644 index 0000000..bc8fa51 --- /dev/null +++ b/0003-PATCH-clang-Don-t-install-static-libraries.patch @@ -0,0 +1,25 @@ +From 88704fc2eabb9dd19a9c3eb81a9b3dc37d95651c Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 31 Jan 2020 11:04:57 -0800 +Subject: [PATCH][clang] Don't install static libraries + +--- + clang/cmake/modules/AddClang.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 5752f4277444..0f52822d91f0 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -113,7 +113,7 @@ macro(add_clang_library name) + if(TARGET ${lib}) + target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS}) + +- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) ++ if (ARG_SHARED AND (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} +-- +2.30.2 + diff --git a/0009-disable-myst-parser.patch b/0009-disable-myst-parser.patch new file mode 100644 index 0000000..12a5154 --- /dev/null +++ b/0009-disable-myst-parser.patch @@ -0,0 +1,26 @@ +From 988dd3f3363d8ab4ee53f61e0eb5afc6646c9d4f Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Tue, 26 Sep 2023 13:06:29 +0200 +Subject: [PATCH] disable myst parser + +--- + clang/docs/conf.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/clang/docs/conf.py b/clang/docs/conf.py +index ca310026f53e..dfb74273b5b2 100644 +--- a/clang/docs/conf.py ++++ b/clang/docs/conf.py +@@ -35,9 +35,6 @@ templates_path = ["_templates"] + + import sphinx + +-if sphinx.version_info >= (3, 0): +- extensions.append("myst_parser") +- + # The encoding of source files. + # source_encoding = 'utf-8-sig' + +-- +2.41.0 + diff --git a/0101-Deactivate-markdown-doc.patch b/0101-Deactivate-markdown-doc.patch index a8409aa..693a69f 100644 --- a/0101-Deactivate-markdown-doc.patch +++ b/0101-Deactivate-markdown-doc.patch @@ -1,8 +1,17 @@ +From a9fb2cb9a29e50bf4ba3c2e470e52ea091a807e5 Mon Sep 17 00:00:00 2001 +From: Konrad Kleine +Date: Fri, 3 Nov 2023 20:55:14 +0000 +Subject: [PATCH] Deactivate-markdown-doc + +--- + llvm/docs/conf.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py -index cf8a75980b53..b208ad138e89 100644 +index 0a3905201c85..81326257856a 100644 --- a/llvm/docs/conf.py +++ b/llvm/docs/conf.py -@@ -26,7 +26,7 @@ from datetime import date +@@ -26,7 +26,7 @@ sys.path.insert(0, os.path.abspath(".")) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. diff --git a/DistributionFedora-stage2.cmake b/DistributionFedora-stage2.cmake new file mode 100644 index 0000000..99d5dc0 --- /dev/null +++ b/DistributionFedora-stage2.cmake @@ -0,0 +1,33 @@ +# This file sets up a CMakeCache for the second stage of a simple distribution +# bootstrap build. + +set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") +set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "") + +set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "") + +set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") + +# setup toolchain +set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") +set(LLVM_TOOLCHAIN_TOOLS + dsymutil + llvm-cov + llvm-dwarfdump + llvm-profdata + llvm-objdump + llvm-nm + llvm-size + CACHE STRING "") + +set(LLVM_DISTRIBUTION_COMPONENTS + clang + LTO + clang-format + clang-resource-headers + builtins + runtimes + ${LLVM_TOOLCHAIN_TOOLS} + CACHE STRING "") diff --git a/DistributionFedora.cmake b/DistributionFedora.cmake new file mode 100644 index 0000000..992d207 --- /dev/null +++ b/DistributionFedora.cmake @@ -0,0 +1,55 @@ +# This file sets up a CMakeCache for a simple distribution bootstrap build. + +# For the Jira project entitled "LLVM" you can open +# https://issues.redhat.com/rest/api/2/project/LLVM to find its pid. "1" stands +# for the issue type "Bug". +set(BUG_REPORT_URL "https://issues.redhat.com/secure/CreateIssue.jspa?issuetype=1&pid=12339624" CACHE STRING "") + +#Enable LLVM projects and runtimes +set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") +set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "") + +# Only build the native target in stage1 since it is a throwaway build. +set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "") + +# Optimize the stage1 compiler, but don't LTO it because that wastes time. +set(CMAKE_BUILD_TYPE Release CACHE STRING "") + +# Setup vendor-specific settings. +set(PACKAGE_VENDOR LLVM.org CACHE STRING "") + +# Setting up the stage2 LTO option needs to be done on the stage1 build so that +# the proper LTO library dependencies can be connected. +set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") + +if (NOT APPLE) + # Since LLVM_ENABLE_LTO is ON we need a LTO capable linker + set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "") +endif() + +# Expose stage2 targets through the stage1 build configuration. +set(CLANG_BOOTSTRAP_TARGETS + check-all + check-llvm + check-clang + llvm-config + test-suite + test-depends + llvm-test-depends + clang-test-depends + distribution + install-distribution + clang CACHE STRING "") + +# Setup the bootstrap build. +set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") + +if(STAGE2_CACHE_FILE) + set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${STAGE2_CACHE_FILE} + CACHE STRING "") +else() + set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${CMAKE_CURRENT_LIST_DIR}/DistributionFedora-stage2.cmake + CACHE STRING "") +endif() diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..89a64f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,96 @@ + +YYYYMMDD=$(shell date +%Y%m%d) +OUTDIR=$(shell pwd)/out +SPEC=llvm.spec +BUILDDIR=$(shell pwd)/BUILD +BUILDROOTDIR=$(shell pwd)/BUILD +SOURCEDIR=$(shell pwd) +FEDORA_RELEASE=f39 + +.PHONY: setup +setup: + mkdir -pv $(OUTDIR) + mkdir -pv $(BUILDDIR) + mkdir -pv $(BUILDROOTDIR) + mkdir -pv $(SOURCEDIR) + + YYYYMMDD=$(YYYYMMDD) ./.copr/snapshot-info.sh > $(SOURCEDIR)/version.spec.inc + +.PHONY: local-srpm +local-srpm: setup + rpmbuild \ + --define "yyyymmdd $(YYYYMMDD)" \ + --define "_srcrpmdir $(OUTDIR)" \ + --define "_sourcedir $(SOURCEDIR)" \ + --define "_disable_source_fetch 0" \ + -bs $(SPEC) + +.PHONY: local-rpm +local-rpm: setup + fedpkg --release $(FEDORA_RELEASE) -v \ + local \ + --builddir $(BUILDDIR) \ + --buildrootdir $(BUILDROOTDIR) \ + --define "yyyymmdd $(YYYYMMDD)" \ + --define "_disable_source_fetch 0" \ + -- $(SPEC) + +.PHONY: local-clean +local-clean: + -rm -rf $(BUILDDIR) + -rm -rf $(BUILDROOTDIR) + -rm -rf $(OUTDIR) + -rm -f *.txt + -rm -f *.tar.xz + -rm -f *.tar.xz.sig + -rm -rf x86_64 + -rm -rf noarch + -rm -rf *.src.rpm + +.PHONY: local-list-check +local-list-check: setup + fedpkg --release $(FEDORA_RELEASE) -v \ + local \ + --builddir $(BUILDDIR) \ + --buildrootdir $(BUILDROOTDIR) \ + --define "yyyymmdd $(YYYYMMDD)" \ + --define "_disable_source_fetch 0" \ + -- $(SPEC) -bl + +.PHONY: local-prep +local-prep: setup + fedpkg --release $(FEDORA_RELEASE) -v \ + prep \ + --builddir $(BUILDDIR) \ + --buildrootdir $(BUILDROOTDIR) \ + --define "yyyymmdd $(YYYYMMDD)" \ + --define "_disable_source_fetch 0" \ + -- $(SPEC) + + +.PHONY: local-tmt-vm +local-tmt-vm: + # This is to ensure the required packages are installed + rpm -q tmt tmt+provision-virtual + # This is to check if you've started libvirt + # If this fails, run: sudo systemctl start libvirtd + # systemctl status libvirtd --no-pager + # In case of: Failed to boot testcloud instance (authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage') + # Add yourself to libvirt group: sudo usermod -a -G libvirt $USER + cat /etc/group | grep libvirt | grep $(USER) + tmt \ + -c distro=fedora-rawhide \ + -c arch=x86_64 \ + -c snapshot=20240124 + run \ + -avv \ + provision \ + -h virtual.testcloud \ + -c system \ + -i fedora-rawhide \ + prepare \ + -h install \ + -c fedora-llvm-team/llvm-snapshots-big-merge-20240124 \ + test \ + report + diff --git a/build.spec.inc b/build.spec.inc new file mode 100644 index 0000000..b56c13a --- /dev/null +++ b/build.spec.inc @@ -0,0 +1,213 @@ +# Disable LTO to speed up builds +%if %{with snapshot_build} +%global _lto_cflags %nil +%endif + +# TODO(kkleine): In clang we had this %ifarch s390 s390x %{arm} aarch64 %ix86 ppc64le +%ifarch s390 s390x %{arm} %ix86 +# Decrease debuginfo verbosity to reduce memory consumption during final library linking +%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') +%endif + +# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. +export ASMFLAGS="%{build_cflags}" + +# We set CLANG_DEFAULT_PIE_ON_LINUX=OFF and PPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON to match the +# defaults used by Fedora's GCC. + +#region BEGIN: COPIED FROM CLANG + +# And disable LTO on AArch64 entirely. +%ifarch aarch64 +%define _lto_cflags %{nil} +%endif + +# TODO(kkleine): Make sure the paths actually work. I have the feeling this needs adjustment +pwd +%if 0%{?__isa_bits} == 64 +sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' llvm/test/lit.cfg.py +%else +sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' llvm/test/lit.cfg.py +%endif + +# Disable dwz on aarch64, because it takes a huge amount of time to decide not to optimize things. +%ifarch aarch64 +%define _find_debuginfo_dwz_opts %{nil} +%endif + +#endregion + +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:`pwd`/llvm/%{_vpath_builddir}/%{_lib}" + +cd llvm + +# TODO(kkleine): Follow more closely the Distribution guidelines found here: https://llvm.org/docs/BuildingADistribution.html +# force off shared libs as cmake macros turns it on. +# TODO: Disable LLVM_UNREACHABLE_OPTIMIZE. +# TODO: LIBOMP_HAVE_VERSION_SCRIPT_FLAG should be set automatically. +%cmake -G Ninja \ + -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \ + \ + \ + -DCLANG_DEFAULT_PIE_ON_LINUX=OFF \ +%if 0%{?fedora} || 0%{?rhel} > 9 + -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON \ +%endif + -DPYTHON_EXECUTABLE=%{__python3} \ +%if %{with compat_build} + -DLLVM_INCLUDE_TESTS:BOOL=OFF \ + -DCLANG_INCLUDE_TESTS:BOOL=OFF \ + -DCLANG_BUILD_TOOLS:BOOL=OFF \ +%else + -DLLVM_INCLUDE_TESTS:BOOL=ON \ + -DCLANG_INCLUDE_TESTS:BOOL=ON \ + -DLLVM_BUILD_UTILS:BOOL=ON \ +%endif + -DCLANG_ENABLE_ARCMT:BOOL=ON \ + -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \ + -DCLANG_INCLUDE_DOCS:BOOL=ON \ + -DCLANG_PLUGIN_SUPPORT:BOOL=ON \ + -DENABLE_LINKER_BUILD_ID:BOOL=ON \ + -DLLVM_ENABLE_EH=ON \ + -DCLANG_LINK_CLANG_DYLIB=ON \ + -DCLANG_BUILD_EXAMPLES:BOOL=OFF \ + -DCLANG_REPOSITORY_STRING="%{?dist_vendor} %{version}-%{release}" \ + -DCLANG_RESOURCE_DIR=../lib/clang/%{maj_ver} \ + -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra \ + -DCLANG_CONFIG_FILE_SYSTEM_DIR=%{_sysconfdir}/%{pkg_name_clang}/ \ +%ifarch %{arm} + -DCLANG_DEFAULT_LINKER=lld \ +%endif + -DCLANG_DEFAULT_UNWINDLIB=libgcc \ + \ + \ + \ + \ +%if %{without compat_build} +-DLLVM_ENABLE_RUNTIMES="compiler-rt;openmp" \ +%endif + \ + \ + \ + \ + \ +%if %{without compat_build} + -DCOMPILER_RT_INSTALL_PATH=%{_prefix}/lib/clang/%{maj_ver} \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \ + -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF \ +%endif + \ + \ + \ + \ + \ +%if %{without compat_build} + -DLIBOMP_HAVE_VERSION_SCRIPT_FLAG:BOOL=ON \ + -DLIBOMP_INSTALL_ALIASES=OFF \ +%if 0%{?__isa_bits} == 64 + -DOPENMP_LIBDIR_SUFFIX=64 \ +%else + -DOPENMP_LIBDIR_SUFFIX= \ +%endif +%endif + \ + \ + \ + \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DLLVM_PARALLEL_LINK_JOBS=1 \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ +%ifarch s390 %{arm} %ix86 + -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ +%endif +%if %{without compat_build} +%if 0%{?__isa_bits} == 64 + -DLLVM_LIBDIR_SUFFIX=64 \ +%else + -DLLVM_LIBDIR_SUFFIX= \ +%endif +%endif + \ + -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \ + -DLLVM_ENABLE_LIBCXX:BOOL=OFF \ + -DLLVM_ENABLE_ZLIB:BOOL=ON \ + -DLLVM_ENABLE_FFI:BOOL=ON \ + -DLLVM_ENABLE_RTTI:BOOL=ON \ + -DLLVM_USE_PERF:BOOL=ON \ +%if %{with gold} + -DLLVM_BINUTILS_INCDIR=%{_includedir} \ +%endif + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \ + \ + -DLLVM_BUILD_RUNTIME:BOOL=ON \ + \ + -DLLVM_INCLUDE_TOOLS:BOOL=ON \ + -DLLVM_BUILD_TOOLS:BOOL=ON \ + \ + -DLLVM_BUILD_TESTS:BOOL=ON \ +%if %{with compat_build} + -DLLVM_INSTALL_GTEST:BOOL=OFF \ +%else + -DLLVM_INSTALL_GTEST:BOOL=ON \ +%endif + -DLLVM_LIT_ARGS=-vv \ + \ + -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ + -DLLVM_BUILD_EXAMPLES:BOOL=OFF \ + \ + -DLLVM_INCLUDE_UTILS:BOOL=ON \ +%if %{with compat_build} + -DLLVM_INSTALL_UTILS:BOOL=OFF \ +%else + -DLLVM_INSTALL_UTILS:BOOL=ON \ + -DLLVM_UTILS_INSTALL_DIR:PATH=%{_bindir} \ + -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \ +%endif + \ + -DLLVM_INCLUDE_DOCS:BOOL=ON \ + -DLLVM_BUILD_DOCS:BOOL=ON \ + -DLLVM_ENABLE_SPHINX:BOOL=ON \ + -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \ + \ +%if %{with snapshot_build} + -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \ +%else +%if %{without compat_build} + -DLLVM_VERSION_SUFFIX='' \ +%endif +%endif + -DLLVM_UNREACHABLE_OPTIMIZE:BOOL=ON \ + -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ + -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \ + -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \ + -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \ + -DSPHINX_WARNINGS_AS_ERRORS=OFF \ + -DCMAKE_INSTALL_PREFIX=%{install_prefix} \ + -DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \ + -DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -Wl,-z,cet-report=error" \ +%if %{without snapshot_build} + -DLLVM_UNITTEST_LINK_FLAGS="-Wl,-plugin-opt=O0" +%endif + +# 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. +%cmake_build --target LLVM + +%cmake_build + +# If we don't build the runtimes target here, we'll have to wait for the %check +# section until these files are available but they need to be installed. +# +# /usr/lib64/libomptarget.devicertl.a +# /usr/lib64/libomptarget-amdgpu-*.bc +# /usr/lib64/libomptarget-nvptx-*.bc + +%cmake_build --target runtimes + +cd .. diff --git a/changelog.spec.inc b/changelog.spec.inc new file mode 100644 index 0000000..2299b19 --- /dev/null +++ b/changelog.spec.inc @@ -0,0 +1,754 @@ +%{?llvm_snapshot_changelog_entry} + +* Tue Aug 01 2023 Tulio Magno Quites Machado Filho - 17.0.0~rc1-2 +- Enable LLVM_UNREACHABLE_OPTIMIZE temporarily + +* Mon Jul 31 2023 Tulio Magno Quites Machado Filho - 17.0.0~rc1-1 +- Update to LLVM 17.0.0 RC1 + +* Mon Jul 31 2023 Tulio Magno Quites Machado Filho - 16.0.6-6 +- Fix rhbz #2224885 + +* Thu Jul 20 2023 Fedora Release Engineering - 16.0.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jul 10 2023 Tulio Magno Quites Machado Filho - 16.0.6-4 +- Use LLVM_UNITTEST_LINK_FLAGS to reduce link times for unit tests + +* Mon Jul 03 2023 Tulio Magno Quites Machado Filho - 16.0.6-3 +- Improve error messages for unsupported relocs on s390x (rhbz#2216906) +- Disable LLVM_UNREACHABLE_OPTIMIZE + +* Wed Jun 14 2023 Tulio Magno Quites Machado Filho - 16.0.6-1 +- Update to LLVM 16.0.6 + +* Fri Jun 09 2023 Nikita Popov - 16.0.5-2 +- Split off llvm-cmake-utils package + +* Mon Jun 05 2023 Tulio Magno Quites Machado Filho - 16.0.5-1 +- Update to LLVM 16.0.5 + +* Fri May 19 2023 Yaakov Selkowitz - 16.0.4-2 +- Avoid recommonmark dependency in RHEL builds + +* Thu May 18 2023 Tulio Magno Quites Machado Filho - 16.0.4-1 +- Update to LLVM 16.0.4 + +* Tue May 09 2023 Tulio Magno Quites Machado Filho - 16.0.3-1 +- Update to LLVM 16.0.3 + +* Tue Apr 25 2023 Tulio Magno Quites Machado Filho - 16.0.2-1 +- Update to LLVM 16.0.2 + +* Tue Apr 11 2023 Tulio Magno Quites Machado Filho - 16.0.1-1 +- Update to LLVM 16.0.1 + +* Thu Mar 23 2023 Tulio Magno Quites Machado Filho - 16.0.0-2 +- Distribute libllvm_gtest.a and libllvm_gtest_main.a with llvm-googletest +- Stop distributing /usr/share/llvm/src/utils + +* Mon Mar 20 2023 Tulio Magno Quites Machado Filho - 16.0.0-1 +- Update to LLVM 16.0.0 + +* Thu Mar 16 2023 Tulio Magno Quites Machado Filho - 16.0.0~rc4-2 +- Fix the ppc64le triple + +* Tue Mar 14 2023 Tulio Magno Quites Machado Filho - 16.0.0~rc4-1 +- Update to LLVM 16.0.0 RC4 + +* Fri Mar 10 2023 Tulio Magno Quites Machado Filho - 16.0.0~rc3-2 +- Fix llvm-exegesis failures on s390x + +* Wed Feb 22 2023 Tulio Magno Quites Machado Filho - 16.0.0~rc3-1 +- Update to LLVM 16.0.0 RC3 + +* Wed Feb 01 2023 Tulio Magno Quites Machado Filho - 16.0.0~rc1-1 +- Update to LLVM 16.0.0 RC1 + +* Thu Jan 19 2023 Tulio Magno Quites Machado Filho - 15.0.7-3 +- Update license to SPDX identifiers. +- Include the Apache license adopted in 2019. + +* Thu Jan 19 2023 Fedora Release Engineering - 15.0.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jan 12 2023 Nikita Popov - 15.0.7-1 +- Update to LLVM 15.0.7 + +* Mon Jan 09 2023 Tom Stellard - 15.0.6-3 +- Omit frame pointers when building + +* Mon Dec 19 2022 Nikita Popov - 15.0.6-2 +- Remove workaround for rbhz#2048440 + +* Mon Dec 05 2022 Nikita Popov - 15.0.6-1 +- Update to LLVM 15.0.6 + +* Fri Nov 11 2022 Nikita Popov - 15.0.4-2 +- Copy CFLAGS to ASMFLAGs to enable CET in asm files + +* Wed Nov 02 2022 Nikita Popov - 15.0.4-1 +- Update to LLVM 15.0.4 + +* Tue Sep 27 2022 Nikita Popov - 15.0.0-2 +- Export GetHostTriple.cmake + +* Tue Sep 06 2022 Nikita Popov - 15.0.0-1 +- Update to LLVM 15.0.0 + +* Thu Jul 21 2022 Fedora Release Engineering - 14.0.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jun 17 2022 Timm Bäder - 14.0.5-2 +- Release bump for new redhat-rpm-config + +* Mon Jun 13 2022 Timm Bäder - 14.0.5-1 +- 14.0.5 Release + +* Wed May 18 2022 Tom Stellard - 14.0.3-1 +- 14.0.3 Release + +* Fri Apr 29 2022 Timm Bäder - 14.0.0-2 +- Remove llvm-cmake-devel package + +* Wed Mar 23 2022 Timm Bäder - 14.0.0-1 +- Update to LLVM 14.0.0 + +* Wed Feb 02 2022 Nikita Popov - 13.0.1-1 +- Update to LLVM 13.0.1 final + +* Tue Jan 25 2022 Nikita Popov - 13.0.1~rc3-1 +- Update to LLVM 13.0.1rc3 + +* Thu Jan 20 2022 Fedora Release Engineering - 13.0.1~rc2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jan 13 2022 Nikita Popov - 13.0.1~rc2-1 +- Update to LLVM 13.0.1rc2 + +* Mon Jan 10 2022 Nikita Popov - 13.0.1~rc1-1 +- Upstream 13.0.1 rc1 release + +* Sat Jan 08 2022 Miro Hrončok - 13.0.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 + +* Thu Nov 11 2021 Tom Stellard - 13.0.0-7 +- Enable lto on s390x and arm + +* Mon Oct 25 2021 Tom Stellard - 13.0.0-6 +- Build with Thin LTO + +* Mon Oct 18 2021 Tom Stellard - 13.0.0-5 +- Build with clang + +* Fri Oct 08 2021 Tom Stellard - 13.0.0-4 +- Fix default triple on arm + +* Wed Oct 06 2021 Tom Stellard - 13.0.0-3 +- Set default triple + +* Mon Oct 04 2021 Tom Stellard - 13.0.0-2 +- Drop abi_revision from soname + +* Thu Sep 30 2021 Tom Stellard - 13.0.0-1 +- 13.0.0 Release + +* Thu Sep 30 2021 Tom Stellard - 13.0.0~rc4-2 +- Restore config.guess for host triple detection + +* Fri Sep 24 2021 Tom Stellard - 13.0.0~rc4-1 +- 13.0.0-rc4 Release + +* Fri Sep 17 2021 Tom Stellard - 13.0.0~rc3-1 +- 13.0.0-rc3 Release + +* Mon Sep 13 2021 Tom Stellard - 13.0.0~rc1-3 +- Pass LLVM_DEFAULT_TARGET_TRIPLE to cmake + +* Mon Sep 13 2021 Konrad Kleine - 13.0.0~rc1-2 +- Add --without=check option + +* Wed Aug 04 2021 Tom Stellard - 13.0.0~rc1-1 +- 13.0.0-rc1 Release + +* Thu Jul 22 2021 sguelton@redhat.com - 12.0.1-3 +- Maintain versionned link to llvm-config + +* Thu Jul 22 2021 Fedora Release Engineering - 12.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jul 12 2021 Tom Stellard - 12.0.1-1 +- 12.0.1 Release + +* Wed Jun 30 2021 Tom Stellard - llvm-12.0.1~rc3-1 +- 12.0.1-rc3 Release + +* Fri May 28 2021 Tom Stellard - 12.0.1~rc1-2 +- Stop installing lit tests + +* Wed May 26 2021 Tom Stellard - llvm-12.0.1~rc1-1 +- 12.0.1-rc1 Release + +* Mon May 17 2021 sguelton@redhat.com - 12.0.0-7 +- Fix handling of llvm-config + +* Mon May 03 2021 kkleine@redhat.com - 12.0.0-6 +- More verbose builds thanks to python3-psutil + +* Sat May 01 2021 sguelton@redhat.com - 12.0.0-5 +- Fix llvm-config install + +* Tue Apr 27 2021 sguelton@redhat.com - 12.0.0-4 +- Provide default empty value for exec_suffix when not in compat mode + +* Tue Apr 27 2021 sguelton@redhat.com - 12.0.0-3 +- Fix llvm-config install + +* Tue Apr 20 2021 sguelton@redhat.com - 12.0.0-2 +- Backport compat package fix + +* Thu Apr 15 2021 Tom Stellard - 12.0.0-1 +- 12.0.0 Release + +* Thu Apr 08 2021 sguelton@redhat.com - 12.0.0-0.11.rc5 +- New upstream release candidate + +* Tue Apr 06 2021 sguelton@redhat.com - 12.0.0-0.10.rc4 +- Patch test case for compatibility with llvm-test latout + +* Fri Apr 02 2021 sguelton@redhat.com - 12.0.0-0.9.rc4 +- New upstream release candidate + +* Wed Mar 31 2021 Jonathan Wakely - 12.0.0-0.8.rc3 +- Rebuilt for removed libstdc++ symbols (#1937698) + +* Thu Mar 11 2021 sguelton@redhat.com - 12.0.0-0.7.rc3 +- LLVM 12.0.0 rc3 + +* Wed Mar 10 2021 Kalev Lember - 12.0.0-0.6.rc2 +- Add llvm-static(major) provides to the -static subpackage + +* Tue Mar 09 2021 sguelton@redhat.com - 12.0.0-0.5.rc2 +- rebuilt + +* Tue Mar 02 2021 sguelton@redhat.com - 12.0.0-0.4.rc2 +- Change CI working dir + +* Wed Feb 24 2021 sguelton@redhat.com - 12.0.0-0.3.rc2 +- 12.0.0-rc2 release + +* Tue Feb 16 2021 Dave Airlie - 12.0.0-0.2.rc1 +- Enable LLVM_USE_PERF to allow perf integration + +* Tue Feb 2 2021 Serge Guelton - 12.0.0-0.1.rc1 +- 12.0.0-rc1 release + +* Tue Jan 26 2021 Fedora Release Engineering - 11.1.0-0.3.rc2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 22 2021 Serge Guelton - 11.1.0-0.2.rc2 +- 11.1.0-rc2 release + +* Thu Jan 14 2021 Serge Guelton - 11.1.0-0.1.rc1 +- 11.1.0-rc1 release + +* Tue Jan 05 2021 Serge Guelton - 11.0.1-3.rc2 +- Waive extra test case + +* Sun Dec 20 2020 sguelton@redhat.com - 11.0.1-2.rc2 +- 11.0.1-rc2 release + +* Tue Dec 01 2020 sguelton@redhat.com - 11.0.1-1.rc1 +- 11.0.1-rc1 release + +* Sat Oct 31 2020 Jeff Law - 11.0.0-2 +- Fix missing #include for gcc-11 + +* Wed Oct 14 2020 Josh Stone - 11.0.0-1 +- Fix coreos-installer test crash on s390x (rhbz#1883457) + +* Mon Oct 12 2020 sguelton@redhat.com - 11.0.0-0.11 +- llvm 11.0.0 - final release + +* Thu Oct 08 2020 sguelton@redhat.com - 11.0.0-0.10.rc6 +- 11.0.0-rc6 + +* Fri Oct 02 2020 sguelton@redhat.com - 11.0.0-0.9.rc5 +- 11.0.0-rc5 Release + +* Sun Sep 27 2020 sguelton@redhat.com - 11.0.0-0.8.rc3 +- Fix NVR + +* Thu Sep 24 2020 sguelton@redhat.com - 11.0.0-0.2.rc3 +- Obsolete patch for rhbz#1862012 + +* Thu Sep 24 2020 sguelton@redhat.com - 11.0.0-0.1.rc3 +- 11.0.0-rc3 Release + +* Wed Sep 02 2020 sguelton@redhat.com - 11.0.0-0.7.rc2 +- Apply upstream patch for rhbz#1862012 + +* Tue Sep 01 2020 sguelton@redhat.com - 11.0.0-0.6.rc2 +- Fix source location + +* Fri Aug 21 2020 Tom Stellard - 11.0.0-0.5.rc2 +- 11.0.0-rc2 Release + +* Wed Aug 19 2020 Tom Stellard - 11.0.0-0.4.rc1 +- Fix regression-tests CI tests + +* Tue Aug 18 2020 Tom Stellard - 11.0.0-0.3.rc1 +- Fix rust crash on ppc64le compiling firefox +- rhbz#1862012 + +* Tue Aug 11 2020 Tom Stellard - 11.0.0-0.2.rc1 +- Install update_cc_test_checks.py script + +* Thu Aug 06 2020 Tom Stellard - 11.0.0-0.1-rc1 +- LLVM 11.0.0-rc1 Release +- Make llvm-devel require llvm-static and llvm-test + +* Tue Aug 04 2020 Tom Stellard - 10.0.0-10 +- Backport upstream patch to fix build with -flto. +- Disable LTO on s390x to work-around unit test failures. + +* Sat Aug 01 2020 sguelton@redhat.com - 10.0.0-9 +- Fix update-alternative uninstall script + +* Sat Aug 01 2020 sguelton@redhat.com - 10.0.0-8 +- Fix gpg verification and update macro usage. + +* Sat Aug 01 2020 Fedora Release Engineering - 10.0.0-7 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 10.0.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild +* Thu Jun 11 2020 sguelton@redhat.com - 10.0.0-5 +- Make llvm-test.tar.gz creation reproducible. + +* Tue Jun 02 2020 sguelton@redhat.com - 10.0.0-4 +- Instruct cmake not to generate RPATH + +* Thu Apr 30 2020 Tom Stellard - 10.0.0-3 +- Install LLVMgold.so symlink in bfd-plugins directory + +* Tue Apr 07 2020 sguelton@redhat.com - 10.0.0-2 +- Do not package UpdateTestChecks tests in llvm-tests +- Apply upstream patch bab5908df to pass gating tests + +* Wed Mar 25 2020 sguelton@redhat.com - 10.0.0-1 +- 10.0.0 final + +* Mon Mar 23 2020 sguelton@redhat.com - 10.0.0-0.6.rc6 +- 10.0.0 rc6 + +* Thu Mar 19 2020 sguelton@redhat.com - 10.0.0-0.5.rc5 +- 10.0.0 rc5 + +* Sat Mar 14 2020 sguelton@redhat.com - 10.0.0-0.4.rc4 +- 10.0.0 rc4 + +* Thu Mar 05 2020 sguelton@redhat.com - 10.0.0-0.3.rc3 +- 10.0.0 rc3 + +* Fri Feb 28 2020 sguelton@redhat.com - 10.0.0-0.2.rc2 +- Remove *_finite support, see rhbz#1803203 + +* Fri Feb 14 2020 sguelton@redhat.com - 10.0.0-0.1.rc2 +- 10.0.0 rc2 + +* Fri Jan 31 2020 sguelton@redhat.com - 10.0.0-0.1.rc1 +- 10.0.0 rc1 + +* Wed Jan 29 2020 Fedora Release Engineering - 9.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Jan 21 2020 Tom Stellard - 9.0.1-4 +- Rebuild after previous build failed to strip binaries + +* Fri Jan 17 2020 Tom Stellard - 9.0.1-3 +- Add explicit Requires from sub-packages to llvm-libs + +* Fri Jan 10 2020 Tom Stellard - 9.0.1-2 +- Fix crash with kernel bpf self-tests + +* Thu Dec 19 2019 tstellar@redhat.com - 9.0.1-1 +- 9.0.1 Release + +* Mon Nov 25 2019 sguelton@redhat.com - 9.0.0-4 +- Activate AVR on all architectures + +* Mon Sep 30 2019 Tom Stellard - 9.0.0-3 +- Build libLLVM.so first to avoid OOM errors + +* Fri Sep 27 2019 Tom Stellard - 9.0.0-2 +- Remove unneeded BuildRequires: libstdc++-static + +* Thu Sep 19 2019 sguelton@redhat.com - 9.0.0-1 +- 9.0.0 Release + +* Wed Sep 18 2019 sguelton@redhat.com - 9.0.0-0.5.rc3 +- Support avr target, see rhbz#1718492 + +* Tue Sep 10 2019 Tom Stellard - 9.0.0-0.4.rc3 +- Split out test executables into their own export file + +* Fri Sep 06 2019 Tom Stellard - 9.0.0-0.3.rc3 +- Fix patch for splitting out static library exports + +* Fri Aug 30 2019 Tom Stellard - 9.0.0-0.2.rc3 +- 9.0.0-rc3 Release + +* Thu Aug 01 2019 Tom Stellard - 9.0.0-0.1.rc2 +- 9.0.0-rc2 Release + +* Tue Jul 30 2019 Tom Stellard - 8.0.0-9 +- Sync with llvm8.0 spec file + +* Thu Jul 25 2019 Fedora Release Engineering - 8.0.0-8.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jul 17 2019 Tom Stellard - 8.0.0-8 +- Add provides for the major version of sub-packages + +* Fri May 17 2019 sguelton@redhat.com - 8.0.0-7 +- Fix conflicts between llvm-static = 8 and llvm-dev < 8 around LLVMStaticExports.cmake + +* Wed Apr 24 2019 Tom Stellard - 8.0.0-6 +- Make sure we aren't passing -g on s390x + +* Sat Mar 30 2019 Tom Stellard - 8.0.0-5 +- Enable build rpath while keeping install rpath disabled + +* Wed Mar 27 2019 Tom Stellard - 8.0.0-4 +- Backport r351577 from trunk to fix ninja check failures + +* Tue Mar 26 2019 Tom Stellard - 8.0.0-3 +- Fix ninja check + +* Fri Mar 22 2019 Tom Stellard - 8.0.0-2 +- llvm-test fixes + +* Wed Mar 20 2019 sguelton@redhat.com - 8.0.0-1 +- 8.0.0 final + +* Fri Mar 15 2019 sguelton@redhat.com - 8.0.0-0.6.rc4 +- Activate all backends (rhbz#1689031) + +* Tue Mar 12 2019 sguelton@redhat.com - 8.0.0-0.5.rc4 +- 8.0.0 Release candidate 4 + +* Mon Mar 4 2019 sguelton@redhat.com - 8.0.0-0.4.rc3 +- Move some binaries to -test package, cleanup specfile + +* Mon Mar 4 2019 sguelton@redhat.com - 8.0.0-0.3.rc3 +- 8.0.0 Release candidate 3 + +* Fri Feb 22 2019 sguelton@redhat.com - 8.0.0-0.2.rc2 +- 8.0.0 Release candidate 2 + +* Sat Feb 9 2019 sguelton@redhat.com - 8.0.0-0.1.rc1 +- 8.0.0 Release candidate 1 + +* Fri Feb 01 2019 Fedora Release Engineering - 7.0.1-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Jan 21 2019 Josh Stone - 7.0.1-2 +- Fix discriminators in metadata, rhbz#1668033 + +* Mon Dec 17 2018 sguelton@redhat.com - 7.0.1-1 +- 7.0.1 release + +* Tue Dec 04 2018 sguelton@redhat.com - 7.0.0-5 +- Ensure rpmlint passes on specfile + +* Sat Nov 17 2018 Tom Stellard - 7.0.0-4 +- Install testing libraries for unittests + +* Sat Oct 27 2018 Tom Stellard - 7.0.0-3 +- Fix running unittests as not-root user + +* Thu Sep 27 2018 Tom Stellard - 7.0.0-2 +- Fixes for llvm-test package: +- Add some missing Requires +- Add --threads option to run-lit-tests script +- Set PATH so lit can find tools like count, not, etc. +- Don't hardcode tools directory to /usr/lib64/llvm +- Fix typo in yaml-bench define +- Only print information about failing tests + +* Fri Sep 21 2018 Tom Stellard - 7.0.0-1 +- 7.0.0 Release + +* Thu Sep 13 2018 Tom Stellard - 7.0.0-0.15.rc3 +- Disable rpath on install LLVM and related sub-projects + +* Wed Sep 12 2018 Tom Stellard - 7.0.0-0.14.rc3 +- Remove rpath from executables and libraries + +* Tue Sep 11 2018 Tom Stellard - 7.0.0-0.13.rc3 +- Re-enable arm and aarch64 targets on x86_64 + +* Mon Sep 10 2018 Tom Stellard - 7.0.0-0.12.rc3 +- 7.0.0-rc3 Release + +* Fri Sep 07 2018 Tom Stellard - 7.0.0-0.11.rc2 +- Use python3 shebang for opt-viewewr scripts + +* Thu Aug 30 2018 Tom Stellard - 7.0.0-0.10.rc2 +- Drop all uses of python2 from lit tests + +* Thu Aug 30 2018 Tom Stellard - 7.0.0-0.9.rc2 +- Build the gold plugin on all supported architectures + +* Wed Aug 29 2018 Kevin Fenzi - 7.0.0-0.8.rc2 +- Re-enable debuginfo to avoid 25x size increase. + +* Tue Aug 28 2018 Tom Stellard - 7.0.0-0.7.rc2 +- 7.0.0-rc2 Release + +* Tue Aug 28 2018 Tom Stellard - 7.0.0-0.6.rc1 +- Guard valgrind usage with valgrind_arches macro + +* Thu Aug 23 2018 Tom Stellard - 7.0.0-0.5.rc1 +- Package lit tests and googletest sources. + +* Mon Aug 20 2018 Tom Stellard - 7.0.0-0.4.rc1 +- Re-enable AMDGPU target on ARM rhbz#1618922 + +* Mon Aug 13 2018 Tom Stellard - 7.0.0-0.3.rc1 +- Drop references to TestPlugin.so from cmake files + +* Fri Aug 10 2018 Tom Stellard - 7.0.0-0.2.rc1 +- Fixes for lit tests + +* Fri Aug 10 2018 Tom Stellard - 7.0.0-0.1.rc1 +- 7.0.0-rc1 Release +- Reduce number of enabled targets on all arches. +- Drop s390 detection patch, LLVM does not support s390 codegen. + +* Mon Aug 06 2018 Tom Stellard - 6.0.1-6 +- Backport some fixes needed by mesa and rust + +* Thu Jul 26 2018 Tom Stellard - 6.0.1-5 +- Move libLLVM-6.0.so to llvm6.0-libs. + +* Mon Jul 23 2018 Tom Stellard - 6.0.1-4 +- Rebuild because debuginfo stripping failed with the previous build + +* Fri Jul 13 2018 Tom Stellard - 6.0.1-3 +- Sync specfile with llvm6.0 package + +* Fri Jul 13 2018 Fedora Release Engineering - 6.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 25 2018 Tom Stellard - 6.0.1-1 +- 6.0.1 Release + +* Thu Jun 07 2018 Tom Stellard - 6.0.1-0.4.rc2 +- 6.0.1-rc2 + +* Wed Jun 06 2018 Tom Stellard - 6.0.1-0.3.rc1 +- Re-enable all targets to avoid breaking the ABI. + +* Mon Jun 04 2018 Tom Stellard - 6.0.1-0.2.rc1 +- Reduce the number of enabled targets based on the architecture + +* Thu May 10 2018 Tom Stellard - 6.0.1-0.1.rc1 +- 6.0.1 rc1 + +* Tue Mar 27 2018 Tom Stellard - 6.0.0-11 +- Re-enable arm tests that used to hang + +* Thu Mar 22 2018 Tom Stellard - 6.0.0-10 +- Fix testcase in backported patch + +* Tue Mar 20 2018 Tom Stellard - 6.0.0-9 +- Prevent external projects from linking against both static and shared + libraries. rhbz#1558657 + +* Mon Mar 19 2018 Tom Stellard - 6.0.0-8 +- Backport r327651 from trunk rhbz#1554349 + +* Fri Mar 16 2018 Tom Stellard - 6.0.0-7 +- Filter out cxxflags and cflags from llvm-config that aren't supported by clang +- rhbz#1556980 + +* Wed Mar 14 2018 Tom Stellard - 6.0.0-6 +- Enable symbol versioning in libLLVM.so + +* Wed Mar 14 2018 Tom Stellard - 6.0.0-5 +- Stop statically linking libstdc++. This is no longer required by Steam + client, but the steam installer still needs a work-around which should + be handled in the steam package. +* Wed Mar 14 2018 Tom Stellard - 6.0.0-4 +- s/make check/ninja check/ + +* Fri Mar 09 2018 Tom Stellard - 6.0.0-3 +- Backport fix for compile time regression on rust rhbz#1552915 + +* Thu Mar 08 2018 Tom Stellard - 6.0.0-2 +- Build with Ninja: This reduces RPM build time on a 6-core x86_64 builder + from 82 min to 52 min. + +* Thu Mar 08 2018 Tom Stellard - 6.0.0-1 +- 6.0.0 Release + +* Thu Mar 08 2018 Tom Stellard - 6.0.0-0.5.rc2 +- Reduce debuginfo size on i686 to avoid OOM errors during linking + +* Fri Feb 09 2018 Tom Stellard - 6.0.0-0.4.rc2 +- 6.0.1 rc2 + +* Fri Feb 09 2018 Igor Gnatenko - 6.0.0-0.3.rc1 +- Escape macros in %%changelog + +* Thu Feb 08 2018 Fedora Release Engineering - 6.0.0-0.2.rc1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Jan 19 2018 Tom Stellard - 6.0.0-0.1.rc1 +- 6.0.1 rc1 + +* Tue Dec 19 2017 Tom Stellard - 5.0.1-1 +- 5.0.1 Release + +* Mon Nov 20 2017 Tom Stellard - 5.0.0-5 +- Backport debuginfo fix for rust + +* Fri Nov 03 2017 Tom Stellard - 5.0.0-4 +- Reduce debuginfo size for ARM + +* Tue Oct 10 2017 Tom Stellard - 5.0.0-2 +- Reduce memory usage on ARM by disabling debuginfo and some non-ARM targets. + +* Mon Sep 25 2017 Tom Stellard - 5.0.0-1 +- 5.0.0 Release + +* Mon Sep 18 2017 Tom Stellard - 4.0.1-6 +- Add Requires: libedit-devel for llvm-devel + +* Fri Sep 08 2017 Tom Stellard - 4.0.1-5 +- Enable libedit backend for LineEditor API + +* Fri Aug 25 2017 Tom Stellard - 4.0.1-4 +- Enable extra functionality when run the LLVM JIT under valgrind. + +* Thu Aug 03 2017 Fedora Release Engineering - 4.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 4.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jun 21 2017 Tom Stellard - 4.0.1-1 +- 4.0.1 Release + +* Thu Jun 15 2017 Tom Stellard - 4.0.0-6 +- Install llvm utils + +* Thu Jun 08 2017 Tom Stellard - 4.0.0-5 +- Fix docs-llvm-man target + +* Mon May 01 2017 Tom Stellard - 4.0.0-4 +- Make cmake files no longer depend on static libs (rhbz 1388200) + +* Tue Apr 18 2017 Josh Stone - 4.0.0-3 +- Fix computeKnownBits for ARMISD::CMOV (rust-lang/llvm#67) + +* Mon Apr 03 2017 Tom Stellard - 4.0.0-2 +- Simplify spec with rpm macros. + +* Thu Mar 23 2017 Tom Stellard - 4.0.0-1 +- LLVM 4.0.0 Final Release + +* Wed Mar 22 2017 tstellar@redhat.com - 3.9.1-6 +- Fix %%postun sep for -devel package. + +* Mon Mar 13 2017 Tom Stellard - 3.9.1-5 +- Disable failing tests on ARM. + +* Sun Mar 12 2017 Peter Robinson 3.9.1-4 +- Fix missing mask on relocation for aarch64 (rhbz 1429050) + +* Wed Mar 01 2017 Dave Airlie - 3.9.1-3 +- revert upstream radeonsi breaking change. + +* Thu Feb 23 2017 Josh Stone - 3.9.1-2 +- disable sphinx warnings-as-errors + +* Fri Feb 10 2017 Orion Poplawski - 3.9.1-1 +- llvm 3.9.1 + +* Fri Feb 10 2017 Fedora Release Engineering - 3.9.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Nov 29 2016 Josh Stone - 3.9.0-7 +- Apply backports from rust-lang/llvm#55, #57 + +* Tue Nov 01 2016 Dave Airlie - 3.9.0-5 +- apply the patch from -4 + +* Wed Oct 26 2016 Dave Airlie - 3.9.0-4 +- add fix for lldb out-of-tree build + +* Mon Oct 17 2016 Josh Stone - 3.9.0-3 +- Apply backports from rust-lang/llvm#47, #48, #53, #54 + +* Sat Oct 15 2016 Josh Stone - 3.9.0-2 +- Apply an InstCombine backport via rust-lang/llvm#51 + +* Wed Sep 07 2016 Dave Airlie - 3.9.0-1 +- llvm 3.9.0 +- upstream moved where cmake files are packaged. +- upstream dropped CppBackend + +* Wed Jul 13 2016 Adam Jackson - 3.8.1-1 +- llvm 3.8.1 +- Add mips target +- Fix some shared library mispackaging + +* Tue Jun 07 2016 Jan Vcelak - 3.8.0-2 +- fix color support detection on terminal + +* Thu Mar 10 2016 Dave Airlie 3.8.0-1 +- llvm 3.8.0 release + +* Wed Mar 09 2016 Dan Horák 3.8.0-0.3 +- install back memory consumption workaround for s390 + +* Thu Mar 03 2016 Dave Airlie 3.8.0-0.2 +- llvm 3.8.0 rc3 release + +* Fri Feb 19 2016 Dave Airlie 3.8.0-0.1 +- llvm 3.8.0 rc2 release + +* Tue Feb 16 2016 Dan Horák 3.7.1-7 +- recognize s390 as SystemZ when configuring build + +* Sat Feb 13 2016 Dave Airlie 3.7.1-6 +- export C++ API for mesa. + +* Sat Feb 13 2016 Dave Airlie 3.7.1-5 +- reintroduce llvm-static, clang needs it currently. + +* Fri Feb 12 2016 Dave Airlie 3.7.1-4 +- jump back to single llvm library, the split libs aren't working very well. + +* Fri Feb 05 2016 Dave Airlie 3.7.1-3 +- add missing obsoletes (#1303497) + +* Thu Feb 04 2016 Fedora Release Engineering - 3.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 07 2016 Jan Vcelak 3.7.1-1 +- new upstream release +- enable gold linker + +* Wed Nov 04 2015 Jan Vcelak 3.7.0-100 +- fix Requires for subpackages on the main package + +* Tue Oct 06 2015 Jan Vcelak 3.7.0-100 +- initial version using cmake build system diff --git a/check.spec.inc b/check.spec.inc new file mode 100644 index 0000000..d231443 --- /dev/null +++ b/check.spec.inc @@ -0,0 +1,205 @@ +# TODO(kkleine): Instead of deleting test files we should mark them as expected +# to fail. See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-xfail + +# Disable check section on arm due to some kind of memory related failure. +# Possibly related to https://bugzilla.redhat.com/show_bug.cgi?id=1920183 +%ifnarch %{arm} + +# TODO: Fix the failures below +%ifarch %{arm} +rm llvm/test/tools/llvm-readobj/ELF/dependent-libraries.test +%endif +%ifarch ppc64le +# TODO: Re-enable when ld.gold fixed its internal error. +rm llvm/test/tools/gold/PowerPC/mtriple.ll +%endif + +# non reproducible errors +# TODO(kkleine): Add this to XFAIL instead? +rm llvm/test/tools/dsymutil/X86/swift-interface.test + +%if %{with check} + +# See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-xfail +export LIT_XFAIL="" + +# See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-filter-out +# Unfortunately LIT_FILTER_OUT is not accepting a list but a regular expression. +# To make this easily maintainable, we'll create an associate array in bash, +# to which you can append and later we'll join that array and escpate dots (".") +# in your test paths. +declare -a filter_out_tests + +#region LLVM xfail tests + +# Xfail testing of update utility tools +# LLVM :: +export LIT_XFAIL="$LIT_XFAIL;tools/UpdateTestChecks" + +#endregion + +#region CLANG xfail tests + +# Clang :: +export LIT_XFAIL="$LIT_XFAIL;clang/test/CodeGen/profile-filter.c" + +#endregion + +#region OPENMP xfail tests + +# TODO(kkleine): OpenMP tests are currently not run on rawhide (see https://bugzilla.redhat.com/show_bug.cgi?id=2252966): +# +# + /usr/bin/cmake --build redhat-linux-build -j6 --verbose --target check-openmp +# Change Dir: '/builddir/build/BUILD/openmp-17.0.6.src/redhat-linux-build' +# Run Build Command(s): /usr/bin/ninja-build -v -j 6 check-openmp +# [1/1] cd /builddir/build/BUILD/openmp-17.0.6.src/redhat-linux-build && /usr/bin/cmake -E echo check-openmp\ does\ nothing,\ dependencies\ not\ found. +# +# We're marking the tests that are failing with the follwing error as expected to fail (XFAIL): +# +# gdb.error: No symbol "ompd_sizeof____kmp_gtid" in current context +# +# NOTE: It could be a different symbol in some tests. +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_curr_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_enclosing_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_generating_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_icv_from_scope.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_scheduling_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_state.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_frame.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_function.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_in_parallel.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_id.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_in_parallel.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_parallel_handle_compare.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_rel_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_rel_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_rel_thread_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_task_handle_compare.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_thread_handle_compare.c" +export LIT_XFAIL="$LIT_XFAIL;openmp_examples/ompd_icvs.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_curr_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_display_control_vars.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_handle.c" + +# The following test is flaky and we'll filter it out +filter_out_tests+=("libomp :: ompt/teams/distribute_dispatch.c") + +# The following tests seem pass on ppc64le and x86_64 only: +%ifnarch ppc64le x86_64 +# Passes on ppc64le: +# libomptarget :: powerpc64le-ibm-linux-gnu :: mapping/target_derefence_array_pointrs.cpp +# libomptarget :: powerpc64le-ibm-linux-gnu-LTO :: mapping/target_derefence_array_pointrs.cpp +# Passes on x86_64: +# libomptarget :: x86_64-pc-linux-gnu :: mapping/target_derefence_array_pointrs.cpp +# libomptarget :: x86_64-pc-linux-gnu-LTO :: mapping/target_derefence_array_pointrs.cpp +export LIT_XFAIL="$LIT_XFAIL;mapping/target_derefence_array_pointrs.cpp" +%endif + +%ifnarch x86_64 +# Passes on x86_64: +# libomptarget :: x86_64-pc-linux-gnu :: api/ompx_3d.c +# libomptarget :: x86_64-pc-linux-gnu :: api/ompx_3d.cpp +# libomptarget :: x86_64-pc-linux-gnu-LTO :: api/ompx_3d.c +# libomptarget :: x86_64-pc-linux-gnu-LTO :: api/ompx_3d.cpp +# libomptarget :: aarch64-unknown-linux-gnu :: +export LIT_XFAIL="$LIT_XFAIL;api/ompx_3d.c" +export LIT_XFAIL="$LIT_XFAIL;api/ompx_3d.cpp" +%endif + +%ifarch %ix86 +# Clang Tools :: clang-tidy/checkers/altera/struct-pack-align.cpp +export LIT_XFAIL="$LIT_XFAIL;clang-tidy/checkers/altera/struct-pack-align.cpp" +%endif + +%ifarch ppc64le +export LIT_XFAIL="$LIT_XFAIL;barrier/barrier.c" +export LIT_XFAIL="$LIT_XFAIL;critical/critical.c" +export LIT_XFAIL="$LIT_XFAIL;critical/lock-nested.c" +export LIT_XFAIL="$LIT_XFAIL;critical/lock.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-firstprivate.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-nosuppression.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-simple.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-simple2.c" +export LIT_XFAIL="$LIT_XFAIL;races/critical-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/lock-nested-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/lock-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/parallel-simple.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-dependency.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-taskgroup-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-taskwait-nested.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-two.c" +export LIT_XFAIL="$LIT_XFAIL;races/taskwait-depend.c" +export LIT_XFAIL="$LIT_XFAIL;reduction/parallel-reduction-nowait.c" +export LIT_XFAIL="$LIT_XFAIL;reduction/parallel-reduction.c" +export LIT_XFAIL="$LIT_XFAIL;task/omp_task_depend_all.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-barrier.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-create.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-dependency.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskgroup-nested.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskgroup.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskwait-nested.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskwait.c" +export LIT_XFAIL="$LIT_XFAIL;task/task_early_fulfill.c" +export LIT_XFAIL="$LIT_XFAIL;task/task_late_fulfill.c" +export LIT_XFAIL="$LIT_XFAIL;task/taskwait-depend.c" +export LIT_XFAIL="$LIT_XFAIL;worksharing/ordered.c" +export LIT_XFAIL="$LIT_XFAIL;api/omp_dynamic_shared_memory.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl1.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl2.c" +export LIT_XFAIL="$LIT_XFAIL;jit/type_punning.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/barrier_fence.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/bug49334.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/default_thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_bare.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_coords.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_saxpy_mixed.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count_thread_limit.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/spmdization.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/target_critical_region.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_1.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_2.c" +export LIT_XFAIL="$LIT_XFAIL;api/omp_dynamic_shared_memory.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl1.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl2.c" +export LIT_XFAIL="$LIT_XFAIL;jit/type_punning.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/barrier_fence.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/bug49334.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/default_thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_bare.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_coords.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_saxpy_mixed.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count_thread_limit.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/spmdization.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/target_critical_region.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_1.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_2.c" +%endif + +#endregion + +# Prepare LIT_FILTER_OUT regex from index bash array +# Join each element with a pipe symbol (regex for "or") +filter_out_tests=$(printf "|%s" "${filter_out_tests[@]}") +# Remove the initial pipe symbol +filter_out_tests=${filter_out_tests:1} +# Properly escape path dots (".") for use in regular expression +filter_out_tests=$(echo $filter_out_tests | sed 's/\./\\./') +# Add enclosing parenthesis +export LIT_FILTER_OUT="($filter_out_tests)" + + +export LIT_OPTS="-vv" + +export LD_LIBRARY_PATH="%{buildroot}/%{install_libdir}:%{buildroot}/%{_libdir}"; + +cd llvm +%cmake_build --target check-all + +%endif + +%endif diff --git a/files.spec.inc b/files.spec.inc new file mode 100644 index 0000000..e8509e2 --- /dev/null +++ b/files.spec.inc @@ -0,0 +1,295 @@ +#region LLVM files + +%files -n %{pkg_name_llvm} +%license llvm/LICENSE.TXT +%exclude %{_mandir}/man1/llvm-config* +%{_mandir}/man1/* +%{_bindir}/* + +%exclude %{_bindir}/llvm-config%{exec_suffix} +%exclude %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + +%if %{without compat_build} +%exclude %{_bindir}/llvm-config-%{maj_ver} +%exclude %{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%exclude %{_bindir}/not +%exclude %{_bindir}/count +%exclude %{_bindir}/yaml-bench +%exclude %{_bindir}/lli-child-target +%exclude %{_bindir}/llvm-isel-fuzzer +%exclude %{_bindir}/llvm-opt-fuzzer +%{_datadir}/opt-viewer +%else +%{install_bindir} +%endif + +%files -n %{pkg_name_llvm}-libs +%license llvm/LICENSE.TXT +%{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix:%{llvm_snapshot_version_suffix}}.so +%if %{without compat_build} +%if %{with gold} +%{_libdir}/LLVMgold.so +%{_libdir}/bfd-plugins/LLVMgold.so +%endif +%{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so +%{_libdir}/libLTO.so* +%else +%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{pkg_name_llvm}-%{_arch}.conf +%if %{with gold} +%{_libdir}/%{pkg_name_clang}/lib/LLVMgold.so +%endif +%{install_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so +%{install_libdir}/libLTO.so* +%exclude %{install_libdir}/libLTO.so +%endif +%{install_libdir}/libRemarks.so* + +%files -n %{pkg_name_llvm}-devel +%license llvm/LICENSE.TXT + +%ghost %{_bindir}/llvm-config%{exec_suffix} +%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%{_mandir}/man1/llvm-config* + +%{install_includedir}/llvm +%{install_includedir}/llvm-c +%{install_libdir}/libLLVM.so +%{install_libdir}/cmake/llvm +%if %{without compat_build} +%{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%ghost %{_bindir}/llvm-config-%{maj_ver} +%else +%{pkg_includedir}/llvm +%{pkg_includedir}/llvm-c +%{install_libdir}/libLTO.so +%endif + +%files -n %{pkg_name_llvm}-doc +%license llvm/LICENSE.TXT +%doc %{_pkgdocdir}/html + +%files -n %{pkg_name_llvm}-static +%license llvm/LICENSE.TXT +%{install_libdir}/*.a +%if %{without compat_build} +%exclude %{install_libdir}/libLLVMTestingSupport.a +%exclude %{install_libdir}/libLLVMTestingAnnotations.a +%exclude %{install_libdir}/libllvm_gtest.a +%exclude %{install_libdir}/libllvm_gtest_main.a +%endif + +%files -n %{pkg_name_llvm}-cmake-utils +%license llvm/LICENSE.TXT +%{pkg_datadir}/llvm/cmake + +%if %{without compat_build} + +%files -n %{pkg_name_llvm}-test +%license llvm/LICENSE.TXT +%{_bindir}/not +%{_bindir}/count +%{_bindir}/yaml-bench +%{_bindir}/lli-child-target +%{_bindir}/llvm-isel-fuzzer +%{_bindir}/llvm-opt-fuzzer + +%files -n %{pkg_name_llvm}-googletest +%license llvm/LICENSE.TXT +%{install_libdir}/libLLVMTestingSupport.a +%{install_libdir}/libLLVMTestingAnnotations.a +%{install_libdir}/libllvm_gtest.a +%{install_libdir}/libllvm_gtest_main.a +%{install_includedir}/llvm-gtest +%{install_includedir}/llvm-gmock + +%endif + +#endregion + +#region CLANG files + +%if %{without compat_build} +%files -n %{pkg_name_clang} +%license clang/LICENSE.TXT +%{_bindir}/clang +%{_bindir}/clang++ +%{_bindir}/clang-%{maj_ver} +%{_bindir}/clang++-%{maj_ver} +%{_bindir}/clang-cl +%{_bindir}/clang-cpp +%{_mandir}/man1/clang.1.gz +%{_mandir}/man1/clang++.1.gz +%{_mandir}/man1/clang-%{maj_ver}.1.gz +%{_mandir}/man1/clang++-%{maj_ver}.1.gz +%endif + +%files -n %{pkg_name_clang}-libs +%{install_prefix}/lib/clang/%{maj_ver}/include/* +%{install_libdir}/*.so.* + +%files -n %{pkg_name_clang}-devel +%if %{without compat_build} +%{_libdir}/*.so +%{_includedir}/clang/ +%{_includedir}/clang-c/ +%{_libdir}/cmake/* +%{_bindir}/clang-tblgen +%dir %{_datadir}/clang/ +%{_rpmmacrodir}/macros.%{pkg_name_clang} +%else +%{install_libdir}/*.so +%{pkg_includedir}/clang/ +%{pkg_includedir}/clang-c/ +%{install_libdir}/cmake/ +%endif + +%files -n %{pkg_name_clang}-resource-filesystem +%dir %{install_libdir}/clang/ +%dir %{install_libdir}/clang/%{maj_ver}/ +%dir %{install_libdir}/clang/%{maj_ver}/include/ +%dir %{install_libdir}/clang/%{maj_ver}/lib/ +%dir %{install_libdir}/clang/%{maj_ver}/share/ + +%if %{without compat_build} +%files -n %{pkg_name_clang}-analyzer +%{_bindir}/scan-view +%{_bindir}/scan-build +%{_bindir}/analyze-build +%{_bindir}/intercept-build +%{_bindir}/scan-build-py +%{_libexecdir}/ccc-analyzer +%{_libexecdir}/c++-analyzer +%{_libexecdir}/analyze-c++ +%{_libexecdir}/analyze-cc +%{_libexecdir}/intercept-c++ +%{_libexecdir}/intercept-cc +%{_datadir}/scan-view/ +%{_datadir}/scan-build/ +%{_mandir}/man1/scan-build.1.* +%{python3_sitelib}/libear +%{python3_sitelib}/libscanbuild + + +%files -n %{pkg_name_clang}-tools-extra +%{_bindir}/amdgpu-arch +%{_bindir}/clang-apply-replacements +%{_bindir}/clang-change-namespace +%{_bindir}/clang-check +%{_bindir}/clang-doc +%{_bindir}/clang-extdef-mapping +%{_bindir}/clang-format +%{_bindir}/clang-include-cleaner +%{_bindir}/clang-include-fixer +%{_bindir}/clang-move +%{_bindir}/clang-offload-bundler +%{_bindir}/clang-offload-packager +%{_bindir}/clang-linker-wrapper +%{_bindir}/clang-pseudo +%{_bindir}/clang-query +%{_bindir}/clang-refactor +%{_bindir}/clang-rename +%{_bindir}/clang-reorder-fields +%{_bindir}/clang-repl +%{_bindir}/clang-scan-deps +%{_bindir}/clang-tidy +%{_bindir}/clangd +%{_bindir}/diagtool +%{_bindir}/hmaptool +%{_bindir}/nvptx-arch +%{_bindir}/pp-trace +%{_bindir}/c-index-test +%{_bindir}/find-all-symbols +%{_bindir}/modularize +%{_bindir}/clang-format-diff +%{_mandir}/man1/diagtool.1.gz +%{_emacs_sitestartdir}/clang-format.el +%{_emacs_sitestartdir}/clang-rename.el +%{_emacs_sitestartdir}/clang-include-fixer.el +%{_datadir}/clang/clang-format.py* +%{_datadir}/clang/clang-format-diff.py* +%{_datadir}/clang/clang-include-fixer.py* +%{_datadir}/clang/clang-tidy-diff.py* +%{_bindir}/run-clang-tidy +%{_datadir}/clang/run-find-all-symbols.py* +%{_datadir}/clang/clang-rename.py* + +%files -n %{pkg_name_clang}-tools-extra-devel +%{_includedir}/clang-tidy/ + +%files -n git-clang-format +%{_bindir}/git-clang-format + +%files -n python3-clang +%{python3_sitelib}/clang/ +%endif + +#endregion + +#region COMPILER-RT files + +%if %{without compat_build} + +%files -n %{pkg_name_compiler_rt} +%license compiler-rt/LICENSE.TXT +%ifarch x86_64 aarch64 +%{_prefix}/lib/clang/%{maj_ver}/bin/* +%endif +%{_prefix}/lib/clang/%{maj_ver}/include/* +%{_prefix}/lib/clang/%{maj_ver}/lib/* +%{_prefix}/lib/clang/%{maj_ver}/share/* +#%ifarch x86_64 aarch64 +#{_bindir}/hwasan_symbolize +#%endif + +%endif + +#endregion + +#region OPENMP files + +%if %{without compat_build} + +%files -n %{pkg_name_libomp} +%license openmp/LICENSE.TXT +%{_libdir}/libomp.so +%{_libdir}/libompd.so +%ifnarch %{arm} +%{_libdir}/libarcher.so +%endif +%ifnarch %{ix86} %{arm} +# libomptarget is not supported on 32-bit systems. +# s390x does not support the offloading plugins. +%ifnarch s390x +%{_libdir}/libomptarget.rtl.amdgpu.so.%{so_suffix} +%{_libdir}/libomptarget.rtl.cuda.so.%{so_suffix} +%{_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{so_suffix} +%endif +%{_libdir}/libomptarget.so.%{so_suffix} +%endif + +%files -n %{pkg_name_libomp}-devel +%{_prefix}/lib/clang/%{maj_ver}/include/omp.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompx.h +%ifnarch %{arm} +%{_prefix}/lib/clang/%{maj_ver}/include/omp-tools.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompt.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h +%endif +%{_libdir}/cmake/openmp/FindOpenMPTarget.cmake +%ifnarch %{ix86} %{arm} +# libomptarget is not supported on 32-bit systems. +# s390x does not support the offloading plugins. +%ifnarch s390x +%{_libdir}/libomptarget.rtl.amdgpu.so +%{_libdir}/libomptarget.rtl.cuda.so +%{_libdir}/libomptarget.rtl.%{libomp_arch}.so +%endif +%{_libdir}/libomptarget.devicertl.a +%{_libdir}/libomptarget-amdgpu-*.bc +%{_libdir}/libomptarget-nvptx-*.bc +%{_libdir}/libomptarget.so +%endif + +%endif + +#endregion diff --git a/globals.spec.inc b/globals.spec.inc new file mode 100644 index 0000000..4e4e2b0 --- /dev/null +++ b/globals.spec.inc @@ -0,0 +1,136 @@ +%bcond_without snapshot_build +# Components enabled if supported by target architecture: +%define gold_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x +%ifarch %{gold_arches} + %bcond_without gold +%else + %bcond_with gold +%endif +%bcond_with compat_build +%bcond_without check + +# We are building with clang for faster/lower memory LTO builds. +# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros +%global toolchain clang + +# Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer +# https://bugzilla.redhat.com/show_bug.cgi?id=2158587 +%undefine _include_frame_pointers + +# Suffixless tarball name (essentially: basename -s .tar.xz llvm-project-17.0.6.src.tar.xz) +%global src_tarball_dir llvm-project-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src + +%global _lto_cflags -flto=thin + +#region LLVM globals + +%if %{with compat_build} +%global pkg_name_llvm llvm%{maj_ver} +%global exec_suffix -%{maj_ver} +%global install_prefix %{_libdir}/%{pkg_name_llvm} +%global install_bindir %{install_prefix}/bin +%global install_includedir %{install_prefix}/include +%global install_libdir %{install_prefix}/lib + +%global pkg_includedir %{_includedir}/%{pkg_name_llvm} +%global pkg_datadir %{install_prefix}/share +%else +%global pkg_name_llvm llvm +%global install_prefix /usr +%global install_bindir %{_bindir} +%global install_libdir %{_libdir} +%global install_includedir %{_includedir} +%global pkg_datadir %{_datadir} +%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 "" +%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 +%global llvm_triple %{_target_platform} +%endif + +# 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 + +#endregion + +#region CLANG globals + +%global pkg_name_clang clang + +%if %{with compat_build} +%global pkg_name_clang clang%{maj_ver} +# Install clang to same prefix as llvm, so that apps that use llvm-config +# will also be able to find clang libs. +%global pkg_includedir %{install_prefix}/include +%endif + +%ifarch ppc64le +# Too many threads on ppc64 systems causes OOM errors. +# TODO(kkleine): Is this really needed when building together with llvm? +%global _smp_mflags -j8 +%endif + +#endregion + +#region COMPILER-RT globals + +%if %{without compat_build} + +%global pkg_name_compiler_rt compiler-rt + +# TODO(kkleine): do these optflags hurt llvm and/or clang? + +# see https://sourceware.org/bugzilla/show_bug.cgi?id=25271 +%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE) + +# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93615 +%global optflags %(echo %{optflags} -Dasm=__asm__) + +# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. +# export ASMFLAGS=$CFLAGS + +%endif + +#endregion + +#region OPENMP globals + +%if %{without compat_build} + +%global pkg_name_libomp libomp + +%global so_suffix %{maj_ver} + +%if %{with snapshot_build} +%global so_suffix %{maj_ver}%{llvm_snapshot_version_suffix} +%endif + +%ifarch ppc64le +%global libomp_arch ppc64 +%else +%global libomp_arch %{_arch} +%endif + +%endif + +#endregion diff --git a/install.spec.inc b/install.spec.inc new file mode 100644 index 0000000..7a96b0e --- /dev/null +++ b/install.spec.inc @@ -0,0 +1,226 @@ +#region LLVM installation + +cd llvm + +%cmake_install + +cd - + +mkdir -p %{buildroot}/%{_bindir} + +%if %{without compat_build} + +# Fix some man pages +ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1 + +# Install binaries needed for lit tests +%global test_binaries llvm-isel-fuzzer llvm-opt-fuzzer + +for f in %{test_binaries} +do + install -m 0755 llvm/%{_vpath_builddir}/bin/$f %{buildroot}%{_bindir} +done + +%multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h + +# Install libraries needed for unittests +%global build_libdir llvm/%{_vpath_builddir}/%{_lib} + +install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir} +install %{build_libdir}/libLLVMTestingAnnotations.a %{buildroot}%{_libdir} + +%if %{with gold} +# Add symlink to lto plugin in the binutils plugin directory. +%{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/ +ln -s -t %{buildroot}%{_libdir}/bfd-plugins/ ../LLVMgold.so +%endif + +%else + +# Add version suffix to binaries +for f in %{buildroot}/%{install_bindir}/*; do + filename=`basename $f` + ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} +done + +# Move header files +mkdir -p %{buildroot}/%{pkg_includedir} +ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm +ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c + +# Fix multi-lib +%multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h + +# Create ld.so.conf.d entry +mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d +cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{pkg_name_llvm}-%{_arch}.conf << EOF +%{install_libdir} +EOF + +# Add version suffix to man pages and move them to mandir. +mkdir -p %{buildroot}/%{_mandir}/man1 +for f in %{build_install_prefix}/share/man/man1/*; do + filename=`basename $f | cut -f 1 -d '.'` + mv $f %{buildroot}%{_mandir}/man1/$filename%{exec_suffix}.1 +done + +# Remove opt-viewer, since this is just a compatibility package. +rm -Rf %{build_install_prefix}/share/opt-viewer + +%endif + +# llvm-config special casing. llvm-config is managed by update-alternatives. +# the original file must remain available for compatibility with the CMake +# infrastructure. Without compat, cmake points to the symlink, with compat it +# points to the original file. + +%if %{without compat_build} + +mv %{buildroot}/%{install_bindir}/llvm-config %{buildroot}/%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +# We still maintain a versionned symlink for consistency across llvm versions. +# This is specific to the non-compat build and matches the exec prefix for +# compat builds. An isa-agnostic versionned symlink is also maintained in the (un)install +# steps. +(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} + +%else + +rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) + +%endif + +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} + +mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake +cp -Rv cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake + +cd .. + +#endregion + +#region CLANG installation + +%if %{with compat_build} + +# Remove binaries/other files +rm -Rf %{buildroot}%{install_bindir} +rm -Rf %{buildroot}%{install_prefix}/share +rm -Rf %{buildroot}%{install_prefix}/libexec +# Remove scanview-py helper libs +rm -Rf %{buildroot}%{install_prefix}/lib/{libear,libscanbuild} + +%else + +# File in the macros file for other packages to use. We are not doing this +# in the compat package, because the version macros would # conflict with +# eachother if both clang and the clang compat package were installed together. +install -p -m0644 -D %{SOURCE2005} %{buildroot}%{_rpmmacrodir}/macros.%{pkg_name_clang} +sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \ + -e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \ + -e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \ + %{buildroot}%{_rpmmacrodir}/macros.%{pkg_name_clang} + +# install clang python bindings +mkdir -p %{buildroot}%{python3_sitelib}/clang/ +# If we don't default to true here, we'll see this error: +# install: omitting directory 'bindings/python/clang/__pycache__' +# NOTE: this only happens if we include the gdb plugin of libomp. +# Remove the plugin with command and we're good: rm -rf %{buildroot}/%{_datarootdir}/gdb +install -p -m644 clang/bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/ || true +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang + +# install scanbuild-py to python sitelib. +mv %{buildroot}%{_prefix}/%{_lib}/{libear,libscanbuild} %{buildroot}%{python3_sitelib} +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/{libear,libscanbuild} + +# Fix permissions of scan-view scripts +chmod a+x %{buildroot}%{_datadir}/scan-view/{Reporter.py,startfile.py} + +# multilib fix +%multilib_fix_c_header --file %{_includedir}/clang/Config/config.h + +# Move emacs integration files to the correct directory +mkdir -p %{buildroot}%{_emacs_sitestartdir} +for f in clang-format.el clang-rename.el clang-include-fixer.el; do +mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f +done + +# remove editor integrations (bbedit, sublime, emacs, vim) +rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript +rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py* + +# TODO: Package html docs +rm -Rvf %{buildroot}%{_docdir}/LLVM/clang/html +rm -Rvf %{buildroot}%{_docdir}/LLVM/clang-tools/html +rm -Rvf %{buildroot}%{_datadir}/clang/clang-doc-default-stylesheet.css +rm -Rvf %{buildroot}%{_datadir}/clang/index.js + +# TODO: What are the Fedora guidelines for packaging bash autocomplete files? +rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh + +# Create Manpage symlinks +ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang++.1.gz +ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang-%{maj_ver}.1.gz +ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang++-%{maj_ver}.1.gz + +# Add clang++-{version} symlink +ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver} + + +# Fix permission +chmod u-x %{buildroot}%{_mandir}/man1/scan-build.1* + +%endif + +# Create sub-directories in the clang resource directory that will be +# populated by other packages +mkdir -p %{buildroot}%{install_libdir}/clang/%{maj_ver}/{include,lib,share}/ + + +%if %{without compat_build} +# Add a symlink in /usr/bin to clang-format-diff +ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff +%endif + +# Install config file for clang +%if %{maj_ver} >=18 +mkdir -p %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/ +echo "--gcc-triple=%{_arch}-redhat-linux" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/clang.cfg +%endif + +#endregion + +#region COMPILER-RT installation + +%if %{without compat_build} + +%ifarch ppc64le +# Fix install path on ppc64le so that the directory name matches the triple used +# by clang. +mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/ppc64le-redhat-linux-gnu +%endif + +%endif + +#endregion + +#region OPENMP installation + +%if %{without compat_build} + +# Remove static libraries with equivalent shared libraries +rm -rf %{buildroot}%{_libdir}/libarcher_static.a + +# Remove the openmp gdb plugin for now +rm -rf %{buildroot}/%{_datarootdir}/gdb +# # TODO(kkleine): These was added to avoid a permission issue +# chmod go+w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so +# chmod +w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so + +%endif + +#endregion diff --git a/llvm.rpmlintrc b/llvm.rpmlintrc index 7ae23e2..5f98c56 100644 --- a/llvm.rpmlintrc +++ b/llvm.rpmlintrc @@ -1,3 +1,5 @@ +## LLVM ############################################################# + # This library has no dependencies. addFilter("llvm-libs.x86_64: E: shared-lib-without-dependency-information /usr/lib64/libRemarks.so.[0-9]+") addFilter("llvm-googletest.x86_64: W: devel-file-in-non-devel-package") @@ -16,3 +18,32 @@ addFilter("llvm-googletest.x86_64: W: no-documentation") addFilter("llvm-libs.x86_64: W: no-documentation") addFilter("llvm-static.x86_64: W: no-documentation") addFilter("llvm-test.x86_64: W: no-documentation") + +## COMPILER-RT ###################################################### + +# This is a devel package +addFilter("W: devel-file-in-non-devel-package") + +# These symlinks are dangling on x64_64 +addFilter("compiler-rt.x86_64: W: dangling-relative-symlink /usr/lib64/clang/[0-9]+.[0-9]+.[0-9]+/") + +addFilter("E: hardcoded-library-path in ../../lib/clang/") + + +## LIBOMP ########################################################### + + + +## CLANG ############################################################ + +clang needs libstdc++-devel installed in order to compile c++ programs. + +addFilter("E: devel-dependency libstdc\+\+-devel") + +addFilter("E: explicit-lib-dependency libstdc\+\+-devel") + +# clang installs libear to /usr/lib on all arches, so we have to use + +# a hard-coded /usr/lib path in order to move it to the python3 sitelib. + +addFilter("E: hardcoded-library-path in %{_prefix}/lib/{libear") \ No newline at end of file diff --git a/llvm.spec b/llvm.spec index 9dbe5eb..cbd3fae 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,9 +1,6 @@ %bcond_with snapshot_build -%if %{with snapshot_build} -# Unlock LLVM Snapshot LUA functions -%{llvm_sb} -%endif +%include %{_sourcedir}/globals.spec.inc # We are building with clang for faster/lower memory LTO builds. # See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros @@ -110,24 +107,14 @@ Summary: The Low Level Virtual Machine License: Apache-2.0 WITH LLVM-exception OR NCSA URL: http://llvm.org -%if %{with snapshot_build} -Source0: %{llvm_snapshot_source_prefix}llvm-%{llvm_snapshot_yyyymmdd}.src.tar.xz -Source2: %{llvm_snapshot_source_prefix}cmake-%{llvm_snapshot_yyyymmdd}.src.tar.xz -Source4: %{llvm_snapshot_source_prefix}third-party-%{llvm_snapshot_yyyymmdd}.src.tar.xz -%{llvm_snapshot_extra_source_tags} -%else -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: 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: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{third_party_srcdir}.tar.xz -Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{third_party_srcdir}.tar.xz.sig -Source6: release-keys.asc + +%include %{_sourcedir}/sources.spec.inc + +%include %{_sourcedir}/patches.spec.inc + +%if %{undefined rhel} +BuildRequires: moreutils %endif - -# RHEL-specific patch to avoid unwanted python3-myst-parser dep -Patch101: 0101-Deactivate-markdown-doc.patch - BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: clang @@ -141,6 +128,7 @@ BuildRequires: python3-sphinx %if %{undefined rhel} BuildRequires: python3-myst-parser %endif +# Needed for %%multilib_fix_c_header BuildRequires: multilib-rpm-config %if %{with gold} BuildRequires: binutils-devel @@ -158,8 +146,7 @@ BuildRequires: python3-setuptools # For origin certification BuildRequires: gnupg2 - -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} Provides: llvm(major) = %{maj_ver} @@ -486,6 +473,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{_vpath %post -p /sbin/ldconfig libs %postun -p /sbin/ldconfig libs %endif +%include %{_sourcedir}/check.spec.inc %post devel /usr/sbin/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} @@ -502,6 +490,7 @@ for v in 14 15 16; do fi done %endif +%include %{_sourcedir}/post_devel.spec.inc %postun devel diff --git a/macros.clang b/macros.clang new file mode 100644 index 0000000..88f259d --- /dev/null +++ b/macros.clang @@ -0,0 +1,11 @@ +%clang_major_version @@CLANG_MAJOR_VERSION@@ +%clang_minor_version @@CLANG_MINOR_VERSION@@ +%clang_patch_version @@CLANG_PATCH_VERSION@@ + +%clang_version %{clang_major_version}.%{clang_minor_version}.%{clang_patch_version} + +# This is the path to the clang resource directory that has clang's internal +# headers and libraries. This path should be used by packages that need to +# install files into this directory. This macro's value changes every time +# clang's version changes. +%clang_resource_dir %{_prefix}/lib/clang/%{clang_major_version} diff --git a/packages.spec.inc b/packages.spec.inc new file mode 100644 index 0000000..1945015 --- /dev/null +++ b/packages.spec.inc @@ -0,0 +1,296 @@ +#region LLVM packages + +%package -n %{pkg_name_llvm}-devel +Summary: Libraries and header files for LLVM +Requires: %{pkg_name_llvm}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} +# The installed LLVM cmake files will add -ledit to the linker flags for any +# app that requires the libLLVMLineEditor, so we need to make sure +# libedit-devel is available. +Requires: libedit-devel +# The installed cmake files reference binaries from llvm-test, llvm-static, and +# llvm-gtest. We tried in the past to split the cmake exports for these binaries +# out into separate files, so that llvm-devel would not need to Require these packages, +# but this caused bugs (rhbz#1773678) and forced us to carry two non-upstream +# patches. +Requires: %{pkg_name_llvm}-static%{?_isa} = %{version}-%{release} +%if %{without compat_build} +Requires: %{pkg_name_llvm}-test%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-googletest%{?_isa} = %{version}-%{release} +%endif + + +Requires(post): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/alternatives + +Provides: llvm-devel(major) = %{maj_ver} + +%description -n %{pkg_name_llvm}-devel +This package contains library and header files needed to develop new native +programs that use the LLVM infrastructure. + +%package -n %{pkg_name_llvm}-doc +Summary: Documentation for LLVM +BuildArch: noarch +BuildRequires: graphviz +Requires: %{pkg_name_llvm} = %{version}-%{release} + +%description -n %{pkg_name_llvm}-doc +Documentation for the LLVM compiler infrastructure. + +%package -n %{pkg_name_llvm}-libs +Summary: LLVM shared libraries + +%description -n %{pkg_name_llvm}-libs +Shared libraries for the LLVM compiler infrastructure. + +%package -n %{pkg_name_llvm}-static +Summary: LLVM static libraries +Conflicts: %{pkg_name_llvm}-devel < 8 + +Provides: llvm-static(major) = %{maj_ver} + +%description -n %{pkg_name_llvm}-static +Static libraries for the LLVM compiler infrastructure. + +%package -n %{pkg_name_llvm}-cmake-utils +Summary: CMake utilities shared across LLVM subprojects + +%description -n %{pkg_name_llvm}-cmake-utils +CMake utilities shared across LLVM subprojects. +This is for internal use by LLVM packages only. + +%if %{without compat_build} + +%package -n %{pkg_name_llvm}-test +Summary: LLVM regression tests +Requires: %{pkg_name_llvm}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} + +Provides: llvm-test(major) = %{maj_ver} + +%description -n %{pkg_name_llvm}-test +LLVM regression tests. + +%package -n %{pkg_name_llvm}-googletest +Summary: LLVM's modified googletest sources + +%description -n %{pkg_name_llvm}-googletest +LLVM's modified googletest sources. + +%endif + +#endregion + +#region CLANG packages + +%package -n %{pkg_name_clang} +Summary: A C language family front-end for LLVM + +License: Apache-2.0 WITH LLVM-exception OR NCSA +URL: http://llvm.org + +BuildRequires: libxml2-devel +BuildRequires: perl-generators + +# According to https://fedoraproject.org/wiki/Packaging:Emacs a package +# should BuildRequires: emacs if it packages emacs integration files. +BuildRequires: emacs + +BuildRequires: libatomic + +%if %{without compat_build} +# For reproducible pyc file generation +# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility +BuildRequires: /usr/bin/marshalparser +%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib} +%endif + +# scan-build uses these perl modules so they need to be installed in order +# to run the tests. +BuildRequires: perl(Digest::MD5) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Path) +BuildRequires: perl(File::Temp) +BuildRequires: perl(FindBin) +BuildRequires: perl(Hash::Util) +BuildRequires: perl(lib) +BuildRequires: perl(Term::ANSIColor) +BuildRequires: perl(Text::ParseWords) +BuildRequires: perl(Sys::Hostname) + +Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} + +# clang requires gcc, clang++ requires libstdc++-devel +# - https://bugzilla.redhat.com/show_bug.cgi?id=1021645 +# - https://bugzilla.redhat.com/show_bug.cgi?id=1158594 +Requires: libstdc++-devel +Requires: gcc-c++ + +Provides: clang(major) = %{maj_ver} + +Conflicts: compiler-rt < 11.0.0 + +%description -n %{pkg_name_clang} +clang: noun + 1. A loud, resonant, metallic sound. + 2. The strident call of a crane or goose. + 3. C-language family front-end toolkit. + +The goal of the Clang project is to create a new C, C++, Objective C +and Objective C++ front-end for the LLVM compiler. Its tools are built +as libraries and designed to be loosely-coupled and extensible. + +Install compiler-rt if you want the Blocks C language extension or to +enable sanitization and profiling options when building, and +libomp-devel to enable -fopenmp. + +%package -n %{pkg_name_clang}-libs +Summary: Runtime library for clang +Requires: %{pkg_name_clang}-resource-filesystem%{?_isa} = %{version} +Recommends: compiler-rt%{?_isa} = %{version} +# atomic support is not part of compiler-rt +Recommends: libatomic%{?_isa} +# libomp-devel is required, so clang can find the omp.h header when compiling +# with -fopenmp. +Recommends: libomp-devel%{_isa} = %{version} +Recommends: libomp%{_isa} = %{version} + +# Use lld as the default linker on ARM due to rhbz#1918924 +%ifarch %{arm} +Requires: lld +%endif + +%description -n %{pkg_name_clang}-libs +Runtime library for clang. + +%package -n %{pkg_name_clang}-devel +Summary: Development header files for clang +Requires: %{pkg_name_clang}-libs = %{version}-%{release} +%if %{without compat_build} +Requires: %{pkg_name_clang}%{?_isa} = %{version}-%{release} +# The clang CMake files reference tools from clang-tools-extra. +Requires: %{pkg_name_clang}-tools-extra%{?_isa} = %{version}-%{release} +%endif + +%description -n %{pkg_name_clang}-devel +Development header files for clang. + +%package -n %{pkg_name_clang}-resource-filesystem +Summary: Filesystem package that owns the clang resource directory +Provides: %{pkg_name_clang}-resource-filesystem(major) = %{maj_ver} + +%description -n %{pkg_name_clang}-resource-filesystem +This package owns the clang resouce directory: $libdir/clang/$version/ + +%if %{without compat_build} +%package -n %{pkg_name_clang}-analyzer +Summary: A source code analysis framework +License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT +BuildArch: noarch +Requires: %{pkg_name_clang} = %{version}-%{release} + +%description -n %{pkg_name_clang}-analyzer +The Clang Static Analyzer consists of both a source code analysis +framework and a standalone tool that finds bugs in C and Objective-C +programs. The standalone tool is invoked from the command-line, and is +intended to run in tandem with a build of a project or code base. + +%package -n %{pkg_name_clang}-tools-extra +Summary: Extra tools for clang +Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} +Requires: emacs-filesystem + +%description -n %{pkg_name_clang}-tools-extra +A set of extra tools built using Clang's tooling API. + +%package -n %{pkg_name_clang}-tools-extra-devel +Summary: Development header files for clang tools +Requires: %{pkg_name_clang}-tools-extra = %{version}-%{release} + +%description -n %{pkg_name_clang}-tools-extra-devel +Development header files for clang tools. + +# Put git-clang-format in its own package, because it Requires git +# and we don't want to force users to install all those dependenices if they +# just want clang. +%package -n git-clang-format +Summary: Integration of clang-format for git +Requires: %{pkg_name_clang}-tools-extra = %{version}-%{release} +Requires: git +Requires: python3 + +%description -n git-clang-format +clang-format integration for git. + + +%package -n python3-clang +Summary: Python3 bindings for clang +Requires: %{pkg_name_clang}-devel%{?_isa} = %{version}-%{release} +Requires: python3 +%description -n python3-clang +%{summary}. + + +%endif + +#endregion + +#region COMPILER-RT packages + +%if %{without compat_build} + +%package -n %{pkg_name_compiler_rt} +Summary: LLVM "compiler-rt" runtime libraries + +License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT +URL: http://llvm.org + +BuildRequires: python3 + +Requires: clang-resource-filesystem%{?isa} = %{version} + +%description -n %{pkg_name_compiler_rt} +The compiler-rt project is a part of the LLVM project. It provides +implementation of the low-level target-specific hooks required by +code generation, sanitizer runtimes and profiling library for code +instrumentation, and Blocks C language extension. + +%endif + +#endregion + +#region OPENMP packages + +%if %{without compat_build} + +%package -n %{pkg_name_libomp} +Summary: OpenMP runtime for clang + +License: Apache-2.0 WITH LLVM-exception OR NCSA +URL: http://openmp.llvm.org + +# For clang-offload-packager +BuildRequires: elfutils-libelf-devel +BuildRequires: perl +BuildRequires: perl-Data-Dumper +BuildRequires: perl-Encode +BuildRequires: libffi-devel + +Requires: elfutils-libelf%{?isa} + +%description -n %{pkg_name_libomp} +OpenMP runtime for clang. + +%package -n %{pkg_name_libomp}-devel +Summary: OpenMP header files +Requires: %{name}%{?isa} = %{version}-%{release} +Requires: clang-resource-filesystem%{?isa} = %{version} + +%description -n %{pkg_name_libomp}-devel +OpenMP header files. + +%endif + +#endregion diff --git a/patches.spec.inc b/patches.spec.inc new file mode 100644 index 0000000..5845d19 --- /dev/null +++ b/patches.spec.inc @@ -0,0 +1,32 @@ +# RHEL-specific patch to avoid unwanted python3-myst-parser dep +Patch1000: 0101-Deactivate-markdown-doc.patch + +#region CLANG patches +Patch2001: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch +Patch2002: 0003-PATCH-clang-Don-t-install-static-libraries.patch +#endregion + +# Workaround a bug in ORC on ppc64le. +# More info is available here: https://reviews.llvm.org/D159115#4641826 +Patch2005: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch + +# # Drop the following patch after debugedit adds support to DWARF-5: +# # https://sourceware.org/bugzilla/show_bug.cgi?id=28728 +# Source2006: 0001-Produce-DWARF4-by-default.patch + +%if %{with snapshot_build} +# Temporary patch to add back -fno-openmp-implicit-rpath until we no longer +# support Fedora 38 or older, which pass -fno-openmp-implicit-rpath in +# redhat-rpm-config. +Patch2009: 0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch +%endif + +# RHEL specific patches +# Avoid unwanted dependency on python-myst-parser +Patch2100: 0009-disable-myst-parser.patch + +%if %{without compat_build} +# Patches for clang-tools-extra +# See https://reviews.llvm.org/D120301 +Patch2500: 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch +%endif diff --git a/post_devel.spec.inc b/post_devel.spec.inc new file mode 100644 index 0000000..ccfcbed --- /dev/null +++ b/post_devel.spec.inc @@ -0,0 +1,4 @@ +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%if %{without compat_build} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%endif diff --git a/postun_devel.spec.inc b/postun_devel.spec.inc new file mode 100644 index 0000000..6ce6c4c --- /dev/null +++ b/postun_devel.spec.inc @@ -0,0 +1,6 @@ +if [ $1 -eq 0 ]; then + %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%if %{without compat_build} + %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%endif +fi \ No newline at end of file diff --git a/prep.spec.inc b/prep.spec.inc new file mode 100644 index 0000000..0604429 --- /dev/null +++ b/prep.spec.inc @@ -0,0 +1,50 @@ +%if %{without snapshot_build} +# llvm +%{gpgverify} --keyring='%{SOURCE1006}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%endif + +# -T : Do Not Perform Default Archive Unpacking (without this, the th source would be unpacked twice) +# -b : Unpack The nth Sources Before Changing Directory +# -n : Set Name of Build Directory +# +# see http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html +%autosetup -T -b 0 -p1 -n %{src_tarball_dir} + +#region LLVM preparation + +%py3_shebang_fix \ + llvm/test/BugPoint/compile-custom.ll.py \ + llvm/tools/opt-viewer/*.py \ + llvm/utils/update_cc_test_checks.py + +#endregion + +#region CLANG preparation + +%if %{without compat_build} + +%py3_shebang_fix \ + clang-tools-extra/clang-tidy/tool/ \ + clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py + +%py3_shebang_fix \ + clang/tools/clang-format/ \ + clang/tools/clang-format/git-clang-format \ + clang/utils/hmaptool/hmaptool \ + clang/tools/scan-view/bin/scan-view \ + clang/tools/scan-view/share/Reporter.py \ + clang/tools/scan-view/share/startfile.py \ + clang/tools/scan-build-py/bin/* \ + clang/tools/scan-build-py/libexec/* + +%endif + +#endregion + +#region COMPILER-RT preparation + +%if %{without compat_build} +%py3_shebang_fix compiler-rt/lib/hwasan/scripts/hwasan_symbolize +%endif + +#endregion diff --git a/sources.spec.inc b/sources.spec.inc new file mode 100644 index 0000000..1c3a962 --- /dev/null +++ b/sources.spec.inc @@ -0,0 +1,27 @@ +%if %{with snapshot_build} +Source0: %{llvm_snapshot_source_prefix}llvm-project-%{llvm_snapshot_yyyymmdd}.src.tar.xz +%else +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{src_tarball_dir}.tar.xz +Source1001: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{src_tarball_dir}.tar.xz.sig +Source1006: release-keys.asc +%endif + +%if %{without compat_build} +Source2005: macros.%{pkg_name_clang} +%endif + +# Sources we use to split up the main spec file in sections so that we can more +# easily see what specfile sections are touched by a patch. +Source1000: version.spec.inc +Source1001: build.spec.inc +Source1002: changelog.spec.inc +Source1003: check.spec.inc +Source1004: files.spec.inc +Source1005: globals.spec.inc +Source1006: install.spec.inc +Source1008: patches.spec.inc +Source1009: prep.spec.inc +Source1010: post_devel.spec.inc +Source1011: postun_devel.spec.inc +Source1012: sources.spec.inc +Source1013: packages.spec.inc diff --git a/version.spec.inc b/version.spec.inc new file mode 100644 index 0000000..7f42ac7 --- /dev/null +++ b/version.spec.inc @@ -0,0 +1,16 @@ +%global maj_ver 18 +%global min_ver 0 +%global patch_ver 0 +%undefine rc_ver + +%global llvm_snapshot_version 18.0.0 +%global llvm_snapshot_version_tag 18.0.0~pre20231225.ga041da31093303 +%global llvm_snapshot_version_major 18 +%global llvm_snapshot_version_minor 0 +%global llvm_snapshot_version_patch 0 +%global llvm_snapshot_yyyymmdd 20231225 +%global llvm_snapshot_git_revision a041da31093303b02b6da5fe919a0a3c234eb466 +%global llvm_snapshot_git_revision_short a041da31093303 +%global llvm_snapshot_version_suffix pre20231225.ga041da31093303 +%global llvm_snapshot_changelog_entry * Mon Dec 25 2023 LLVM snapshot - 18.0.0~pre20231225.ga041da31093303 +%global llvm_snapshot_source_prefix https://github.com/kwk/llvm-daily-fedora-rpms/releases/download/source-snapshot/