llvm: bundle libcxx in

This commit is contained in:
Raven 2025-03-17 14:24:17 +06:00
parent 28693f745b
commit 7cd0352289
8 changed files with 458 additions and 944 deletions

View File

@ -1,5 +0,0 @@
cmake_minimum_required(VERSION 3.13.4)
project(Runtimes C CXX ASM)
add_subdirectory(libcxxabi)
add_subdirectory(libcxx)
add_subdirectory(libunwind)

View File

@ -1,113 +0,0 @@
include(CheckCXXCompilerFlag)
unset(add_flag_if_supported)
# Mangle the name of a compiler flag into a valid CMake identifier.
# Ex: --std=c++11 -> STD_EQ_CXX11
macro(mangle_name str output)
string(STRIP "${str}" strippedStr)
string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")
string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}")
string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}")
string(REPLACE "-" "_" strippedStr "${strippedStr}")
string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}")
string(REPLACE "+" "X" strippedStr "${strippedStr}")
string(TOUPPER "${strippedStr}" ${output})
endmacro()
# Remove a list of flags from all CMake variables that affect compile flags.
# This can be used to remove unwanted flags specified on the command line
# or added in other parts of LLVM's cmake configuration.
macro(remove_flags)
foreach(var ${ARGN})
string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS "${CMAKE_SHARED_MODULE_FLAGS}")
remove_definitions(${var})
endforeach()
endmacro(remove_flags)
macro(check_flag_supported flag)
mangle_name("${flag}" flagname)
check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
endmacro()
macro(append_flags DEST)
foreach(value ${ARGN})
list(APPEND ${DEST} ${value})
list(APPEND ${DEST} ${value})
endforeach()
endmacro()
# If the specified 'condition' is true then append the specified list of flags to DEST
macro(append_flags_if condition DEST)
if (${condition})
list(APPEND ${DEST} ${ARGN})
endif()
endmacro()
# Add each flag in the list specified by DEST if that flag is supported by the current compiler.
macro(append_flags_if_supported DEST)
foreach(flag ${ARGN})
mangle_name("${flag}" flagname)
check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag})
endforeach()
endmacro()
# Add a macro definition if condition is true.
macro(define_if condition def)
if (${condition})
add_definitions(${def})
endif()
endmacro()
# Add a macro definition if condition is not true.
macro(define_if_not condition def)
if (NOT ${condition})
add_definitions(${def})
endif()
endmacro()
# Add a macro definition to the __config_site file if the specified condition
# is 'true'. Note that '-D${def}' is not added. Instead it is expected that
# the build include the '__config_site' header.
macro(config_define_if condition def)
if (${condition})
set(${def} ON)
endif()
endmacro()
macro(config_define_if_not condition def)
if (NOT ${condition})
set(${def} ON)
endif()
endmacro()
macro(config_define value def)
set(${def} ${value})
endmacro()
# Turn a comma separated CMake list into a space separated string.
macro(split_list listname)
string(REPLACE ";" " " ${listname} "${${listname}}")
endmacro()
# For each specified flag, add that compile flag to the provided target.
# The flags are added with the given visibility, i.e. PUBLIC|PRIVATE|INTERFACE.
function(target_add_compile_flags_if_supported target visibility)
foreach(flag ${ARGN})
mangle_name("${flag}" flagname)
check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
if (CXX_SUPPORTS_${flagname}_FLAG)
target_compile_options(${target} ${visibility} ${flag})
endif()
endforeach()
endfunction()

View File

@ -1,77 +0,0 @@
include(HandleFlags)
# Warning flags ===============================================================
function(cxx_add_warning_flags target enable_werror enable_pedantic)
target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
if (MSVC)
# -W4 is the cl.exe/clang-cl equivalent of -Wall. (In cl.exe and clang-cl,
# -Wall is equivalent to -Weverything in GCC style compiler drivers.)
target_add_compile_flags_if_supported(${target} PRIVATE -W4)
else()
target_add_compile_flags_if_supported(${target} PRIVATE -Wall)
endif()
# TODO: Should -Wconversion be enabled?
target_add_compile_flags_if_supported(${target} PRIVATE
-Wextra
-Wnewline-eof
-Wshadow
-Wwrite-strings
-Wno-unused-parameter
-Wno-long-long
-Werror=return-type
-Wextra-semi
-Wundef
-Wunused-template
-Wformat-nonliteral
)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
target_add_compile_flags_if_supported(${target} PRIVATE
-Wno-user-defined-literals
-Wno-covered-switch-default
-Wno-suggest-override
)
if (LIBCXX_TARGETING_CLANG_CL)
target_add_compile_flags_if_supported(${target} PRIVATE
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-c++11-compat
-Wno-undef
-Wno-reserved-id-macro
-Wno-gnu-include-next
-Wno-gcc-compat # For ignoring "'diagnose_if' is a clang extension" warnings
-Wno-zero-as-null-pointer-constant # FIXME: Remove this and fix all occurrences.
-Wno-deprecated-dynamic-exception-spec # For auto_ptr
-Wno-sign-conversion
-Wno-old-style-cast
-Wno-deprecated # FIXME: Remove this and fix all occurrences.
-Wno-shift-sign-overflow # FIXME: Why do we need this with clang-cl but not clang?
-Wno-double-promotion # FIXME: remove me
)
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
target_add_compile_flags_if_supported(${target} PRIVATE
-Wstrict-aliasing=2
-Wstrict-overflow=4
-Wno-attributes
-Wno-literal-suffix
-Wno-c++14-compat
-Wno-noexcept-type
-Wno-suggest-override
)
endif()
if (${enable_werror})
target_add_compile_flags_if_supported(${target} PRIVATE -Werror)
target_add_compile_flags_if_supported(${target} PRIVATE -WX)
else()
# TODO(EricWF) Remove this. We shouldn't be suppressing errors when -Werror is
# added elsewhere.
target_add_compile_flags_if_supported(${target} PRIVATE -Wno-error)
endif()
if (${enable_pedantic})
target_add_compile_flags_if_supported(${target} PRIVATE -pedantic)
endif()
endfunction()

View File

@ -1,17 +0,0 @@
diff -ruN build.orig/libcxx/include/CMakeLists.txt build/libcxx/include/CMakeLists.txt
--- build.orig/libcxx/include/CMakeLists.txt 2024-08-05 10:40:33.000000000 +0200
+++ build/libcxx/include/CMakeLists.txt 2024-09-13 15:02:44.249710564 +0200
@@ -1074,11 +1074,13 @@
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
COMPONENT cxx-headers)
+ if (FALSE)
# Install the generated IWYU file to the generic include dir.
install(FILES "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
COMPONENT cxx-headers)
+ endif()
if (NOT CMAKE_CONFIGURATION_TYPES)
add_custom_target(install-cxx-headers

View File

@ -1,685 +0,0 @@
%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
%if 0%{?rhel} == 8
%undefine __cmake_in_source_build
%endif
%global maj_ver 19
%global libcxx_version %{maj_ver}.1.7
#global rc_ver 4
%global libcxx_srcdir libcxx-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}.src
%global libcxxabi_srcdir libcxxabi-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}.src
%global libunwind_srcdir libunwind-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}.src
Name: libcxx
Version: %{libcxx_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist}
Summary: C++ standard library targeting C++11
License: Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
URL: http://libcxx.llvm.org/
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz.sig
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxxabi_srcdir}.tar.xz
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxxabi_srcdir}.tar.xz.sig
Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libunwind_srcdir}.tar.xz
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libunwind_srcdir}.tar.xz.sig
Source6: release-keys.asc
Source7: CMakeLists.txt
Source8: https://github.com/llvm/llvm-project/raw/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/runtimes/cmake/Modules/HandleFlags.cmake
Source9: https://github.com/llvm/llvm-project/raw/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/runtimes/cmake/Modules/WarningFlags.cmake
Patch0: standalone.patch
# The cmake dependencies for this target are somehow broken upstream.
# However, the libcxx.imp file is only needed for running include-what-you-use.
Patch1: do-not-install-libcxx.imp.patch
BuildRequires: gcc-toolset-14-libstdc++-devel
BuildRequires: clang llvm-devel llvm-cmake-utils cmake ninja-build
# We need python3-devel for %%py3_shebang_fix
BuildRequires: python3-devel
# For documentation
BuildRequires: python3-sphinx
# For origin certification
BuildRequires: gnupg2
# PPC64 (on EL7) doesn't like this code.
# /builddir/build/BUILD/libcxx-3.8.0.src/include/thread:431:73: error: '(9.223372036854775807e+18 / 1.0e+9)' is not a constant expression
# _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
%if 0%{?rhel}
ExcludeArch: ppc64 ppc64le
%endif
Requires: libcxxabi%{?_isa} = %{version}-%{release}
%description
libc++ is a new implementation of the C++ standard library, targeting C++11.
%package devel
Summary: Headers and libraries for libcxx devel
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libcxxabi-devel
%description devel
%{summary}.
%package static
Summary: Static libraries for libcxx
%description static
%{summary}.
%package -n libcxxabi
Summary: Low level support for a standard C++ library
%description -n libcxxabi
libcxxabi provides low level support for a standard C++ library.
%package -n libcxxabi-devel
Summary: Headers and libraries for libcxxabi devel
Requires: libcxxabi%{?_isa} = %{version}-%{release}
%description -n libcxxabi-devel
%{summary}.
%package -n libcxxabi-static
Summary: Static libraries for libcxxabi
%description -n libcxxabi-static
%{summary}.
%package -n llvm-libunwind
Summary: LLVM libunwind
%description -n llvm-libunwind
LLVM libunwind is an implementation of the interface defined by the HP libunwind
project. It was contributed Apple as a way to enable clang++ to port to
platforms that do not have a system unwinder. It is intended to be a small and
fast implementation of the ABI, leaving off some features of HP's libunwind
that never materialized (e.g. remote unwinding).
%package -n llvm-libunwind-devel
Summary: LLVM libunwind development files
Provides: libunwind(major) = %{maj_ver}
Requires: llvm-libunwind%{?_isa} = %{version}-%{release}
%description -n llvm-libunwind-devel
Unversioned shared library for LLVM libunwind
%package -n llvm-libunwind-static
Summary: Static library for LLVM libunwind
%description -n llvm-libunwind-static
%{summary}.
%package -n llvm-libunwind-doc
Summary: libunwind documentation
# doctools.js, searchtools.js and language_data.js are used in the HTML doc
# generated from sphinx-doc under BSD 2-Clause License.
# Source: https://github.com/sphinx-doc/sphinx
License: BSD-2-Clause AND (Apache-2.0 WITH LLVM-exception OR NCSA OR MIT)
%description -n llvm-libunwind-doc
Documentation for LLVM libunwind
%prep
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3}' --data='%{SOURCE2}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE4}'
%setup -T -q -b 0 -n %{libcxx_srcdir}
%setup -T -q -b 2 -n %{libcxxabi_srcdir}
%setup -T -q -b 4 -n %{libunwind_srcdir}
%setup -T -c -n build
cp %{SOURCE7} .
mv ../%{libcxx_srcdir} libcxx
mv ../%{libcxxabi_srcdir} libcxxabi
mv ../%{libunwind_srcdir} libunwind
mkdir -p runtimes/cmake/Modules
cp %{SOURCE8} %{SOURCE9} runtimes/cmake/Modules/
%autopatch -p1
%py3_shebang_fix libcxx/utils/
%build
%if 0%{?rhel} < 10
%enable_devtoolset14
%endif
export CC=clang
export CXX=clang++
# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files.
export ASMFLAGS=$CFLAGS
%cmake -GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_MODULE_PATH="%{_libdir}/cmake/llvm;%{_datadir}/llvm/cmake/Modules" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
%if 0%{?__isa_bits} == 64
-DLIBCXX_LIBDIR_SUFFIX:STRING=64 \
-DLIBCXXABI_LIBDIR_SUFFIX:STRING=64 \
-DLIBUNWIND_LIBDIR_SUFFIX:STRING=64 \
%endif
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLLVM_BUILD_DOCS=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLIBUNWIND_INCLUDE_DOCS=ON \
-DLIBUNWIND_INSTALL_INCLUDE_DIR=%{_includedir}/llvm-libunwind \
-DLIBUNWIND_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html
%cmake_build
%install
%cmake_install
# We can't install the unversionned path on default location because that would conflict with
# https://src.fedoraproject.org/rpms/libunwind
#
# The versionned path has a different soname (libunwind.so.1 compared to
# libunwind.so.8) so they can live together in %%{_libdir}
#
# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't
# have the exact same ABI as gcc's libunwind (it actually provides a subset).
rm %{buildroot}%{_libdir}/libunwind.so
mkdir -p %{buildroot}/%{_libdir}/llvm-unwind/
pushd %{buildroot}/%{_libdir}/llvm-unwind
ln -s ../libunwind.so.1.0 libunwind.so
popd
rm %{buildroot}%{_pkgdocdir}/html/.buildinfo
%ldconfig_scriptlets
%files
%license libcxx/LICENSE.TXT
%doc libcxx/CREDITS.TXT libcxx/TODO.TXT
%{_libdir}/libc++.so.*
%files devel
%{_includedir}/c++/
%exclude %{_includedir}/c++/v1/cxxabi.h
%exclude %{_includedir}/c++/v1/__cxxabi_config.h
%{_libdir}/libc++.so
%{_libdir}/libc++.modules.json
%{_datadir}/libc++/v1/*
%files static
%license libcxx/LICENSE.TXT
%{_libdir}/libc++.a
%{_libdir}/libc++experimental.a
%files -n libcxxabi
%license libcxxabi/LICENSE.TXT
%doc libcxxabi/CREDITS.TXT
%{_libdir}/libc++abi.so.*
%files -n libcxxabi-devel
%{_includedir}/c++/v1/cxxabi.h
%{_includedir}/c++/v1/__cxxabi_config.h
%{_libdir}/libc++abi.so
%files -n libcxxabi-static
%{_libdir}/libc++abi.a
%files -n llvm-libunwind
%license libunwind/LICENSE.TXT
%{_libdir}/libunwind.so.1
%{_libdir}/libunwind.so.1.0
%files -n llvm-libunwind-devel
%{_includedir}/llvm-libunwind/__libunwind_config.h
%{_includedir}/llvm-libunwind/libunwind.h
%{_includedir}/llvm-libunwind/libunwind.modulemap
%{_includedir}/llvm-libunwind/mach-o/compact_unwind_encoding.h
%{_includedir}/llvm-libunwind/unwind.h
%{_includedir}/llvm-libunwind/unwind_arm_ehabi.h
%{_includedir}/llvm-libunwind/unwind_itanium.h
%dir %{_libdir}/llvm-unwind
%{_libdir}/llvm-unwind/libunwind.so
%files -n llvm-libunwind-static
%{_libdir}/libunwind.a
%files -n llvm-libunwind-doc
%license libunwind/LICENSE.TXT
%doc %{_pkgdocdir}/html
%changelog
* Wed Jan 15 2025 Raven <raven@sysadmins.ws> - 19.1.7-1
- Update to LLVM 19.1.7
* Thu Dec 19 2024 Raven <raven@sysadmins.ws> - 19.1.6-1
- Update to LLVM 19.1.6
* Fri Dec 13 2024 Raven <raven@sysadmins.ws> - 19.1.5-1
- Update to LLVM 19.1.5
* Wed Nov 13 2024 Raven <raven@sysadmins.ws> - 19.1.4-1
- Update to LLVM 19.1.4
* Fri Oct 31 2024 Raven <raven@sysadmins.ws> - 19.1.3-1
- Update to LLVM 19.1.3
* Thu Sep 19 2024 Timm Bäder <tbaeder@redhat.com> - 19.1.0-1
- Update to 19.1.0
* Fri Sep 13 2024 Timm Bäder <tbaeder@redhat.com> - 19.1.0~rc4-1
- Update to 19.1.0-rc4
* Tue Jul 30 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 18.1.8-3
- Migrate llvm-libunwind-doc to SPDX license
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 18.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jul 11 2024 Jesus Checa Hidalgo <jchecahi@redhat.com> - 18.1.8-1
- 18.1.8 Release
* Thu Jun 13 2024 Tom Stellard <tstellar@redhat.com> - 18.1.7-1
- 18.1.7 Release
* Tue May 21 2024 Tom Stellard <tstellar@redhat.com> - 18.1.6-1
- 18.1.6 Release
* Fri May 03 2024 Tom Stellard <tstellar@redhat.com> - 18.1.4-1
- 18.1.4 Release
* Wed Apr 17 2024 Tom Stellard <tstellar@redhat.com> - 18.1.3-1
- 18.1.3 Release
* Fri Mar 22 2024 Tom Stellard <tstellar@redhat.com> - 18.1.2-1
- 18.1.2 Release
* Wed Mar 13 2024 Tom Stellard <tstellar@redhat.com> - 18.1.1-1
- 18.1.1 Release
* Mon Mar 04 2024 Nikita Popov <npopov@redhat.com> - 18.1.0~rc4-2
- Disable LIBCXXABI_USE_LLVM_UNWINDER (rhbz#2267690)
* Thu Feb 29 2024 Tom Stellard <tstellar@redhat.com> - 18.1.0~rc4-1
- 18.1.0-rc4 Release
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Nov 29 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.6-1
- Update to LLVM 17.0.6
* Wed Nov 01 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.4-1
- Update to LLVM 17.0.4
* Wed Oct 18 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.3-1
- Update to LLVM 17.0.3
* Wed Oct 04 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.2-1
- Update to LLVM 17.0.2
* Mon Sep 25 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.1-1
- Update to LLVM 17.0.1
* Mon Sep 11 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc4-1
- Update to LLVM 17.0.0 RC4
* Fri Aug 25 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc3-1
- Update to LLVM 17.0.0 RC3
* Wed Aug 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc2-1
- Update to LLVM 17.0.0 RC2
* Wed Aug 02 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc1-1
- Update to LLVM 17.0.0 RC1
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 16.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Jul 10 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.6-1
- Update to LLVM 16.0.6
* Thu Jun 15 2023 Nikita Popov <npopov@redhat.com> - 16.0.5-2
- Use llvm-cmake-utils package
* Tue Jun 06 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.5-1
- Update to LLVM 16.0.5
* Tue May 30 2023 Nikita Popov <npopov@redhat.com> - 16.0.4-2
- Merge llvm-libunwind srpm into libcxx
* Fri May 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.4-1
- Update to LLVM 16.0.4
* Wed May 10 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.3-1
- Update to LLVM 16.0.3
* Wed Apr 26 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.2-1
- Update to LLVM 16.0.2
* Thu Apr 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.1-2
- Enable PIC even for static libraries (rhbz#2186531)
* Thu Apr 13 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.1-1
- Update to LLVM 16.0.1
* Mon Mar 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0-1
- Update to LLVM 16.0.0
* Wed Mar 15 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc4-1
- Update to LLVM 16.0.0 RC4
* Thu Feb 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc3-1
- Update to LLVM 16.0.0 RC3
* Fri Feb 10 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc1-1
- Update to LLVM 16.0.0 RC1
* Wed Feb 01 2023 Tom Stellard <tstellar@redhat.com> - 15.0.7-4
- Omit frame pointers when building
* Thu Jan 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 15.0.7-3
- Include the Apache license adopted in 2019.
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 15.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jan 13 2023 Nikita Popov <npopov@redhat.com> - 15.0.7-1
- Update to LLVM 15.0.7
* Tue Dec 06 2022 Nikita Popov <npopov@redhat.com> - 15.0.6-1
- Update to LLVM 15.0.6
* Mon Nov 07 2022 Nikita Popov <npopov@redhat.com> - 15.0.4-1
- Update to LLVM 15.0.4
* Wed Oct 05 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-5
- Fix libcxxabi dependencies
* Wed Oct 05 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-4
- Combine with libcxxabi build
* Tue Sep 13 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-3
- Rebuild
* Tue Sep 13 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-2
- Link libc++.a against libc++abi.a
* Thu Sep 08 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-1
- Update to LLVM 15.0.0
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 14.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 20 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.5-1
- Update to 14.0.5
* Fri Apr 29 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-2
- Remove llvm-cmake-devel BR
* Thu Mar 24 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-1
- Update to 14.0.0
* Thu Feb 03 2022 Nikita Popov <npopov@redhat.com> - 13.0.1-1
- Update to LLVM 13.0.1 final
* Tue Feb 01 2022 Nikita Popov <npopov@redhat.com> - 13.0.1~rc3-1
- Update to LLVM 13.0.1rc3
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 13.0.1~rc2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jan 14 2022 Nikita Popov <npopov@redhat.com> - 13.0.1~rc2-1
- Update to LLVM 13.0.1rc2
* Wed Jan 12 2022 Nikita Popov <npopov@redhat.com> - 13.0.1~rc1-1
- Update to LLVM 13.0.1rc1
* Fri Oct 01 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-1
- 13.0.0 Release
* Wed Sep 22 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0~rc3-1
- 13.0.0-rc3 Release
* Mon Aug 09 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0~rc1-1
- 13.0.0-rc1 Release
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 12.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jul 13 2021 Tom Stellard <tstellar@redhat.com> - 12.0.1-1
- 12.0.1 Release
* Thu Jul 01 2021 Tom Stellard <tstellar@redhat.com> - 12.0.1~rc3-1
- 12.0.1-rc3 Release
* Thu Jun 03 2021 Tom Stellard <tstellar@redhat.com> - 12.0.1~rc1-1
- 12.0.1-rc1 Release
* Fri Apr 16 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-1
- 12.0.0 Release
* Thu Apr 08 2021 sguelton@redhat.com - 12.0.0-0.7.rc5
- New upstream release candidate
* Fri Apr 02 2021 sguelton@redhat.com - 12.0.0-0.6.rc4
- New upstream release candidate
* Thu Mar 11 2021 sguelton@redhat.com - 12.0.0-0.5.rc3
- LLVM 12.0.0 rc3
* Tue Mar 09 2021 sguelton@redhat.com - 12.0.0-0.4.rc2
- rebuilt
* Thu Feb 25 2021 Timm Bäder <tbaeder@redhat.com> - 12.0.0-0.3.rc2
- Build shared and static libc++ separately
- Include libc++abi symbols in static libc++.a
* Wed Feb 24 2021 sguelton@redhat.com - 12.0.0-0.2.rc2
- 12.0.0-rc2 release
* Wed Feb 17 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-0.1.rc1
- 12.0.0-rc1 Release
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 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
- llvm 11.1.0-rc2 release
* Thu Jan 14 2021 Serge Guelton - 11.1.0-0.1.rc1
- 11.1.0-rc1 release
* Wed Jan 06 2021 Serge Guelton - 11.0.1-3
- LLVM 11.0.1 final
* Tue Dec 22 2020 sguelton@redhat.com - 11.0.1-2.rc2
- llvm 11.0.1-rc2
* Tue Dec 01 2020 sguelton@redhat.com - 11.0.1-1.rc1
- llvm 11.0.1-rc1
* Thu Oct 15 2020 sguelton@redhat.com - 11.0.0-1
- Fix NVR
* Mon Oct 12 2020 sguelton@redhat.com - 11.0.0-0.5
- llvm 11.0.0 - final release
* Thu Oct 08 2020 sguelton@redhat.com - 11.0.0-0.4.rc6
- 11.0.0-rc6
* Fri Oct 02 2020 sguelton@redhat.com - 11.0.0-0.3.rc5
- 11.0.0-rc5 Release
* Sun Sep 27 2020 sguelton@redhat.com - 11.0.0-0.2.rc3
- Fix NVR
* Thu Sep 24 2020 sguelton@redhat.com - 11.0.0-0.1.rc3
- 11.0.0-rc3 Release
* Tue Sep 01 2020 sguelton@redhat.com - 11.0.0-0.1.rc2
- 11.0.0-rc2 Release
* Tue Aug 11 2020 Tom Stellard <tstellar@redhat.com> - 11.0.0-0.1.rc1
- 11.0.0-rc1 Release
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 20 2020 sguelton@redhat.com - 10.0.0-2
- Use modern cmake macros
- Finalize source verification
* Mon Mar 30 2020 sguelton@redhat.com - 10.0.0-1
- 10.0.0 final
* Wed Mar 25 2020 sguelton@redhat.com - 10.0.0-0.6.rc6
- 10.0.0 rc6
* Fri Mar 20 2020 sguelton@redhat.com - 10.0.0-0.5.rc5
- 10.0.0 rc5
* Sun Mar 15 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 14 2020 sguelton@redhat.com - 10.0.0-0.1.rc2
- 10.0.0 rc2
* Thu Feb 6 2020 sguelton@redhat.com - 10.0.0-0.2.rc1
- bootstrap off
* Fri Jan 31 2020 sguelton@redhat.com - 10.0.0-0.1.rc1
- 10.0.0 rc1
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 9.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jan 16 2020 Tom Stellard <tstellar@redhat.com> - 9.0.1-1
- 9.0.1 Release
* Thu Jan 16 2020 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
- Build with gcc on all arches
* Mon Sep 23 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1
- 9.0.0 Release
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.0-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Mar 20 2019 sguelton@redhat.com - 8.0.0-1
- 8.0.0 final
* Tue Mar 12 2019 sguelton@redhat.com - 8.0.0-0.4.rc4
- 8.0.0 Release candidate 4
* Mon Mar 4 2019 sguelton@redhat.com - 8.0.0-0.3.rc3
- 8.0.0 Release candidate 3
* Sun Feb 24 2019 sguelton@redhat.com - 8.0.0-0.2.rc2
- 8.0.0 Release candidate 2
* Mon Feb 11 2019 sguelton@redhat.com - 8.0.0-0.1.rc1
- 8.0.0 Release candidate 1
* Wed Feb 06 2019 sguelton@redhat.com - 7.0.1-1
- 7.0.1 Release
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.1-0.2.rc3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Dec 10 2018 sguelton@redhat.com - 7.0.1-0.1.rc3
- 7.0.1-rc3 Release
* Tue Sep 25 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1
- 7.0.0 Release
* Wed Sep 12 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.1.rc3
- 7.0.0-rc3 Release
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 26 2018 Tom Callaway <spot@fedoraproject.org> - 6.0.1-1
- update to 6.0.1
* Wed Mar 21 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-2
- Use default LDFLAGS/CXXFLAGS/CFLAGS and filter out flags not supported by clang
* Wed Mar 14 2018 Tom Callaway <spot@fedoraproject.org> - 6.0.0-1
- 6.0.0 final
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-0.2.rc1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Jan 20 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.1.rc1
- 6.0.0-rc1
* Thu Dec 21 2017 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
- 5.0.1 Release
* Fri Sep 8 2017 Tom Callaway <spot@fedoraproject.org> - 5.0.0-1
- update to 5.0.0
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Jun 23 2017 Tom Callaway <spot@fedoraproject.org> - 4.0.1-1
- update to 4.0.1
* Sat Apr 22 2017 Tom Callaway <spot@fedoraproject.org> - 4.0.0-1
- update to 4.0.0
* Wed Mar 8 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.1-1
- update to 3.9.1
* Fri Mar 3 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.0-4
- LIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON
* Wed Mar 1 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.0-3
- disable bootstrap
* Tue Feb 21 2017 Dan Horák <dan[at]danny.cz> - 3.9.0-2
- apply s390(x) workaround only in Fedora < 26
* Mon Feb 20 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.0-1
- update to 3.9.0 (match clang)
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Aug 26 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.1-1
- update to 3.8.1
* Thu Jun 09 2016 Dan Horák <dan[at]danny.cz> - 3.8.0-4
- exclude Power only in EPEL
- default to z10 on s390(x)
* Thu May 19 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.0-3
- use gcc on el7, fedora < 24. use clang on el6 and f24+
MAGIC.
- bootstrap on
* Tue May 3 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.0-2
- bootstrap off
* Tue May 3 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.0-1
- initial package
- bootstrap on

View File

@ -1,23 +0,0 @@
From 0ef68aab2b08915b9144ffa67b3319e3e8332445 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Thu, 4 Aug 2022 12:44:15 +0200
Subject: [PATCH] Fix standalone build
---
libunwind/docs/CMakeLists.txt | 1 +
1 files changed, 1 insertions(+)
diff --git a/libunwind/docs/CMakeLists.txt b/libunwind/docs/CMakeLists.txt
index 79b87eb03b44..eaf6f3db5223 100644
--- a/libunwind/docs/CMakeLists.txt
+++ b/libunwind/docs/CMakeLists.txt
@@ -1,5 +1,6 @@
include(FindSphinx)
if (SPHINX_FOUND AND LLVM_ENABLE_SPHINX)
+ include(AddLLVM)
include(AddSphinxTarget)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html libunwind)
--
2.37.1

View File

@ -0,0 +1,59 @@
From cecb98f56e7d6619d0427fbdbc2f200ce212f0c6 Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine@redhat.com>
Date: Tue, 28 Jan 2025 08:34:09 +0000
Subject: [PATCH] [polly] shared libs
---
polly/cmake/polly_macros.cmake | 5 ++++-
polly/lib/CMakeLists.txt | 1 +
polly/lib/External/CMakeLists.txt | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/polly/cmake/polly_macros.cmake b/polly/cmake/polly_macros.cmake
index 9bd7b0b0ea59..fc2c3a76901f 100644
--- a/polly/cmake/polly_macros.cmake
+++ b/polly/cmake/polly_macros.cmake
@@ -1,5 +1,5 @@
macro(add_polly_library name)
- cmake_parse_arguments(ARG "" "" "" ${ARGN})
+ cmake_parse_arguments(ARG "SHARED" "" "" ${ARGN})
set(srcs ${ARG_UNPARSED_ARGUMENTS})
if(MSVC_IDE OR XCODE)
file( GLOB_RECURSE headers *.h *.td *.def)
@@ -17,6 +17,9 @@ macro(add_polly_library name)
else()
set(libkind)
endif()
+ if (ARG_SHARED)
+ set(libkind SHARED)
+ endif()
add_library( ${name} ${libkind} ${srcs} )
set_target_properties(${name} PROPERTIES FOLDER "Polly/Libraries")
diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index d91f4ecd37e6..965f635b7ff6 100644
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -41,6 +41,7 @@ set(POLLY_COMPONENTS
# the sources them to be recompiled for each of them.
add_llvm_pass_plugin(Polly
NO_MODULE
+ SHARED
SUBPROJECT Polly
Analysis/DependenceInfo.cpp
Analysis/PolyhedralInfo.cpp
diff --git a/polly/lib/External/CMakeLists.txt b/polly/lib/External/CMakeLists.txt
index 5dd69b7199dc..f065fbd7b942 100644
--- a/polly/lib/External/CMakeLists.txt
+++ b/polly/lib/External/CMakeLists.txt
@@ -284,6 +284,7 @@ if (POLLY_BUNDLED_ISL)
)
add_polly_library(PollyISL
+ SHARED
${ISL_FILES}
)
--
2.46.0

View File

@ -51,6 +51,32 @@
%bcond_with mlir
%endif
# The libcxx build condition also enables libcxxabi and libunwind.
%if %{without compat_build}
%bcond_without libcxx
%else
%bcond_with libcxx
%endif
# I've called the build condition "build_bolt" to indicate that this does not
# necessarily "use" BOLT in order to build LLVM.
%if %{without compat_build}
# BOLT only supports aarch64 and x86_64
%ifarch aarch64 x86_64
%bcond_without build_bolt
%else
%bcond_with build_bolt
%endif
%else
%bcond_with build_bolt
%endif
%if %{without compat_build}
%bcond_without polly
%else
%bcond_with polly
%endif
# Disable LTO on x86 and riscv in order to reduce memory consumption.
%ifarch %ix86 riscv64
%bcond_with lto_build
@ -192,6 +218,20 @@
%global pkg_name_mlir mlir%{pkg_suffix}
#endregion MLIR globals
#region libcxx globals
%global pkg_name_libcxx libcxx
%global pkg_name_libcxxabi libcxxabi
%global pkg_name_llvm_libunwind llvm-libunwind
#endregion libcxx globals
#region BOLT globals
%global pkg_name_bolt llvm-bolt%{pkg_suffix}
#endregion BOLT globals
#region polly globals
%global pkg_name_polly polly%{pkg_suffix}
#endregion polly globals
#region packages
#region main package
Name: %{pkg_name_llvm}
@ -251,14 +291,11 @@ Source1000: version.spec.inc
# behind the latest packaged LLVM version.
#region OpenMP patches
Patch1900: 0001-openmp-Add-option-to-disable-tsan-tests-111548.patch
Patch1901: 0001-openmp-Use-core_siblings_list-if-physical_package_id.patch
#endregion OpenMP patches
#region CLANG patches
Patch101: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch
Patch102: 0003-PATCH-clang-Don-t-install-static-libraries.patch
#endregion CLANG patches
# Workaround a bug in ORC on ppc64le.
# More info is available here: https://reviews.llvm.org/D159115#4641826
@ -267,20 +304,13 @@ Patch103: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch
# With the introduction of --gcc-include-dir in the clang config file,
# this might no longer be needed.
Patch104: 0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch
#endregion CLANG patches
#region MLIR patches
# See https://github.com/llvm/llvm-project/pull/108579
Patch1904: 0001-mlir-python-Reuse-the-library-directory.patch
# See https://github.com/llvm/llvm-project/pull/108461
Patch1905: 0001-CMake-Add-missing-dependency-108461.patch
# See https://github.com/llvm/llvm-project/pull/118542
Patch1906: 0001-mlir-Specify-deps-via-LLVM_LINK_COMPONENTS.patch
#endregion MLIR patches
#region LLD patches
Patch1800: 0001-18-Always-build-shared-libs-for-LLD.patch
Patch1902: 0001-19-Always-build-shared-libs-for-LLD.patch
Patch2000: 0001-19-Always-build-shared-libs-for-LLD.patch
Patch106: 0001-19-Always-build-shared-libs-for-LLD.patch
#endregion LLD patches
#region RHEL patches
@ -288,15 +318,14 @@ Patch2000: 0001-19-Always-build-shared-libs-for-LLD.patch
Patch501: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch
#endregion RHEL patches
# Backport with modifications from
# https://github.com/llvm/llvm-project/pull/99273
# Fixes RHEL-49517.
Patch1801: 18-99273.patch
#region BOLT patches
#endregion BOLT patches
# Fix profiling after a binutils NOTE change.
# https://github.com/llvm/llvm-project/pull/114907
Patch1802: 0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch
Patch1903: 0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch
#region polly patches
# See https://github.com/llvm/llvm-project/pull/122123
Patch2001: 0001-20-polly-shared-libs.patch
Patch2101: 0001-20-polly-shared-libs.patch
#endregion polly patches
%if 0%{?rhel} == 8
%global python3_pkgversion 3.12
@ -838,6 +867,125 @@ Requires: python%{python3_pkgversion}-numpy
MLIR python bindings.
%endif
#endregion MLIR packages
#region libcxx packages
%if %{with libcxx}
%package -n %{pkg_name_libcxx}
Summary: C++ standard library targeting C++11
License: Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
URL: http://libcxx.llvm.org/
Requires: %{pkg_name_libcxxabi}%{?_isa} = %{version}-%{release}
%description -n %{pkg_name_libcxx}
libc++ is a new implementation of the C++ standard library, targeting C++11 and above.
%package -n %{pkg_name_libcxx}-devel
Summary: Headers and libraries for %{pkg_name_libcxx} devel
Requires: %{pkg_name_libcxx}%{?_isa} = %{version}-%{release}
Requires: %{pkg_name_libcxxabi}-devel
%description -n %{pkg_name_libcxx}-devel
Headers and libraries for %{pkg_name_libcxx} devel.
%package -n %{pkg_name_libcxx}-static
Summary: Static libraries for %{pkg_name_libcxx}
%description -n %{pkg_name_libcxx}-static
Static libraries for %{pkg_name_libcxx}.
%package -n %{pkg_name_libcxxabi}
Summary: Low level support for a standard C++ library
%description -n %{pkg_name_libcxxabi}
libcxxabi provides low level support for a standard C++ library.
%package -n %{pkg_name_libcxx}abi-devel
Summary: Headers and libraries for %{pkg_name_libcxxabi} devel
Requires: %{pkg_name_libcxxabi}%{?_isa} = %{version}-%{release}
%description -n %{pkg_name_libcxxabi}-devel
Headers and libraries for %{pkg_name_libcxxabi} devel.
%package -n %{pkg_name_libcxxabi}-static
Summary: Static libraries for %{pkg_name_libcxxabi}
%description -n %{pkg_name_libcxxabi}-static
Static libraries for %{pkg_name_libcxxabi}.
%package -n %{pkg_name_llvm_libunwind}
Summary: LLVM libunwind
%description -n %{pkg_name_llvm_libunwind}
LLVM libunwind is an implementation of the interface defined by the HP libunwind
project. It was contributed Apple as a way to enable clang++ to port to
platforms that do not have a system unwinder. It is intended to be a small and
fast implementation of the ABI, leaving off some features of HP's libunwind
that never materialized (e.g. remote unwinding).
%package -n %{pkg_name_llvm_libunwind}-devel
Summary: LLVM libunwind development files
Provides: %{pkg_name_llvm_libunwind}(major) = %{maj_ver}
Requires: %{pkg_name_llvm_libunwind}%{?_isa} = %{version}-%{release}
%description -n %{pkg_name_llvm_libunwind}-devel
Unversioned shared library for LLVM libunwind
%package -n %{pkg_name_llvm_libunwind}-static
Summary: Static library for LLVM libunwind
%description -n %{pkg_name_llvm_libunwind}-static
Static library for LLVM libunwind.
%endif
#endregion libcxx packages
#region BOLT packages
%if %{with build_bolt}
%package -n %{pkg_name_bolt}
Summary: A post-link optimizer developed to speed up large applications
License: Apache-2.0 WITH LLVM-exception
URL: https://github.com/llvm/llvm-project/tree/main/bolt
# As hinted by bolt documentation
Recommends: gperftools-devel
%description -n %{pkg_name_bolt}
BOLT is a post-link optimizer developed to speed up large applications.
It achieves the improvements by optimizing application's code layout based on
execution profile gathered by sampling profiler, such as Linux `perf` tool.
%endif
#endregion BOLT packages
#region polly packages
%if %{with polly}
%package -n %{pkg_name_polly}
Summary: LLVM Framework for High-Level Loop and Data-Locality Optimizations
License: Apache-2.0 WITH LLVM-exception
URL: http://polly.llvm.org
# We no longer ship polly-doc.
Obsoletes: %{pkg_name_polly}-doc < 20
%description -n %{pkg_name_polly}
Polly is a high-level loop and data-locality optimizer and optimization
infrastructure for LLVM. It uses an abstract mathematical representation based
on integer polyhedron to analyze and optimize the memory access pattern of a
program.
%package -n %{pkg_name_polly}-devel
Summary: Polly header files
Requires: %{pkg_name_polly} = %{version}-%{release}
%description -n %{pkg_name_polly}-devel
Polly header files.
%endif
#endregion polly packages
#endregion packages
#region prep
@ -911,6 +1059,12 @@ MLIR python bindings.
#endregion COMPILER-RT preparation
#region libcxx preparation
%if %{with libcxx}
%py3_shebang_fix libcxx/utils/
%endif
#endregion libcxx preparation
#endregion prep
#region build
@ -931,6 +1085,7 @@ MLIR python bindings.
%endif
%global projects clang;clang-tools-extra;lld
%global runtimes compiler-rt;openmp;offload
%if %{with lldb}
%global projects %{projects};lldb
%endif
@ -938,6 +1093,18 @@ MLIR python bindings.
%global projects %{projects};mlir
%endif
%if %{with build_bolt}
%global projects %{projects};bolt
%endif
%if %{with polly}
%global projects %{projects};polly
%endif
%if %{with libcxx}
%global runtimes %{runtimes};libcxx;libcxxabi;libunwind
%endif
# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files.
export ASMFLAGS="%{build_cflags}"
@ -1039,6 +1206,31 @@ popd
%endif
#endregion lldb options
#region libcxx options
%if %{with libcxx}
%global cmake_config_args %{cmake_config_args} \\\
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \\\
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \\\
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \\\
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \\\
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\
-DLIBUNWIND_INSTALL_INCLUDE_DIR=%{_includedir}/llvm-libunwind
# If we don't set the .._INSTALL_LIBRARY_DIR variables,
# the *.so files will be placed in a subdirectory that includes the triple
%global cmake_config_args %{cmake_config_args} \\\
-DLIBCXX_INSTALL_LIBRARY_DIR=%{_libdir} \\\
-DLIBCXXABI_INSTALL_LIBRARY_DIR=%{_libdir} \\\
-DLIBUNWIND_INSTALL_LIBRARY_DIR=%{_libdir}
# If we don't adjust this, we will install into this unwanted location:
# /usr/include/i686-redhat-linux-gnu/c++/v1/__config_site
%global cmake_config_args %{cmake_config_args} \\\
-DLIBCXX_INSTALL_INCLUDE_TARGET_DIR=%{_includedir}/c++/v1
%endif
#endregion libcxx options
#region llvm options
%global cmake_config_args %{cmake_config_args} \\\
-DLLVM_APPEND_VC_REV:BOOL=OFF \\\
@ -1055,7 +1247,7 @@ popd
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \\\
-DLLVM_ENABLE_PROJECTS="%{projects}" \\\
-DLLVM_ENABLE_RTTI:BOOL=ON \\\
-DLLVM_ENABLE_RUNTIMES="compiler-rt;openmp;offload" \\\
-DLLVM_ENABLE_RUNTIMES="%{runtimes}" \\\
-DLLVM_ENABLE_ZLIB:BOOL=FORCE_ON \\\
-DLLVM_ENABLE_ZSTD:BOOL=FORCE_ON \\\
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \\\
@ -1090,6 +1282,13 @@ popd
-DLIBOMP_INSTALL_ALIASES=OFF
#endregion openmp options
#region polly options
%if %{with polly}
%global cmake_config_args %{cmake_config_args} \\\
-DLLVM_POLLY_LINK_INTO_TOOLS=OFF
%endif
#endregion polly options
#region test options
%global cmake_config_args %{cmake_config_args} \\\
-DLLVM_BUILD_TESTS:BOOL=ON \\\
@ -1330,6 +1529,30 @@ rm -rf %{buildroot}%{_prefix}/src/python
%endif
#endregion mlir installation
#region libcxx installation
%if %{with libcxx}
# We can't install the unversionned path on default location because that would conflict with
# https://src.fedoraproject.org/rpms/libunwind
#
# The versionned path has a different soname (libunwind.so.1 compared to
# libunwind.so.8) so they can live together in %%{_libdir}
#
# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't
# have the exact same ABI as gcc's libunwind (it actually provides a subset).
rm %{buildroot}%{_libdir}/libunwind.so
mkdir -p %{buildroot}/%{_libdir}/llvm-unwind/
pushd %{buildroot}/%{_libdir}/llvm-unwind
ln -s ../libunwind.so.1.0 libunwind.so
popd
%endif
#endregion libcxx installation
#region BOLT installation
# We don't ship libLLVMBOLT*.a
rm -f %{buildroot}%{_libdir}/libLLVMBOLT*.a
#endregion BOLT installation
#region CLANG installation
# Add a symlink in /usr/bin to clang-format-diff
@ -1365,9 +1588,6 @@ mkdir -p %{buildroot}%{_emacs_sitestartdir}
for f in clang-format.el clang-include-fixer.el; do
mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f
done
%if %{maj_ver} < 20
mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/clang-rename.el
%endif
# Add clang++-{version} symlink
ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver}
@ -1868,6 +2088,9 @@ adjust_lit_filter_out test_list_filter_out
%endif
%endif
#region test libcxx
# TODO(kkleine): Fedora rawhide didn't contain check runs. Evaluate if we want them here.
#endregion test libcxx
#region Test LLD
reset_test_opts
@ -1877,6 +2100,16 @@ reset_test_opts
#region Test MLIR
%if %{with mlir}
reset_test_opts
%if %{maj_ver} < 20
# The ml_dtypes python module required by mlir/test/python/execution_engine.py
# isn't packaged.
# isn't packaged. But in LLVM 20 the execution_engine.py is modified to only
# run certain tests if ml_dtypes is present.
test_list_filter_out+=("MLIR :: python/execution_engine.py")
test_list_filter_out+=("MLIR :: python/multithreaded_tests.py")
%endif
%ifarch s390x
# s390x does not support half-float
test_list_filter_out+=("mlir/test/python/execution_engine.py")
@ -1897,6 +2130,59 @@ export PYTHONPATH=%{buildroot}/%{python3_sitearch}
%endif
#endregion Test MLIR
#region BOLT tests
%if %{with build_bolt}
reset_test_opts
%if %{maj_ver} < 20
export LIT_XFAIL="$LIT_XFAIL;AArch64/build_id.c"
export LIT_XFAIL="$LIT_XFAIL;AArch64/plt-call.test"
export LIT_XFAIL="$LIT_XFAIL;X86/linux-static-keys.s"
export LIT_XFAIL="$LIT_XFAIL;X86/plt-call.test"
%endif
# Beginning with LLVM 20 this test has the "non-root-user" requirement
# and then the test should pass. But now it is flaky, hence we can only
# filter it out.
test_list_filter_out+=("BOLT :: unreadable-profile.test")
%ifarch aarch64
# Failing test cases on aarch64
# TODO(kkleine): The following used to fail on aarch64 but passed today.
#export LIT_XFAIL="$LIT_XFAIL;cache+-deprecated.test"
#export LIT_XFAIL="$LIT_XFAIL;bolt-icf.test"
#export LIT_XFAIL="$LIT_XFAIL;R_ABS.pic.lld.cpp"
# The following tests require LSE in order to run.
More info at: https://github.com/llvm/llvm-project/issues/86485
if ! grep -q atomics /proc/cpuinfo; then
test_list_filter_out+=("BOLT :: runtime/AArch64/basic-instrumentation.test")
test_list_filter_out+=("BOLT :: runtime/AArch64/hook-fini.test")
test_list_filter_out+=("BOLT :: runtime/AArch64/instrumentation-ind-call.c")
test_list_filter_out+=("BOLT :: runtime/exceptions-instrumentation.test")
test_list_filter_out+=("BOLT :: runtime/instrumentation-indirect-2.c")
test_list_filter_out+=("BOLT :: runtime/pie-exceptions-split.test")
fi
%endif
%if %{maj_ver} < 20
%ifarch x86_64
# BOLT-ERROR: instrumentation of static binary currently does not support profile output on binary
# finalization, so it requires -instrumentation-sleep-time=N (N>0) usage
export LIT_XFAIL="$LIT_XFAIL;X86/internal-call-instrument.s"
%endif
%endif
%cmake_build --target check-bolt
%endif
#endregion BOLT tests
#region polly tests
%if %{with polly}
reset_test_opts
%cmake_build --target check-polly
%endif
#endregion polly tests
%endif
%if %{with snapshot_build}
@ -2713,6 +2999,95 @@ fi
%{python3_sitearch}/mlir/
%endif
#endregion MLIR files
#region libcxx files
%if %{with libcxx}
%files -n %{pkg_name_libcxx}
%license libcxx/LICENSE.TXT
%doc libcxx/CREDITS.TXT libcxx/TODO.TXT
%{_libdir}/libc++.so.*
%files -n %{pkg_name_libcxx}-devel
%{_includedir}/c++/
%exclude %{_includedir}/c++/v1/cxxabi.h
%exclude %{_includedir}/c++/v1/__cxxabi_config.h
%{_libdir}/libc++.so
%{_libdir}/libc++.modules.json
%{_datadir}/libc++/v1/*
%files -n %{pkg_name_libcxx}-static
%license libcxx/LICENSE.TXT
%{_libdir}/libc++.a
%{_libdir}/libc++experimental.a
%files -n %{pkg_name_libcxxabi}
%license libcxxabi/LICENSE.TXT
%doc libcxxabi/CREDITS.TXT
%{_libdir}/libc++abi.so.*
%files -n %{pkg_name_libcxxabi}-devel
%{_includedir}/c++/v1/cxxabi.h
%{_includedir}/c++/v1/__cxxabi_config.h
%{_libdir}/libc++abi.so
%files -n %{pkg_name_libcxxabi}-static
%{_libdir}/libc++abi.a
%files -n %{pkg_name_llvm_libunwind}
%license libunwind/LICENSE.TXT
%{_libdir}/libunwind.so.1
%{_libdir}/libunwind.so.1.0
%files -n %{pkg_name_llvm_libunwind}-devel
%{_includedir}/llvm-libunwind/__libunwind_config.h
%{_includedir}/llvm-libunwind/libunwind.h
%{_includedir}/llvm-libunwind/libunwind.modulemap
%{_includedir}/llvm-libunwind/mach-o/compact_unwind_encoding.h
%{_includedir}/llvm-libunwind/unwind.h
%{_includedir}/llvm-libunwind/unwind_arm_ehabi.h
%{_includedir}/llvm-libunwind/unwind_itanium.h
%dir %{_libdir}/llvm-unwind
%{_libdir}/llvm-unwind/libunwind.so
%files -n %{pkg_name_llvm_libunwind}-static
%{_libdir}/libunwind.a
%endif
#endregion libcxx files
#region BOLT files
%if %{with build_bolt}
%files -n %{pkg_name_bolt}
%license bolt/LICENSE.TXT
%{_bindir}/llvm-bolt
%if %{maj_ver} >= 20
%{_bindir}/llvm-bolt-binary-analysis
%endif
%{_bindir}/llvm-boltdiff
%{_bindir}/llvm-bolt-heatmap
%{_bindir}/merge-fdata
%{_bindir}/perf2bolt
%{_libdir}/libbolt_rt_hugify.a
%{_libdir}/libbolt_rt_instr.a
%endif
#endregion BOLT files
#region polly files
%if %{with polly}
%files -n %{pkg_name_polly}
%license polly/LICENSE.TXT
%{_libdir}/LLVMPolly.so
%{_libdir}/libPolly.so.*
%{_libdir}/libPollyISL.so
%{_mandir}/man1/polly*
%files -n %{pkg_name_polly}-devel
%{_libdir}/libPolly.so
%{_includedir}/polly
%{_libdir}/cmake/polly
%endif
#endregion polly files
#endregion files
#region changelog