From 46792abd81f2a45461857d2c4b4968eea1f1f7c8 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Mon, 15 Jan 2024 16:09:48 +0300 Subject: [PATCH] - Rebuild with clang - compiler-rt: Fix FLOAT16 feature detection --- ...ler-rt-Fix-FLOAT16-feature-detection.patch | 36 +++++++++++++++++++ SPECS/compiler-rt.spec | 16 ++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 SOURCES/0001-compiler-rt-Fix-FLOAT16-feature-detection.patch diff --git a/SOURCES/0001-compiler-rt-Fix-FLOAT16-feature-detection.patch b/SOURCES/0001-compiler-rt-Fix-FLOAT16-feature-detection.patch new file mode 100644 index 0000000..0459cbc --- /dev/null +++ b/SOURCES/0001-compiler-rt-Fix-FLOAT16-feature-detection.patch @@ -0,0 +1,36 @@ +From ce15f52198639e9195b8833ed60dc1a49c293956 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 29 Aug 2023 15:49:55 -0700 +Subject: [PATCH] compiler-rt: Fix FLOAT16 feature detection + +CMAKE_TRY_COMPILE_TARGET_TYPE defaults to EXECUTABLE, which causes +any feature detection code snippet without a main function to fail, +so we need to make sure it gets explicitly set to STATIC_LIBRARY. +--- + compiler-rt/lib/builtins/CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index 2fc70522895f..e83a1ecea50b 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -12,7 +12,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + "at least 3.20.0 now to avoid issues in the future!") + endif() + +- set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + project(CompilerRTBuiltins C ASM) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set(COMPILER_RT_BUILTINS_STANDALONE_BUILD TRUE) +@@ -56,6 +55,8 @@ if (COMPILER_RT_STANDALONE_BUILD) + "Turns on or off -fPIC for the builtin library source" + ON) + endif() ++ ++set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + + include(builtin-config-ix) + include(CMakePushCheckState) +-- +2.40.1 + diff --git a/SPECS/compiler-rt.spec b/SPECS/compiler-rt.spec index da03277..28c2b83 100644 --- a/SPECS/compiler-rt.spec +++ b/SPECS/compiler-rt.spec @@ -14,7 +14,7 @@ Name: compiler-rt Version: %{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}} -Release: 1%{?dist} +Release: 3%{?dist}.alma.1 Summary: LLVM "compiler-rt" runtime libraries License: NCSA or MIT @@ -29,8 +29,11 @@ Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compil Patch100: 0001-Drop-fno-stack-protector-from-the-compiler-flags.patch Patch101: fix-page-size-constant.patch -BuildRequires: gcc -BuildRequires: gcc-c++ +# Patches were taken from: +# https://gitlab.com/redhat/centos-stream/rpms/compiler-rt/-/commit/e6d638ab46fce7cdd203bf1805fb80d11bbf8a62 +Patch102: 0001-compiler-rt-Fix-FLOAT16-feature-detection.patch + +BuildRequires: clang BuildRequires: cmake BuildRequires: ninja-build BuildRequires: python3 @@ -72,6 +75,8 @@ cd %{_vpath_builddir} -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \ -DCMAKE_SKIP_RPATH:BOOL=ON \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ \ %if 0%{?__isa_bits} == 64 -DLLVM_LIBDIR_SUFFIX=64 \ @@ -79,7 +84,6 @@ cd %{_vpath_builddir} -DLLVM_LIBDIR_SUFFIX= \ %endif -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? - %cmake_build %install @@ -131,6 +135,10 @@ popd %endif %changelog +* Mon Jan 15 2024 Eduard Abdullin - 16.0.6-3.alma.1 +- Rebuild with clang +- compiler-rt: Fix FLOAT16 feature detection + * Fri Jun 23 2023 Tom Stellard - 16.0.6-1 - 16.0.6 Release