From 8dfdb6780c0050bf13b7fede9c8dad7149f58e67 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 29 Aug 2023 22:51:25 +0000 Subject: [PATCH] Fix FLOAT16 detection --- ...ler-rt-Fix-FLOAT16-feature-detection.patch | 36 +++++++++++++++++++ compiler-rt.spec | 7 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-compiler-rt-Fix-FLOAT16-feature-detection.patch diff --git a/0001-compiler-rt-Fix-FLOAT16-feature-detection.patch b/0001-compiler-rt-Fix-FLOAT16-feature-detection.patch new file mode 100644 index 0000000..8228ddc --- /dev/null +++ b/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 +@@ -5,7 +5,6 @@ + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + cmake_minimum_required(VERSION 3.20.0) + +- 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) +@@ -50,6 +49,8 @@ if (COMPILER_RT_STANDALONE_BUILD) + ON) + endif() + ++set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) ++ + include(builtin-config-ix) + include(CMakeDependentOption) + include(CMakePushCheckState) +-- +2.41.0 + diff --git a/compiler-rt.spec b/compiler-rt.spec index 82a8c4f..e4fabaa 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -34,7 +34,7 @@ Name: compiler-rt Version: %{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: LLVM "compiler-rt" runtime libraries License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT @@ -48,6 +48,8 @@ Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compil Source2: release-keys.asc %endif +Patch0: 0001-compiler-rt-Fix-FLOAT16-feature-detection.patch + BuildRequires: clang BuildRequires: cmake BuildRequires: ninja-build @@ -129,6 +131,9 @@ mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %changelog %{?llvm_snapshot_changelog_entry} +* Tue Aug 29 2023 Tom Stellard - 17.0.0~rc3-2 +- Fix FLOAT16 detection + * Fri Aug 25 2023 Tulio Magno Quites Machado Filho - 17.0.0~rc3-1 - Update to LLVM 17.0.0 RC3