diff --git a/0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch b/0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch new file mode 100644 index 0000000..f44d6cb --- /dev/null +++ b/0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch @@ -0,0 +1,51 @@ +From be7b1ef7c8e58b454e20f7f70d0e316528e2c823 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 29 Apr 2025 21:35:57 +0000 +Subject: [PATCH] [sanitizer_common] Disable termio ioctls on PowerPC + +glibc-2.42 removed the termio.h header, but there are refrences to it +still in the kernel's ioctl.h, so we need disable these ioctls to fix +this build. +--- + .../sanitizer_platform_limits_posix.cpp | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +index 7a89bf1c7498..7b81951f82ae 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -182,6 +182,12 @@ typedef struct user_fpregs elf_fpregset_t; + #include + #endif + ++// Work around struct termio usage in ioctl.h on ppc64le. ++#if SANITIZER_GLIBC && !__has_include() && defined(__powerpc64__) ++ #define DISABLE_TERMIO_IOCTLS 1 ++#endif ++ ++ + // Include these after system headers to avoid name clashes and ambiguities. + # include "sanitizer_common.h" + # include "sanitizer_internal_defs.h" +@@ -779,13 +785,15 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER; + #endif // SOUND_VERSION + unsigned IOCTL_TCFLSH = TCFLSH; ++#if !defined(DISABLE_TERMIO_IOCTLS) + unsigned IOCTL_TCGETA = TCGETA; +- unsigned IOCTL_TCGETS = TCGETS; +- unsigned IOCTL_TCSBRK = TCSBRK; +- unsigned IOCTL_TCSBRKP = TCSBRKP; + unsigned IOCTL_TCSETA = TCSETA; + unsigned IOCTL_TCSETAF = TCSETAF; + unsigned IOCTL_TCSETAW = TCSETAW; ++#endif ++ unsigned IOCTL_TCGETS = TCGETS; ++ unsigned IOCTL_TCSBRK = TCSBRK; ++ unsigned IOCTL_TCSBRKP = TCSBRKP; + unsigned IOCTL_TCSETS = TCSETS; + unsigned IOCTL_TCSETSF = TCSETSF; + unsigned IOCTL_TCSETSW = TCSETSW; +-- +2.48.1 + diff --git a/0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch.20 b/0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch.20 new file mode 100644 index 0000000..e9facda --- /dev/null +++ b/0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch.20 @@ -0,0 +1,56 @@ +From 1e49835cc5737b2dffff5923e09546b70a54f90d Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 29 Apr 2025 21:35:57 +0000 +Subject: [PATCH] [sanitizer_common] Disable termio ioctls on PowerPC + +glibc-2.42 removed the termio.h header, but there are refrences to it +still in the kernel's ioctl.h, so we need disable these ioctls to fix +this build. +--- + .../sanitizer_platform_limits_posix.cpp | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +index 10b6535499de..303c82783528 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -173,6 +173,17 @@ typedef struct user_fpregs elf_fpregset_t; + #include + #endif + ++#if SANITIZER_HAIKU ++#include ++#include ++#endif ++ ++// Work around struct termio usage in ioctl.h on ppc64le. ++#if SANITIZER_GLIBC && !__has_include() && defined(__powerpc64__) ++ #define DISABLE_TERMIO_IOCTLS 1 ++#endif ++ ++ + // Include these after system headers to avoid name clashes and ambiguities. + # include "sanitizer_common.h" + # include "sanitizer_internal_defs.h" +@@ -764,13 +775,15 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER; + #endif // SOUND_VERSION + unsigned IOCTL_TCFLSH = TCFLSH; ++#if !defined(DISABLE_TERMIO_IOCTLS) + unsigned IOCTL_TCGETA = TCGETA; +- unsigned IOCTL_TCGETS = TCGETS; +- unsigned IOCTL_TCSBRK = TCSBRK; +- unsigned IOCTL_TCSBRKP = TCSBRKP; + unsigned IOCTL_TCSETA = TCSETA; + unsigned IOCTL_TCSETAF = TCSETAF; + unsigned IOCTL_TCSETAW = TCSETAW; ++#endif ++ unsigned IOCTL_TCGETS = TCGETS; ++ unsigned IOCTL_TCSBRK = TCSBRK; ++ unsigned IOCTL_TCSBRKP = TCSBRKP; + unsigned IOCTL_TCSETS = TCSETS; + unsigned IOCTL_TCSETSF = TCSETSF; + unsigned IOCTL_TCSETSW = TCSETSW; +-- +2.48.1 + diff --git a/0001-sanitizer_common-Remove-interceptors-for-deprecated-.patch b/0001-sanitizer_common-Remove-interceptors-for-deprecated-.patch new file mode 100644 index 0000000..b002cbe --- /dev/null +++ b/0001-sanitizer_common-Remove-interceptors-for-deprecated-.patch @@ -0,0 +1,67 @@ +From 83bf10fffd7065317d50f19e138c9e9fd6adc064 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 25 Apr 2025 14:49:34 -0700 +Subject: [PATCH] [sanitizer_common] Remove interceptors for deprecated struct + termio + +This struct will be removed from glibc-2.42 and has been deprecated for +a very long time. + +Fixes #137321 +--- + .../sanitizer_common_interceptors_ioctl.inc | 8 -------- + .../sanitizer_common/sanitizer_platform_limits_posix.cpp | 3 --- + .../sanitizer_common/sanitizer_platform_limits_posix.h | 1 - + 3 files changed, 12 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +index f88f914b1d14..bc8f02826c61 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +@@ -342,17 +342,9 @@ static void ioctl_table_fill() { + _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int)); + _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int)); + _(TCFLSH, NONE, 0); +-#if SANITIZER_GLIBC +- _(TCGETA, WRITE, struct_termio_sz); +-#endif + _(TCGETS, WRITE, struct_termios_sz); + _(TCSBRK, NONE, 0); + _(TCSBRKP, NONE, 0); +-#if SANITIZER_GLIBC +- _(TCSETA, READ, struct_termio_sz); +- _(TCSETAF, READ, struct_termio_sz); +- _(TCSETAW, READ, struct_termio_sz); +-#endif + _(TCSETS, READ, struct_termios_sz); + _(TCSETSF, READ, struct_termios_sz); + _(TCSETSW, READ, struct_termios_sz); +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +index b4d87ab6228e..7a89bf1c7498 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -494,9 +494,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned struct_input_id_sz = sizeof(struct input_id); + unsigned struct_mtpos_sz = sizeof(struct mtpos); + unsigned struct_rtentry_sz = sizeof(struct rtentry); +-#if SANITIZER_GLIBC || SANITIZER_ANDROID +- unsigned struct_termio_sz = sizeof(struct termio); +-#endif + unsigned struct_vt_consize_sz = sizeof(struct vt_consize); + unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes); + unsigned struct_vt_stat_sz = sizeof(struct vt_stat); +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +index 348bb4f27aec..fdc52aa56c49 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -1063,7 +1063,6 @@ extern unsigned struct_hd_geometry_sz; + extern unsigned struct_input_absinfo_sz; + extern unsigned struct_input_id_sz; + extern unsigned struct_mtpos_sz; +-extern unsigned struct_termio_sz; + extern unsigned struct_vt_consize_sz; + extern unsigned struct_vt_sizes_sz; + extern unsigned struct_vt_stat_sz; +-- +2.48.1 + diff --git a/llvm.spec b/llvm.spec index fb39d2c..58fc2f3 100644 --- a/llvm.spec +++ b/llvm.spec @@ -2,7 +2,7 @@ #region version %global maj_ver 20 %global min_ver 1 -%global patch_ver 2 +%global patch_ver 4 #global rc_ver 3 %bcond_with snapshot_build @@ -41,6 +41,21 @@ %bcond_without lldb +%ifarch ppc64le +%if %{defined rhel} && 0%{?rhel} < 10 && %{maj_ver} >= 21 +# RHEL <= 9 use the IBM long double format, which is not supported by libc. +# Since LLVM 21, parts of libc are required in order to build offload. +%bcond_with offload +%else +%bcond_without offload +%endif +%elifarch %{ix86} +# libomptarget is not supported on 32-bit systems. +%bcond_with offload +%else +%bcond_without offload +%endif + %if %{without compat_build} && 0%{?fedora} >= 41 %ifarch %{ix86} %bcond_with mlir @@ -112,6 +127,12 @@ %global gts_version 14 %endif +%if %{defined rhel} && 0%{?rhel} <= 8 +%bcond_with libedit +%else +%bcond_without libedit +%endif + # 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 @@ -123,6 +144,13 @@ %global src_tarball_dir llvm-project-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}.src %endif +%global has_crtobjs 1 +%if %{maj_ver} < 21 +%ifarch s390x +%global has_crtobjs 0 +%endif +%endif + #region LLVM globals %if %{with compat_build} @@ -148,7 +176,7 @@ %global unprefixed_libdir lib %if 0%{?rhel} -%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly" +%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly" %global experimental_targets_to_build "" %else %global targets_to_build "all" @@ -306,6 +334,14 @@ Patch103: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch Patch104: 0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch #endregion CLANG patches +# Fix for glibc >= 2.42 +# https://github.com/llvm/llvm-project/pull/137403 +Patch2005: 0001-sanitizer_common-Remove-interceptors-for-deprecated-.patch + +# Fix for glibc >= 2.42 on ppc64le +Patch2008: 0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch.20 +Patch2108: 0001-sanitizer_common-Disable-termio-ioctls-on-PowerPC.patch + # Fix LLVMConfig.cmake when symlinks are used. # (https://github.com/llvm/llvm-project/pull/124743 landed in LLVM 21) Patch1902: 0001-cmake-Resolve-symlink-when-finding-install-prefix.patch @@ -329,10 +365,6 @@ Patch501: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch # https://github.com/llvm/llvm-project/issues/124001 Patch1901: 0001-SystemZ-Fix-ICE-with-i128-i64-uaddo-carry-chain.patch -# Backport fix for https://bugzilla.redhat.com/show_bug.cgi?id=2352554. -# https://github.com/llvm/llvm-project/pull/131801 -Patch2004: 131801.patch - %if 0%{?rhel} == 8 %global python3_pkgversion 3.12 %global __python3 /usr/bin/python3.12 @@ -381,8 +413,10 @@ BuildRequires: binutils-gold # Enable extra functionality when run the LLVM JIT under valgrind. BuildRequires: valgrind-devel %endif +%if %{with libedit} # LLVM's LineEditor library will use libedit if it is available. BuildRequires: libedit-devel +%endif # We need python3-devel for %%py3_shebang_fix BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -493,7 +527,9 @@ 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. +%if %{with libedit} Requires: libedit-devel +%endif Requires: libzstd-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 @@ -504,9 +540,9 @@ Requires: %{pkg_name_llvm}-static%{?_isa} = %{version}-%{release} Requires: %{pkg_name_llvm}-test%{?_isa} = %{version}-%{release} Requires: %{pkg_name_llvm}-googletest%{?_isa} = %{version}-%{release} - -Requires(post): alternatives -Requires(postun): alternatives +%if %{without compat_build} +Requires(pre): alternatives +%endif Provides: llvm-devel(major) = %{maj_ver} @@ -1116,7 +1152,7 @@ sed -i 's/LLDB_ENABLE_PYTHON/TRUE/' lldb/docs/CMakeLists.txt %endif %global projects clang;clang-tools-extra;lld -%global runtimes compiler-rt;openmp;offload +%global runtimes compiler-rt;openmp %if %{with lldb} %global projects %{projects};lldb @@ -1138,6 +1174,10 @@ sed -i 's/LLDB_ENABLE_PYTHON/TRUE/' lldb/docs/CMakeLists.txt %global runtimes %{runtimes};libcxx;libcxxabi;libunwind %endif +%if %{with offload} +%global runtimes %{runtimes};offload +%endif + %global cfg_file_content --gcc-triple=%{_target_cpu}-redhat-linux # We want to use DWARF-5 on all snapshot builds. @@ -1189,12 +1229,16 @@ popd # Common cmake arguments used by both the normal build and bundle_compat_lib. # Any ABI-affecting flags should be in here. %global cmake_common_args \\\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\ -DLLVM_ENABLE_EH=ON \\\ -DLLVM_ENABLE_RTTI=ON \\\ -DLLVM_USE_PERF=ON \\\ -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \\\ -DBUILD_SHARED_LIBS=OFF \\\ - -DLLVM_BUILD_LLVM_DYLIB=ON + -DLLVM_BUILD_LLVM_DYLIB=ON \\\ + -DLLVM_LINK_LLVM_DYLIB=ON \\\ + -DCLANG_LINK_CLANG_DYLIB=ON \\\ + -DLLVM_ENABLE_FFI:BOOL=ON %global cmake_config_args %{cmake_common_args} @@ -1208,7 +1252,6 @@ popd -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \\\ -DCLANG_INCLUDE_DOCS:BOOL=ON \\\ -DCLANG_INCLUDE_TESTS:BOOL=ON \\\ - -DCLANG_LINK_CLANG_DYLIB=ON \\\ -DCLANG_PLUGIN_SUPPORT:BOOL=ON \\\ -DCLANG_REPOSITORY_STRING="%{?dist_vendor} %{version}-%{release}" \\\ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra \\\ @@ -1291,8 +1334,6 @@ popd -DLLVM_BUILD_TOOLS:BOOL=ON \\\ -DLLVM_BUILD_UTILS:BOOL=ON \\\ -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \\\ - -DLLVM_DYLIB_COMPONENTS="all" \\\ - -DLLVM_ENABLE_FFI:BOOL=ON \\\ -DLLVM_ENABLE_LIBCXX:BOOL=OFF \\\ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \\\ -DLLVM_ENABLE_PROJECTS="%{projects}" \\\ @@ -1306,7 +1347,6 @@ popd -DLLVM_INCLUDE_UTILS:BOOL=ON \\\ -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \\\ -DLLVM_INSTALL_UTILS:BOOL=ON \\\ - -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \\\ -DLLVM_PARALLEL_LINK_JOBS=1 \\\ -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \\\ -DLLVM_UNREACHABLE_OPTIMIZE:BOOL=OFF \\\ @@ -1357,12 +1397,15 @@ popd #region misc options %global cmake_config_args %{cmake_config_args} \\\ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\ -DCMAKE_INSTALL_PREFIX=%{install_prefix} \\\ -DENABLE_LINKER_BUILD_ID:BOOL=ON \\\ - -DOFFLOAD_INSTALL_LIBDIR=%{unprefixed_libdir} \\\ -DPython3_EXECUTABLE=%{__python3} +%if %{with offload} +%global cmake_config_args %{cmake_config_args} \\\ + -DOFFLOAD_INSTALL_LIBDIR=%{unprefixed_libdir} +%endif + # During the build, we use both the system clang and the just-built clang, and # they need to use the system and just-built shared objects respectively. If # we use LD_LIBRARY_PATH to point to our build directory, the system clang @@ -1448,14 +1491,19 @@ fi cd .. %if %{with bundle_compat_lib} +# MIPS and Arm targets were disabled in LLVM 20, but we still need them +# enabled for the compat libraries. %cmake -S ../llvm-project-%{compat_ver}.src/llvm -B ../llvm-compat-libs -G Ninja \ -DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \ -DCMAKE_SKIP_RPATH=ON \ - -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_PROJECTS="clang;lldb" \ -DLLVM_INCLUDE_BENCHMARKS=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ - %{cmake_common_args} + %{cmake_common_args} \ +%if %{compat_maj_ver} <= 19 + -DLLVM_TARGETS_TO_BUILD="$(echo %{targets_to_build});Mips;ARM" \ +%endif + %{nil} %ninja_build -C ../llvm-compat-libs LLVM %ninja_build -C ../llvm-compat-libs libclang.so @@ -1675,7 +1723,7 @@ rm -rf %{buildroot}/%{install_datadir}/gdb # chmod go+w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so # chmod +w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so -%ifnarch %{ix86} +%if %{with offload} # Remove files that we don't package, yet. rm %{buildroot}%{install_bindir}/llvm-offload-device-info rm %{buildroot}%{install_bindir}/llvm-omp-kernel-replay @@ -1749,6 +1797,11 @@ popd rm -f %{buildroot}%{install_libdir}/libLLVMBOLT*.a #endregion BOLT installation +# Do not create symlinks for i686 to avoid multilib conflicts. +# Don't ship man pages altogether. +%ifarch %{ix86} +rm -rf %{buildroot}%{install_mandir} +%else # Create symlinks from the system install prefix to the llvm install prefix. # Do this at the end so it includes any files added by preceding steps. mkdir -p %{buildroot}%{_bindir} @@ -1798,12 +1851,14 @@ copy_with_relative_symlinks %{buildroot}%{install_libdir} %{buildroot}%{_libdir} copy_with_relative_symlinks %{buildroot}%{install_libexecdir} %{buildroot}%{_libexecdir} copy_with_relative_symlinks %{buildroot}%{install_includedir} %{buildroot}%{_includedir} copy_with_relative_symlinks %{buildroot}%{install_datadir} %{buildroot}%{_datadir} -%endif -# ghost presence for llvm-config, managed by alternatives. -touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} -%if %{without compat_build} -touch %{buildroot}%{_bindir}/llvm-config +%if %{maj_ver} >= 21 && %{with offload} +# Remove offload libaries since we only want to ship these in the configured +# install prefix. +rm -Rf %{buildroot}%{_libdir}/amdgcn-amd-amdhsa +rm -Rf %{buildroot}%{_libdir}/nvptx64-nvidia-cuda +%endif +%endif %endif %if %{with bundle_compat_lib} @@ -2226,36 +2281,14 @@ cp %{_vpath_builddir}/.ninja_log %{buildroot}%{_datadir} %ldconfig_scriptlets -n %{pkg_name_lld}-libs %endif -%post -n %{pkg_name_llvm}-devel -update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config %{__isa_bits} %if %{without compat_build} -update-alternatives --install %{_bindir}/llvm-config llvm-config %{install_bindir}/llvm-config %{__isa_bits} - -# During the upgrade from LLVM 16 (F38) to LLVM 17 (F39), we found out the -# main llvm-devel package was leaving entries in the alternatives system. -# Try to remove them now. -for v in 14 15 16; do - if [[ -e %{_bindir}/llvm-config-$v - && "x$(%{_bindir}/llvm-config-$v --version | awk -F . '{ print $1 }')" != "x$v" ]]; then - update-alternatives --remove llvm-config-$v %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} - fi -done +%pre -n %{pkg_name_llvm}-devel +# llvm-config used to be managed by alternatives. +# Remove them if they still exist. +update-alternatives --remove-all llvm-config 2>/dev/null || : +%if %{maj_ver} <= 20 +update-alternatives --remove-all llvm-config-%{maj_ver} 2>/dev/null || : %endif - -%postun -n %{pkg_name_llvm}-devel -if [ $1 -eq 0 ]; then - update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config -fi -%if %{without compat_build} -# When upgrading between minor versions (i.e. from x.y.1 to x.y.2), we must -# not remove the alternative. -# However, during a major version upgrade (i.e. from 16.x.y to 17.z.w), the -# alternative must be removed in order to give priority to a newly installed -# compat package. -if [[ $1 -eq 0 - || "x$(%{_bindir}/llvm-config%{exec_suffix} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then - update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} -fi %endif %if %{without compat_build} @@ -2276,20 +2309,24 @@ fi local maj_ver = rpm.expand("%{maj_ver}") for arg in rpm.expand("%*"):gmatch("%S+") do print(install_bindir .. "/" .. arg .. "\\n") - print(bindir .. "/" .. arg .. "-" .. maj_ver .. "\\n") - if rpm.expand("%{without compat_build}") == "1" then - print(bindir .. "/" .. arg .. "\\n") + if not rpm.expand("%{ix86}"):find(rpm.expand("%{_arch}")) then + print(bindir .. "/" .. arg .. "-" .. maj_ver .. "\\n") + if rpm.expand("%{without compat_build}") == "1" then + print(bindir .. "/" .. arg .. "\\n") + end end end } %define expand_mans() %{lua: - local mandir = rpm.expand("%{_mandir}") - local maj_ver = rpm.expand("%{maj_ver}") - for arg in rpm.expand("%*"):gmatch("%S+") do - print(mandir .. "/man1/" .. arg .. "-" .. maj_ver .. ".1.gz\\n") - if rpm.expand("%{without compat_build}") == "1" then - print(mandir .. "/man1/" .. arg .. ".1.gz\\n") + if not rpm.expand("%{ix86}"):find(rpm.expand("%{_arch}")) then + local mandir = rpm.expand("%{_mandir}") + local maj_ver = rpm.expand("%{maj_ver}") + for arg in rpm.expand("%*"):gmatch("%S+") do + print(mandir .. "/man1/" .. arg .. "-" .. maj_ver .. ".1.gz\\n") + if rpm.expand("%{without compat_build}") == "1" then + print(mandir .. "/man1/" .. arg .. ".1.gz\\n") + end end end } @@ -2299,7 +2336,8 @@ fi local install_dir = rpm.expand("%{-i*}") for arg in rpm.expand("%*"):gmatch("%S+") do print(install_dir .. "/" .. arg .. "\\n") - if rpm.expand("%{without compat_build}") == "1" then + if rpm.expand("%{without compat_build}") == "1" and + not rpm.expand("%{ix86}"):find(rpm.expand("%{_arch}")) then print(dir .. "/" .. arg .. "\\n") end end @@ -2514,12 +2552,7 @@ fi %files -n %{pkg_name_llvm}-devel %license llvm/LICENSE.TXT -%{install_bindir}/llvm-config -%ghost %{_bindir}/llvm-config-%{maj_ver} -%if %{without compat_build} -%ghost %{_bindir}/llvm-config -%endif - +%expand_bins llvm-config %expand_mans llvm-config %expand_includes llvm llvm-c %{expand_libs %{expand: @@ -2537,9 +2570,11 @@ fi %exclude %{install_libdir}/libLLVMTestingSupport.a %exclude %{install_libdir}/libLLVMTestingAnnotations.a %if %{without compat_build} +%ifnarch %{ix86} %exclude %{_libdir}/libLLVMTestingSupport.a %exclude %{_libdir}/libLLVMTestingAnnotations.a %endif +%endif %files -n %{pkg_name_llvm}-cmake-utils %license llvm/LICENSE.TXT @@ -2624,8 +2659,10 @@ fi %expand_bins clang-tblgen %dir %{install_datadir}/clang/ %if %{without compat_build} +%ifnarch %{ix86} %dir %{_datadir}/clang %endif +%endif %files -n %{pkg_name_clang}-resource-filesystem %license clang/LICENSE.TXT @@ -2749,7 +2786,7 @@ fi # Files that appear on all targets %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/libclang_rt.* -%ifnarch s390x +%if %{has_crtobjs} %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtbegin.o %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtend.o %endif @@ -2774,9 +2811,7 @@ fi libompd.so libarcher.so }} -%ifnarch %{ix86} -# libomptarget is not supported on 32-bit systems. -# s390x does not support the offloading plugins. +%if %{with offload} %expand_libs libomptarget.so.%{so_suffix} %expand_libs libLLVMOffload.so.%{so_suffix} %endif @@ -2789,16 +2824,25 @@ fi %{_prefix}/lib/clang/%{maj_ver}/include/ompt.h %{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h %expand_libs cmake/openmp -%ifnarch %{ix86} -# libomptarget is not supported on 32-bit systems. -# s390x does not support the offloading plugins. +%if %{with offload} +%{expand_libs %{expand: + libomptarget.so + libLLVMOffload.so +}} + +%if %{maj_ver} < 21 %{expand_libs %{expand: libomptarget.devicertl.a libomptarget-amdgpu*.bc libomptarget-nvptx*.bc - libomptarget.so - libLLVMOffload.so }} +%else +%{install_libdir}/amdgcn-amd-amdhsa/libompdevice.a +%{install_libdir}/amdgcn-amd-amdhsa/libomptarget-amdgpu.bc +%{install_libdir}/nvptx64-nvidia-cuda/libompdevice.a +%{install_libdir}/nvptx64-nvidia-cuda/libomptarget-nvptx.bc +%endif + %expand_includes offload %endif #endregion OPENMP files @@ -3032,6 +3076,10 @@ fi #region changelog %changelog +* Mon May 12 2025 Konrad Kleine - 20.1.4-1 +- Update to LLVM 20.1.4 +- Drop ARM and MIPS targets (RHEL-86089) + * Mon Apr 14 2025 Konrad Kleine - 20.1.2-1 - Update to LLVM 20.1.2 (RHEL-80988) diff --git a/sources b/sources index 95bb2d4..280ad53 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (llvm-project-20.1.2.src.tar.xz) = c95e088e471d49c6692c8af1a7e40924467e4c269dada019c44455687c9f0e6a213b9b3ac8afa4e3d20cb3e757afc3400152e7cd06981aeebd61591cac15580d -SHA512 (llvm-project-20.1.2.src.tar.xz.sig) = d3f6a350ebd9884878442ea202f58328f8e85c30cfb150371e4af7fa8dc560bb421cd0f49f49e6bc95f57de6c06543633f0b2799aab9590750f440e099424e01 +SHA512 (llvm-project-20.1.4.src.tar.xz) = acace8175a5468c7e84a89d1564e147e81fe92b6d910f22b058edf72094b27176677c06dbe141fccfbabdad77165f957bbf1ec8aff7bffc85f0757c0103f7e59 +SHA512 (llvm-project-20.1.4.src.tar.xz.sig) = 634414ea877724ebdeeabe3bb1079d78938aa05dba2243d5458cf211c35444124dc01fa73a593548290196f8c0e40e1e6a4a72571dba4b716b5781c656c6f9b2 SHA512 (llvm-project-19.1.7.src.tar.xz) = c7d63286d662707a9cd54758c9e3aaf52794a91900c484c4a6efa62d90bc719d5e7a345e4192feeb0c9fd11c82570d64677c781e5be1d645556b6aa018e47ec8 SHA512 (llvm-project-19.1.7.src.tar.xz.sig) = 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda