Filter out cxxflags and cflags from llvm-config that aren't supported by clang

rhbz#1556980
This commit is contained in:
Tom Stellard 2018-03-16 18:00:24 +00:00
parent 3ff2527fa4
commit 1afade5cd8
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From acdb4ab5aa8076469fa551cc79e6bc7bbe8c06a5 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 16 Mar 2018 07:52:33 -0700
Subject: [PATCH] Filter out cxxflags not supported by clang
---
tools/llvm-config/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
index 25f99ce..922d4c5 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -33,7 +33,11 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+STRING(REGEX REPLACE "-mcet" "" LLVM_CFLAGS ${LLVM_CFLAGS})
+STRING(REGEX REPLACE "-fcf-protection" "" LLVM_CFLAGS ${LLVM_CFLAGS})
set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+STRING(REGEX REPLACE "-mcet" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
+STRING(REGEX REPLACE "-fcf-protection" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
set(LLVM_BUILD_SYSTEM cmake)
set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}")
--
1.8.3.1

View File

@ -12,7 +12,7 @@
Name: llvm Name: llvm
Version: %{maj_ver}.%{min_ver}.%{patch_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 6%{?dist} Release: 7%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
@ -24,6 +24,7 @@ Patch0: llvm-3.7.1-cmake-s390.patch
Patch3: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch Patch3: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch5: 0001-DebugInfo-Discard-invalid-DBG_VALUE-instructions-in-.patch Patch5: 0001-DebugInfo-Discard-invalid-DBG_VALUE-instructions-in-.patch
Patch6: 0001-Fixup-for-rL326769-RegState-Debug-is-being-truncated.patch Patch6: 0001-Fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
Patch7: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: ninja-build BuildRequires: ninja-build
@ -215,6 +216,10 @@ fi
%{_libdir}/cmake/llvm/LLVMStaticExports.cmake %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
%changelog %changelog
* Fri Mar 16 2018 Tom Stellard <tstellar@redhat.com> - 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 <tstellar@redhat.com> - 6.0.0-6 * Wed Mar 14 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-6
- Enable symbol versioning in libLLVM.so - Enable symbol versioning in libLLVM.so