import clang-15.0.7-2.el9

This commit is contained in:
CentOS Sources 2023-03-28 09:52:03 +00:00 committed by root
parent 25b6d5e885
commit 0a3cf7e322
20 changed files with 396 additions and 272 deletions

View File

@ -1,3 +1,3 @@
88442d295bc0b96df7cf3d526ed9eabd7a214ac2 SOURCES/clang-14.0.6.src.tar.xz 7b4d1188cce1ce4ea1cf2ea362fba685c4aca34d SOURCES/clang-15.0.7.src.tar.xz
dac5046f0eb81e6c47432cf80229599befbf273e SOURCES/clang-tools-extra-14.0.6.src.tar.xz 752fe847136eff2dfbfcc8bbddfaa9319532d104 SOURCES/clang-tools-extra-15.0.7.src.tar.xz
b8d2648a01d36ed0186fd2c5af325fd28797f9a0 SOURCES/tstellar-gpg-key.asc 347bdd5ee6d6b93c9644c268511815912c0fb2dc SOURCES/release-keys.asc

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
SOURCES/clang-14.0.6.src.tar.xz SOURCES/clang-15.0.7.src.tar.xz
SOURCES/clang-tools-extra-14.0.6.src.tar.xz SOURCES/clang-tools-extra-15.0.7.src.tar.xz
SOURCES/tstellar-gpg-key.asc SOURCES/release-keys.asc

View File

@ -0,0 +1,82 @@
From 1d639f1379fc052b8437284955b1cb0baf880894 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 1 Jul 2022 21:24:17 -0700
Subject: clang-tools-extra: Make test dependency on LLVMHello optional
This fixes clang + clang-tools-extra standalone build after
36892727e4f19a60778e371d78f8fb09d8122c85.
---
clang-tools-extra/test/CMakeLists.txt | 10 +++++++++-
clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp | 2 +-
clang-tools-extra/test/lit.cfg.py | 3 +++
clang-tools-extra/test/lit.site.cfg.py.in | 1 +
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index f4c529ee8af2..1cfb4dd529aa 100644
--- a/clang-tools-extra/test/CMakeLists.txt
+++ b/clang-tools-extra/test/CMakeLists.txt
@@ -7,10 +7,15 @@
set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
+if (TARGET LLVMHello)
+ set (LLVM_HAS_LLVM_HELLO 1)
+endif()
+
llvm_canonicalize_cmake_booleans(
CLANG_TIDY_ENABLE_STATIC_ANALYZER
CLANG_PLUGIN_SUPPORT
LLVM_INSTALL_TOOLCHAIN_ONLY
+ LLVM_HAS_LLVM_HELLO
)
configure_lit_site_cfg(
@@ -86,7 +91,10 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
endif()
if(TARGET CTTestTidyModule)
- list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
+ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
+ if (TARGET LLVMHello)
+ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
+ endif()
target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
set(LLVM_LINK_COMPONENTS
diff --git a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp
index c66a94f458cf..b4e7a5d691e5 100644
--- a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp
+++ b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp
@@ -1,4 +1,4 @@
-// REQUIRES: plugins
+// REQUIRES: plugins, llvm-hello
// RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s
// CHECK-LIST: Enabled checks:
// CHECK-LIST-NEXT: mytest1
diff --git a/clang-tools-extra/test/lit.cfg.py b/clang-tools-extra/test/lit.cfg.py
index 9b99bfd93440..3fca9f25fb48 100644
--- a/clang-tools-extra/test/lit.cfg.py
+++ b/clang-tools-extra/test/lit.cfg.py
@@ -59,3 +59,6 @@ config.substitutions.append(
# Plugins (loadable modules)
if config.has_plugins and config.llvm_plugin_ext:
config.available_features.add('plugins')
+
+if config.has_llvm_hello:
+ config.available_features.add("llvm-hello")
diff --git a/clang-tools-extra/test/lit.site.cfg.py.in b/clang-tools-extra/test/lit.site.cfg.py.in
index 4eb830a1baf1..6e5559348454 100644
--- a/clang-tools-extra/test/lit.site.cfg.py.in
+++ b/clang-tools-extra/test/lit.site.cfg.py.in
@@ -11,6 +11,7 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@
+config.has_llvm_hello = @LLVM_HAS_LLVM_HELLO@
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
--
2.37.1

View File

@ -1,39 +0,0 @@
From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Wed, 4 Aug 2021 14:05:38 -0700
Subject: [PATCH] cmake: Allow shared libraries to customize the soname using
LLVM_ABI_REVISION
The LLVM_ABI_REVISION variable is intended to be used for release
candidates which introduce an ABI change to a shared library. This
variable can be specified per library, so there is not one global value
for all of LLVM.
For example, if we LLVM X.0.0-rc2 introduces an ABI change for a library
compared with LLVM X.0.0-rc1, then the LLVM_ABI_REVISION number for
library will be incremented by 1.
In the main branch, LLVM_ABI_REVISION should always be 0, it is only
meant to be used in the release branch.
Differential Revision: https://reviews.llvm.org/D105594
---
clang/tools/clang-shlib/CMakeLists.txt | 5 +++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/clang/tools/clang-shlib/CMakeLists.txt b/clang/tools/clang-shlib/CMakeLists.txt
index 9c1f8ea452b3..4d785924e4bb 100644
--- a/clang/tools/clang-shlib/CMakeLists.txt
+++ b/clang/tools/clang-shlib/CMakeLists.txt
@@ -1,3 +1,8 @@
+# In the main branch, LLVM_ABI_REVISION should always be 0. In the release
+# branches, this should be incremented before each release candidate every
+# time the ABI of libclang-cpp.so changes.
+set(LLVM_ABI_REVISION 0)
+
# Building libclang-cpp.so fails if LLVM_ENABLE_PIC=Off
if (NOT LLVM_ENABLE_PIC)
return()
--
2.27.0

View File

@ -1,8 +1,7 @@
From d68a5a7817dc0d43853d8b84c9185dc24338664f Mon Sep 17 00:00:00 2001 From ccf3e4407e7a5c4c1f2e41c89aad9f86a9c7d81d Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com> From: Tom Stellard <tstellar@redhat.com>
Date: Wed, 6 Oct 2021 05:32:44 +0000 Date: Wed, 6 Oct 2021 05:32:44 +0000
Subject: [PATCH] Driver: Add a gcc equivalent triple to the list of triples to Subject: Driver: Add a gcc equivalent triple to the list of triples to search
search
There are some gcc triples, like x86_64-redhat-linux, that provide the There are some gcc triples, like x86_64-redhat-linux, that provide the
same behavior as a clang triple with a similar name (e.g. same behavior as a clang triple with a similar name (e.g.
@ -15,10 +14,10 @@ Differential Revision: https://reviews.llvm.org/D111207
1 file changed, 22 insertions(+) 1 file changed, 22 insertions(+)
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index fe5bda5c6605..fd4a7f72be14 100644 index f203cae1d329..12fa2da3187e 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp --- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1884,6 +1884,18 @@ static llvm::StringRef getGCCToolchainDir(const ArgList &Args, @@ -1969,6 +1969,18 @@ static llvm::StringRef getGCCToolchainDir(const ArgList &Args,
return GCC_INSTALL_PREFIX; return GCC_INSTALL_PREFIX;
} }
@ -37,7 +36,7 @@ index fe5bda5c6605..fd4a7f72be14 100644
/// Initialize a GCCInstallationDetector from the driver. /// Initialize a GCCInstallationDetector from the driver.
/// ///
/// This performs all of the autodetection and sets up the various paths. /// This performs all of the autodetection and sets up the various paths.
@@ -1904,6 +1916,16 @@ void Generic_GCC::GCCInstallationDetector::init( @@ -1989,6 +2001,16 @@ void Generic_GCC::GCCInstallationDetector::init(
// The compatible GCC triples for this particular architecture. // The compatible GCC triples for this particular architecture.
SmallVector<StringRef, 16> CandidateTripleAliases; SmallVector<StringRef, 16> CandidateTripleAliases;
SmallVector<StringRef, 16> CandidateBiarchTripleAliases; SmallVector<StringRef, 16> CandidateBiarchTripleAliases;
@ -55,5 +54,5 @@ index fe5bda5c6605..fd4a7f72be14 100644
CandidateTripleAliases, CandidateBiarchLibDirs, CandidateTripleAliases, CandidateBiarchLibDirs,
CandidateBiarchTripleAliases); CandidateBiarchTripleAliases);
-- --
2.26.2 2.37.1

View File

@ -0,0 +1,29 @@
From 1d224b408bc6754bcea9e0b226d6c440f5a4f8fd Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Fri, 2 Sep 2022 16:30:15 +0200
Subject: Mark fopenmp-implicit-rpath as NoArgumentUnused
We pass this option unconditionally in LDFLAGS, make sure this
does not warn if openmp is not used, as this may break some
build systems.
---
clang/include/clang/Driver/Options.td | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 3cab37b21aaf..4452364f92da 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4116,7 +4116,8 @@ defm openmp_implicit_rpath: BoolFOption<"openmp-implicit-rpath",
LangOpts<"OpenMP">,
DefaultTrue,
PosFlag<SetTrue, [], "Set rpath on OpenMP executables">,
- NegFlag<SetFalse>>;
+ NegFlag<SetFalse>,
+ BothFlags<[NoArgumentUnused]>>;
def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>,
Group<Link_Group>;
def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, FlangOption, NoXarchOption]>,
--
2.37.1

View File

@ -1,17 +1,17 @@
From c6b921c8d833546946b70a8c2640032fd7c62461 Mon Sep 17 00:00:00 2001 From ccfad825687fc45d04ddb987c476dfafb26e56d9 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com> From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:04:52 +0100 Date: Thu, 25 Feb 2021 14:04:52 +0100
Subject: [PATCH 1/6] [PATCH][clang] Reorganize gtest integration Subject: Reorganize gtest integration
--- ---
clang/CMakeLists.txt | 12 +++++------- clang/CMakeLists.txt | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-) 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 9e74014..0185276 100644 index 13d76e7fd935..7452bafb0756 100644
--- a/clang/CMakeLists.txt --- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt
@@ -153,12 +153,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) @@ -159,12 +159,6 @@ if(CLANG_BUILT_STANDALONE)
set(LLVM_UTILS_PROVIDED ON) set(LLVM_UTILS_PROVIDED ON)
set(CLANG_TEST_DEPS FileCheck count not) set(CLANG_TEST_DEPS FileCheck count not)
endif() endif()
@ -24,7 +24,7 @@ index 9e74014..0185276 100644
else() else()
# Seek installed Lit. # Seek installed Lit.
find_program(LLVM_LIT find_program(LLVM_LIT
@@ -537,7 +531,11 @@ endif() @@ -586,7 +580,11 @@ endif()
if( CLANG_INCLUDE_TESTS ) if( CLANG_INCLUDE_TESTS )
@ -38,5 +38,5 @@ index 9e74014..0185276 100644
list(APPEND CLANG_TEST_DEPS ClangUnitTests) list(APPEND CLANG_TEST_DEPS ClangUnitTests)
list(APPEND CLANG_TEST_PARAMS list(APPEND CLANG_TEST_PARAMS
-- --
1.8.3.1 2.37.1

View File

@ -1,7 +1,7 @@
From 0f97b7209eed4a428171af6044fe7e0aaf81ee2a Mon Sep 17 00:00:00 2001 From 0ff89f236b9cc11662cf4f288cfd3254410d8243 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com> From: Nikita Popov <npopov@redhat.com>
Date: Thu, 3 Feb 2022 10:34:44 +0100 Date: Thu, 3 Feb 2022 10:34:44 +0100
Subject: [PATCH] Work around gcc miscompile Subject: Work around gcc miscompile
This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104334, This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104334,
which miscompiles clang on s390x and ppc64le. The issue is already which miscompiles clang on s390x and ppc64le. The issue is already
@ -28,6 +28,5 @@ index d4dc790c008a..77a1e6c32c6f 100644
diag::err_invalid_vector_long_double_decl_spec); diag::err_invalid_vector_long_double_decl_spec);
else if (!S.Context.getTargetInfo().hasFeature("vsx") && else if (!S.Context.getTargetInfo().hasFeature("vsx") &&
-- --
2.34.1 2.37.1

View File

@ -1,17 +1,17 @@
From 88704fc2eabb9dd19a9c3eb81a9b3dc37d95651c Mon Sep 17 00:00:00 2001 From 6e0c48576740a1da9abeecfb8070127b8e91ab73 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com> From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 31 Jan 2020 11:04:57 -0800 Date: Fri, 31 Jan 2020 11:04:57 -0800
Subject: [PATCH][clang] Don't install static libraries Subject: Don't install static libraries
--- ---
clang/cmake/modules/AddClang.cmake | 2 +- clang/cmake/modules/AddClang.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index 5752f4277444..0f52822d91f0 100644 index 21ac332e4f5f..d0cf20cced21 100644
--- a/clang/cmake/modules/AddClang.cmake --- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake
@@ -113,7 +113,7 @@ macro(add_clang_library name) @@ -114,7 +114,7 @@ macro(add_clang_library name)
if(TARGET ${lib}) if(TARGET ${lib})
target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS}) target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS})
@ -21,5 +21,5 @@ index 5752f4277444..0f52822d91f0 100644
install(TARGETS ${lib} install(TARGETS ${lib}
COMPONENT ${lib} COMPONENT ${lib}
-- --
2.30.2 2.37.1

View File

@ -1,22 +1,20 @@
From c87abee7356b8fde81512ffceadd520776c465d2 Mon Sep 17 00:00:00 2001 From 54806261c76384ae45de93b7b5ac2de4e74bb7ae Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com> From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:09:29 +0100 Date: Wed, 21 Sep 2022 12:21:06 +0200
Subject: [PATCH] [PATCH][clang] Make -funwind-tables the default on all archs Subject: Make -funwind-tables the default on all archs
--- ---
clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++++
1 file changed, 6 insertions(+) 1 file changed, 4 insertions(+)
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
b/clang/lib/Driver/ToolChains/Gnu.cpp index 12fa2da3187e..96527ed52445 100644
index d0808d061c82..de9c9743cd38 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp --- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2701,6 +2701,11 @@ bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const { @@ -2845,6 +2845,10 @@ bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
case llvm::Triple::ppc64le: case llvm::Triple::ppc64le:
case llvm::Triple::x86: case llvm::Triple::x86:
case llvm::Triple::x86_64: case llvm::Triple::x86_64:
+
+ // Enable -funwind-tables on all architectures supported by Fedora: + // Enable -funwind-tables on all architectures supported by Fedora:
+ // rhbz#1655546 + // rhbz#1655546
+ case llvm::Triple::systemz: + case llvm::Triple::systemz:
@ -25,5 +23,5 @@ index d0808d061c82..de9c9743cd38 100644
default: default:
return false; return false;
-- --
2.27.0 2.37.1

View File

@ -1,7 +1,7 @@
From 6509777d4c12a42c7487814d868375a86712bf5b Mon Sep 17 00:00:00 2001 From 62728c7321a2d07f7d22dadc2b8565ad512b3da4 Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine@redhat.com> From: Konrad Kleine <kkleine@redhat.com>
Date: Thu, 24 Mar 2022 09:44:21 +0100 Date: Thu, 24 Mar 2022 09:44:21 +0100
Subject: [PATCH][clang]Produce DWARF4 by default Subject: Produce DWARF4 by default
Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream: Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream:
@ -10,15 +10,16 @@ https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8
clang/include/clang/Driver/ToolChain.h | 2 +- clang/include/clang/Driver/ToolChain.h | 2 +-
clang/test/CodeGen/dwarf-version.c | 4 ++-- clang/test/CodeGen/dwarf-version.c | 4 ++--
clang/test/Driver/cl-options.c | 2 +- clang/test/Driver/cl-options.c | 2 +-
clang/test/Driver/clang-g-opts.c | 2 +-
clang/test/Driver/ve-toolchain.c | 2 +- clang/test/Driver/ve-toolchain.c | 2 +-
clang/test/Driver/ve-toolchain.cpp | 2 +- clang/test/Driver/ve-toolchain.cpp | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-) 6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h
index adf1753e8d3a..c8adc4d917ce 100644 index f20ab164531b..53c86ee82936 100644
--- a/clang/include/clang/Driver/ToolChain.h --- a/clang/include/clang/Driver/ToolChain.h
+++ b/clang/include/clang/Driver/ToolChain.h +++ b/clang/include/clang/Driver/ToolChain.h
@@ -515,7 +515,7 @@ public: @@ -535,7 +535,7 @@ public:
// Return the DWARF version to emit, in the absence of arguments // Return the DWARF version to emit, in the absence of arguments
// to the contrary. // to the contrary.
@ -43,10 +44,10 @@ index 0a6fa4768026..96f01749d0d8 100644
// The -isysroot is used as a hack to avoid LIT messing with the SDKROOT // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT
// environment variable which indirecty overrides the version in the target // environment variable which indirecty overrides the version in the target
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index f332cd83b26e..911779fffbef 100644 index a2e350a0a835..01889ba0bf9b 100644
--- a/clang/test/Driver/cl-options.c --- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c
@@ -597,7 +597,7 @@ @@ -570,7 +570,7 @@
// RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
// Z7_gdwarf: "-gcodeview" // Z7_gdwarf: "-gcodeview"
// Z7_gdwarf: "-debug-info-kind=constructor" // Z7_gdwarf: "-debug-info-kind=constructor"
@ -55,35 +56,10 @@ index f332cd83b26e..911779fffbef 100644
// RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s // RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s
// CXX11: -std=c++11 // CXX11: -std=c++11
diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c diff --git a/clang/test/Driver/clang-g-opts.c b/clang/test/Driver/clang-g-opts.c
index 753dee19fcbf..dfd12cc0bba4 100644 index d982b1070cae..bb129e75769c 100644
--- a/clang/test/Driver/ve-toolchain.c --- a/clang/test/Driver/clang-g-opts.c
+++ b/clang/test/Driver/ve-toolchain.c +++ b/clang/test/Driver/clang-g-opts.c
@@ -6,7 +6,7 @@
/// Checking dwarf-version
// RUN: %clang -### -g -target ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
-// DWARF_VER: "-dwarf-version=5"
+// DWARF_VER: "-dwarf-version=4"
///-----------------------------------------------------------------------------
/// Checking include-path
diff --git a/clang/test/Driver/ve-toolchain.cpp b/clang/test/Driver/ve-toolchain.cpp
index 4b2b9c5747fe..3a196dd94ca1 100644
--- a/clang/test/Driver/ve-toolchain.cpp
+++ b/clang/test/Driver/ve-toolchain.cpp
@@ -7,7 +7,7 @@
// RUN: %clangxx -### -g -target ve-unknown-linux-gnu \
// RUN: %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
-// DWARF_VER: "-dwarf-version=5"
+// DWARF_VER: "-dwarf-version=4"
///-----------------------------------------------------------------------------
/// Checking include-path
diff -ruN clang-14.0.0.src.orig/test/Driver/clang-g-opts.c clang-14.0.0.src/test/Driver/clang-g-opts.c
--- a/clang-14.0.0.src.orig/test/Driver/clang-g-opts.c 2022-03-14 10:44:55.000000000 +0100
+++ b/clang-14.0.0.src/test/Driver/clang-g-opts.c 2022-04-13 06:36:55.832253890 +0200
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
// CHECK-WITHOUT-G-NOT: -debug-info-kind // CHECK-WITHOUT-G-NOT: -debug-info-kind
@ -93,6 +69,32 @@ diff -ruN clang-14.0.0.src.orig/test/Driver/clang-g-opts.c clang-14.0.0.src/test
// CHECK-WITH-G-DWARF2: "-dwarf-version=2" // CHECK-WITH-G-DWARF2: "-dwarf-version=2"
// CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone" // CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"
-- diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c
2.35.1 index 32e25769b6da..b8a2852daba8 100644
--- a/clang/test/Driver/ve-toolchain.c
+++ b/clang/test/Driver/ve-toolchain.c
@@ -6,7 +6,7 @@
/// Checking dwarf-version
// RUN: %clang -### -g --target=ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
-// DWARF_VER: "-dwarf-version=5"
+// DWARF_VER: "-dwarf-version=4"
///-----------------------------------------------------------------------------
/// Checking include-path
diff --git a/clang/test/Driver/ve-toolchain.cpp b/clang/test/Driver/ve-toolchain.cpp
index 5a33d5eceb61..cedf895b36dc 100644
--- a/clang/test/Driver/ve-toolchain.cpp
+++ b/clang/test/Driver/ve-toolchain.cpp
@@ -7,7 +7,7 @@
// RUN: %clangxx -### -g --target=ve-unknown-linux-gnu \
// RUN: %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
-// DWARF_VER: "-dwarf-version=5"
+// DWARF_VER: "-dwarf-version=4"
///-----------------------------------------------------------------------------
/// Checking include-path
--
2.37.1

View File

@ -1,7 +1,17 @@
diff -ruN clang-14.0.0.src.orig/docs/conf.py clang-14.0.0.src/docs/conf.py From f4e2d711e5cfd8e357d770e2da7a114086ee8659 Mon Sep 17 00:00:00 2001
--- a/clang-14.0.0.src.orig/docs/conf.py 2022-03-14 10:44:55.000000000 +0100 From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder@redhat.com>
+++ b/clang-14.0.0.src/docs/conf.py 2022-04-11 11:13:44.483641113 +0200 Date: Thu, 22 Sep 2022 10:49:43 +0200
@@ -37,20 +37,7 @@ Subject: disable recommonmark
---
clang/docs/conf.py | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
index b8a42018191a..912449a7f792 100644
--- a/clang/docs/conf.py
+++ b/clang/docs/conf.py
@@ -37,20 +37,7 @@ source_suffix = {
'.rst': 'restructuredtext', '.rst': 'restructuredtext',
} }
@ -23,4 +33,6 @@ diff -ruN clang-14.0.0.src.orig/docs/conf.py clang-14.0.0.src/docs/conf.py
# The encoding of source files. # The encoding of source files.
#source_encoding = 'utf-8-sig' #source_encoding = 'utf-8-sig'
--
2.37.1

View File

@ -0,0 +1,74 @@
From bc9aa904bf9d24e7f39a2a866ff6b463858b6ccb Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Wed, 21 Sep 2022 16:08:45 +0200
Subject: [PATCH] [clang] Fix interaction between asm labels and inline
builtins
One must pick the same name as the one referenced in CodeGenFunction when
generating .inline version of an inline builtin, otherwise they are not
correctly replaced.
Differential Revision: https://reviews.llvm.org/D134362
---
clang/lib/CodeGen/CGExpr.cpp | 5 ++-
.../test/CodeGen/asm-label-inline-builtins.c | 32 +++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 clang/test/CodeGen/asm-label-inline-builtins.c
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index bf3dd812b9e8..a951d53423bf 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -5046,7 +5046,10 @@ static CGCallee EmitDirectCallee(CodeGenFunction &CGF, GlobalDecl GD) {
if (auto builtinID = FD->getBuiltinID()) {
std::string NoBuiltinFD = ("no-builtin-" + FD->getName()).str();
std::string NoBuiltins = "no-builtins";
- std::string FDInlineName = (FD->getName() + ".inline").str();
+
+ auto *A = FD->getAttr<AsmLabelAttr>();
+ StringRef Ident = A ? A->getLabel() : FD->getName();
+ std::string FDInlineName = (Ident + ".inline").str();
bool IsPredefinedLibFunction =
CGF.getContext().BuiltinInfo.isPredefinedLibFunction(builtinID);
diff --git a/clang/test/CodeGen/asm-label-inline-builtins.c b/clang/test/CodeGen/asm-label-inline-builtins.c
new file mode 100644
index 000000000000..ab9afc29411d
--- /dev/null
+++ b/clang/test/CodeGen/asm-label-inline-builtins.c
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -triple x86_64 -S -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+//
+// Verifies that clang-generated *.inline carry the same name at call and callee
+// site, in spite of asm labels.
+
+typedef struct _IO_FILE FILE;
+extern FILE *stdout;
+extern int vprintf (const char *__restrict __format, __builtin_va_list __arg);
+extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
+ const char *__restrict __format, __builtin_va_list __ap);
+extern int __vprintf_chk (int __flag, const char *__restrict __format,
+ __builtin_va_list __ap);
+
+extern __typeof (vprintf) vprintf __asm ("__vprintfieee128");
+extern __typeof (__vfprintf_chk) __vfprintf_chk __asm ("__vfprintf_chkieee128");
+extern __typeof (__vprintf_chk) __vprintf_chk __asm ("__vprintf_chkieee128");
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+vprintf (const char *__restrict __fmt, __builtin_va_list __ap)
+{
+ return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap);
+}
+
+void test(const char *fmt, __builtin_va_list ap) {
+ vprintf(fmt, ap);
+}
+
+// CHECK-LABEL: void @test(
+// CHECK: call i32 @__vprintfieee128.inline(
+//
+// CHECK-LABEL: internal i32 @__vprintfieee128.inline(
+// CHECK: call i32 @__vfprintf_chkieee128(
--
2.37.2

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,61 +0,0 @@
diff -ruN a/clang-tools-extra-14.0.0rc2.src.orig/test/clang-tidy/CTTestTidyModule.cpp a/clang-tools-extra-14.0.0rc2.src/test/clang-tidy/CTTestTidyModule.cpp
--- a/clang-tools-extra-14.0.0rc2.src.orig/test/clang-tidy/CTTestTidyModule.cpp 2022-03-02 01:46:37.000000000 +0100
+++ a/clang-tools-extra-14.0.0rc2.src/test/clang-tidy/CTTestTidyModule.cpp 2022-03-07 08:52:20.009112976 +0100
@@ -1,4 +1,4 @@
-// REQUIRES: plugins
+// REQUIRES: plugins, llvm-hello
// RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s
// CHECK-LIST: Enabled checks:
// CHECK-LIST-NEXT: mytest1
diff -ruN a/clang-tools-extra-14.0.0rc2.src.orig/test/CMakeLists.txt a/clang-tools-extra-14.0.0rc2.src/test/CMakeLists.txt
--- a/clang-tools-extra-14.0.0rc2.src.orig/test/CMakeLists.txt 2022-03-02 01:46:37.000000000 +0100
+++ a/clang-tools-extra-14.0.0rc2.src/test/CMakeLists.txt 2022-03-07 10:58:56.172490672 +0100
@@ -15,10 +15,15 @@
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+if (TARGET LLVMHello)
+ set (LLVM_HAS_LLVM_HELLO 1)
+endif()
+
llvm_canonicalize_cmake_booleans(
CLANG_TIDY_ENABLE_STATIC_ANALYZER
CLANG_PLUGIN_SUPPORT
LLVM_INSTALL_TOOLCHAIN_ONLY
+ LLVM_HAS_LLVM_HELLO
)
configure_lit_site_cfg(
@@ -97,7 +102,10 @@
endif()
if(TARGET CTTestTidyModule)
- list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
+ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
+ if (TARGET LLVMHello)
+ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule) # Should be LLVMHello?
+ endif()
target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
set(LLVM_LINK_COMPONENTS
diff -ruN a/clang-tools-extra-14.0.0rc2.src.orig/test/lit.cfg.py a/clang-tools-extra-14.0.0rc2.src/test/lit.cfg.py
--- a/clang-tools-extra-14.0.0rc2.src.orig/test/lit.cfg.py 2022-03-02 01:46:37.000000000 +0100
+++ a/clang-tools-extra-14.0.0rc2.src/test/lit.cfg.py 2022-03-07 08:52:20.010112983 +0100
@@ -155,3 +155,6 @@
# Plugins (loadable modules)
if config.has_plugins and config.llvm_plugin_ext:
config.available_features.add('plugins')
+
+if config.has_llvm_hello:
+ config.available_features.add('llvm-hello')
diff -ruN a/clang-tools-extra-14.0.0rc2.src.orig/test/lit.site.cfg.py.in a/clang-tools-extra-14.0.0rc2.src/test/lit.site.cfg.py.in
--- a/clang-tools-extra-14.0.0rc2.src.orig/test/lit.site.cfg.py.in 2022-03-02 01:46:37.000000000 +0100
+++ a/clang-tools-extra-14.0.0rc2.src/test/lit.site.cfg.py.in 2022-03-07 10:59:17.202663983 +0100
@@ -13,6 +13,7 @@
config.target_triple = "@TARGET_TRIPLE@"
config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@
+config.has_llvm_hello = @LLVM_HAS_LLVM_HELLO@
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.

View File

@ -1,20 +0,0 @@
diff --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
index 253f78eb36ea..1199da3e4cfd 100644
--- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
@@ -30,7 +30,6 @@ add_extra_unittest(ClangTidyTests
OptionsProviderTest.cpp
OverlappingReplacementsTest.cpp
UsingInserterTest.cpp
- ReadabilityModuleTest.cpp
TransformerClangTidyCheckTest.cpp
)
@@ -54,7 +53,6 @@ target_link_libraries(ClangTidyTests
clangTidyGoogleModule
clangTidyLLVMModule
clangTidyObjCModule
- clangTidyReadabilityModule
clangTidyUtils
LLVMTestingSupport
)

View File

@ -1,10 +1,14 @@
# We are building with clang for faster/lower memory LTO builds.
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros
%global toolchain clang
%bcond_with compat_build %bcond_with compat_build
%bcond_with bundle_compat_lib %bcond_with bundle_compat_lib
%bcond_without check %bcond_without check
%global maj_ver 14 %global maj_ver 15
%global min_ver 0 %global min_ver 0
%global patch_ver 6 %global patch_ver 7
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver} %global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
%if %{with compat_build} %if %{with compat_build}
@ -26,61 +30,64 @@
%endif %endif
%if %{with bundle_compat_lib} %if %{with bundle_compat_lib}
%global compat_maj_ver 13 %global compat_maj_ver 14
%global compat_ver %{compat_maj_ver}.0.1 %global compat_ver %{compat_maj_ver}.0.6
%endif %endif
%ifarch ppc64le aarch64 %ifarch ppc64le aarch64
# Too many threads on ppc64 systems causes OOM errors. # Too many threads on ppc64 and aarch64 systems causes OOM errors.
%global _smp_mflags -j8 %global _smp_mflags -j8
%endif %endif
%global clang_srcdir clang-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src %global clang_srcdir clang-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
%global clang_tools_srcdir clang-tools-extra-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src %global clang_tools_srcdir clang-tools-extra-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
%if !%{maj_ver} && 0%{?rc_ver}
%global abi_revision 2
%endif
Name: %pkg_name Name: %pkg_name
Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}} Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist} Release: 2%{?dist}
Summary: A C language family front-end for LLVM Summary: A C language family front-end for LLVM
License: NCSA License: NCSA
URL: http://llvm.org URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz.sig Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz.sig
%if %{without compat_build} %if %{without compat_build}
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz.sig Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz.sig
%endif %endif
Source4: tstellar-gpg-key.asc Source4: release-keys.asc
%if %{with bundle_compat_lib} %if %{with bundle_compat_lib}
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/clang-%{compat_ver}.src.tar.xz Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/clang-%{compat_ver}.src.tar.xz
Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/clang-%{compat_ver}.src.tar.xz.sig
Source7: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz
Source8: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz.sig
Source9: tstellar-gpg-key.asc
%endif %endif
%if !0%{with compat_build} %if !0%{with compat_build}
Source7: macros.%{name} Source10: macros.%{name}
%endif %endif
# Patches for clang # Patches for clang
Patch0: 0001-PATCH-clang-Reorganize-gtest-integration.patch
Patch1: 0002-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch
Patch2: 0003-PATCH-clang-Don-t-install-static-libraries.patch
Patch3: 0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch
Patch4: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch
# This patch can be dropped once gcc-12.0.1-0.5.fc36 is in the repo.
Patch5: 0001-Work-around-gcc-miscompile.patch
Patch7: 0010-PATCH-clang-Produce-DWARF4-by-default.patch
Patch8: disable-recommonmark.patch
Patch2: 0002-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch
# TODO: Can be dropped in LLVM 16: https://reviews.llvm.org/D133316
Patch3: 0003-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch
Patch4: 0004-Reorganize-gtest-integration.patch
# This patch can be dropped once gcc-12.0.1-0.5.fc36 is in the repo.
Patch5: 0005-Work-around-gcc-miscompile.patch
Patch6: 0006-Don-t-install-static-libraries.patch
Patch7: 0007-Make-funwind-tables-the-default-on-all-archs.patch
Patch8: 0008-Produce-DWARF4-by-default.patch
Patch9: 0009-disable-recommonmark.patch
# TODO: Can be dropped in LLVM 16: https://reviews.llvm.org/D134362
Patch10: 0010-clang-Fix-interaction-between-asm-labels-and-inline-.patch
%if %{without compat_build}
# Patches for clang-tools-extra # Patches for clang-tools-extra
# See https://reviews.llvm.org/D120301 # See https://reviews.llvm.org/D120301
Patch201: llvm-hello.patch Patch201: 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch
# See https://github.com/llvm/llvm-project/issues/54116 %endif
Patch202: remove-test.patch
# RHEL only: We build LLVM with clang, which now defaults to using the # RHEL only: We build LLVM with clang, which now defaults to using the
# libstdc++ from gcc-toolset-12. Since we're linking some clang # libstdc++ from gcc-toolset-12. Since we're linking some clang
@ -89,6 +96,8 @@ Patch202: remove-test.patch
# to compile clang. # to compile clang.
BuildRequires: gcc-toolset-12-gcc-c++ BuildRequires: gcc-toolset-12-gcc-c++
BuildRequires: gcc-toolset-12-annobin-plugin-gcc BuildRequires: gcc-toolset-12-annobin-plugin-gcc
BuildRequires: gcc-toolset-12-libatomic-devel
BuildRequires: clang
BuildRequires: cmake BuildRequires: cmake
BuildRequires: ninja-build BuildRequires: ninja-build
%if %{with compat_build} %if %{with compat_build}
@ -119,12 +128,14 @@ BuildRequires: libatomic
# We need python3-devel for %%py3_shebang_fix # We need python3-devel for %%py3_shebang_fix
BuildRequires: python3-devel BuildRequires: python3-devel
%if %{without compat_build}
# For reproducible pyc file generation # For reproducible pyc file generation
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility # See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility
%if 0%{?fedora} %if 0%{?fedora}
BuildRequires: /usr/bin/marshalparser BuildRequires: /usr/bin/marshalparser
%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib} %global py_reproducible_pyc_path %{buildroot}%{python3_sitelib}
%endif %endif
%endif
# Needed for %%multilib_fix_c_header # Needed for %%multilib_fix_c_header
BuildRequires: multilib-rpm-config BuildRequires: multilib-rpm-config
@ -177,6 +188,8 @@ Summary: Runtime library for clang
Requires: %{name}-resource-filesystem%{?_isa} = %{version} Requires: %{name}-resource-filesystem%{?_isa} = %{version}
Requires: gcc-toolset-12-gcc-c++ Requires: gcc-toolset-12-gcc-c++
Recommends: compiler-rt%{?_isa} = %{version} Recommends: compiler-rt%{?_isa} = %{version}
# atomic support is not part of compiler-rt
Recommends: libatomic%{?_isa}
# libomp-devel is required, so clang can find the omp.h header when compiling # libomp-devel is required, so clang can find the omp.h header when compiling
# with -fopenmp. # with -fopenmp.
Recommends: libomp-devel%{_isa} = %{version} Recommends: libomp-devel%{_isa} = %{version}
@ -192,11 +205,11 @@ Runtime library for clang.
%package devel %package devel
Summary: Development header files for clang Summary: Development header files for clang
Requires: %{name}-libs = %{version}-%{release}
%if %{without compat_build} %if %{without compat_build}
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
# The clang CMake files reference tools from clang-tools-extra. # The clang CMake files reference tools from clang-tools-extra.
Requires: %{name}-tools-extra%{?_isa} = %{version}-%{release} Requires: %{name}-tools-extra%{?_isa} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
%endif %endif
%description devel %description devel
@ -230,6 +243,13 @@ Requires: emacs-filesystem
%description tools-extra %description tools-extra
A set of extra tools built using Clang's tooling API. A set of extra tools built using Clang's tooling API.
%package tools-extra-devel
Summary: Development header files for clang tools
Requires: %{name}-tools-extra = %{version}-%{release}
%description tools-extra-devel
Development header files for clang tools.
# Put git-clang-format in its own package, because it Requires git # Put git-clang-format in its own package, because it Requires git
# and we don't want to force users to install all those dependenices if they # and we don't want to force users to install all those dependenices if they
# just want clang. # just want clang.
@ -245,7 +265,7 @@ clang-format integration for git.
%package -n python3-clang %package -n python3-clang
Summary: Python3 bindings for clang Summary: Python3 bindings for clang
Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: python3 Requires: python3
%description -n python3-clang %description -n python3-clang
%{summary}. %{summary}.
@ -255,29 +275,27 @@ Requires: python3
%prep %prep
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}' %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%if %{with bundle_compat_lib} %if %{with bundle_compat_lib}
%{gpgverify} --keyring='%{SOURCE9}' --signature='%{SOURCE6}' --data='%{SOURCE5}'
%{gpgverify} --keyring='%{SOURCE9}' --signature='%{SOURCE8}' --data='%{SOURCE7}'
%setup -T -q -b 5 -n clang-%{compat_ver}.src %setup -T -q -b 5 -n clang-%{compat_ver}.src
%setup -T -q -b 6 -n llvm-%{compat_ver}.src %setup -T -q -b 7 -n llvm-%{compat_ver}.src
%endif %endif
%if %{with compat_build} %if %{with compat_build}
%autosetup -n %{clang_srcdir} -p2 %autosetup -n %{clang_srcdir} -p2
%else %else
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE1}' %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE2}'
%setup -T -q -b 1 -n %{clang_tools_srcdir} %setup -T -q -b 2 -n %{clang_tools_srcdir}
%autopatch -m200 -p2 %autopatch -m200 -p2
# This test is broken upstream. It is a clang-tidy unittest
# that includes a file from clang, breaking standalone builds.
# https://github.com/llvm/llvm-project/issues/54116
rm unittests/clang-tidy/ReadabilityModuleTest.cpp
# failing test case # failing test case
rm test/clang-tidy/checkers/altera-struct-pack-align.cpp rm test/clang-tidy/checkers/altera/struct-pack-align.cpp
%py3_shebang_fix \ %py3_shebang_fix \
clang-tidy/tool/ \ clang-tidy/tool/ \
@ -301,16 +319,7 @@ rm test/CodeGen/profile-filter.c
%endif %endif
%build %build
# We run the builders out of memory on armv7 and i686 when LTO is enabled
%ifarch %{arm} i686
%define _lto_cflags %{nil}
%else
# This package does not ship any object files or static libraries, so we
# don't need -ffat-lto-objects.
%global _lto_cflags %(echo %{_lto_cflags} | sed 's/-ffat-lto-objects//')
%endif
# lto builds with gcc 11 fail while running the lit tests.
%define _lto_cflags %{nil} %define _lto_cflags %{nil}
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
@ -319,14 +328,16 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py
sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
%endif %endif
%ifarch s390 s390x %{arm} %ix86 ppc64le %ifarch s390 s390x %{arm} aarch64 %ix86 ppc64le
# Decrease debuginfo verbosity to reduce memory consumption during final library linking # Decrease debuginfo verbosity to reduce memory consumption during final library linking
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif %endif
%set_build_flags # Disable dwz on aarch64, because it takes a huge amount of time to decide not to optimize things.
CXXFLAGS="$CXXFLAGS -Wno-address -Wno-nonnull -Wno-maybe-uninitialized" %ifarch aarch64
CFLAGS="$CFLAGS -Wno-address -Wno-nonnull -Wno-maybe-uninitialized" %define _find_debuginfo_dwz_opts %{nil}
%endif
%if %{with bundle_compat_lib} %if %{with bundle_compat_lib}
@ -340,10 +351,12 @@ mv ../clang-%{compat_ver}.src ../clang
%cmake -S ../llvm-%{compat_ver}.src -B ../clang-compat-libs -G Ninja \ %cmake -S ../llvm-%{compat_ver}.src -B ../clang-compat-libs -G Ninja \
-DLLVM_ENABLE_PROJECTS=clang \ -DLLVM_ENABLE_PROJECTS=clang \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS:BOOL=OFF \
-DLLVM_ENABLE_EH=ON \ -DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_RTTI=ON \ -DLLVM_ENABLE_RTTI:BOOL=ON \
-DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_SKIP_RPATH:BOOL=ON \
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \
-DLLVM_INCLUDE_BENCHMARKS=OFF
%ninja_build -C ../clang-compat-libs libclang.so %ninja_build -C ../clang-compat-libs libclang.so
%ninja_build -C ../clang-compat-libs libclang-cpp.so %ninja_build -C ../clang-compat-libs libclang-cpp.so
@ -351,11 +364,13 @@ mv ../clang-%{compat_ver}.src ../clang
%endif %endif
# -DLLVM_ENABLE_NEW_PASS_MANAGER=ON can be removed once this patch is committed: # We set CLANG_DEFAULT_PIE_ON_LINUX=OFF to match the default used by Fedora's GCC.
# https://reviews.llvm.org/D107628 # See https://bugzilla.redhat.com/show_bug.cgi?id=2134146
%cmake -G Ninja \ %cmake -G Ninja \
-DCMAKE_C_COMPILER=/opt/rh/gcc-toolset-12/root/usr/bin/gcc \ %ifarch %ix86
-DCMAKE_CXX_COMPILER=/opt/rh/gcc-toolset-12/root/usr/bin/g++ \ -DHAVE_CXX_ATOMICS64_WITHOUT_LIB=OFF \
%endif
-DCLANG_DEFAULT_PIE_ON_LINUX=OFF \
-DLLVM_PARALLEL_LINK_JOBS=1 \ -DLLVM_PARALLEL_LINK_JOBS=1 \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -372,8 +387,10 @@ mv ../clang-%{compat_ver}.src ../clang
-DCLANG_INCLUDE_TESTS:BOOL=OFF \ -DCLANG_INCLUDE_TESTS:BOOL=OFF \
%else %else
-DCLANG_INCLUDE_TESTS:BOOL=ON \ -DCLANG_INCLUDE_TESTS:BOOL=ON \
-DLLVM_BUILD_UTILS:BOOL=ON \
-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../%{clang_tools_srcdir} \ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../%{clang_tools_srcdir} \
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
-DLLVM_LIT_ARGS="-vv" \
-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \ -DLLVM_LIBDIR_SUFFIX=64 \
@ -395,10 +412,8 @@ mv ../clang-%{compat_ver}.src ../clang
-DLLVM_ENABLE_EH=ON \ -DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_RTTI=ON \ -DLLVM_ENABLE_RTTI=ON \
-DLLVM_BUILD_DOCS=ON \ -DLLVM_BUILD_DOCS=ON \
-DLLVM_ENABLE_NEW_PASS_MANAGER=ON \
-DLLVM_ENABLE_SPHINX=ON \ -DLLVM_ENABLE_SPHINX=ON \
-DCLANG_LINK_CLANG_DYLIB=ON \ -DCLANG_LINK_CLANG_DYLIB=ON \
%{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \
\ \
-DCLANG_BUILD_EXAMPLES:BOOL=OFF \ -DCLANG_BUILD_EXAMPLES:BOOL=OFF \
@ -408,7 +423,8 @@ mv ../clang-%{compat_ver}.src ../clang
-DCLANG_DEFAULT_LINKER=lld \ -DCLANG_DEFAULT_LINKER=lld \
%endif %endif
-DCLANG_DEFAULT_UNWINDLIB=libgcc \ -DCLANG_DEFAULT_UNWINDLIB=libgcc \
-DGCC_INSTALL_PREFIX=/opt/rh/gcc-toolset-12/root/usr -DGCC_INSTALL_PREFIX=/opt/rh/gcc-toolset-12/root/usr \
-DLLVM_INCLUDE_BENCHMARKS=OFF
%cmake_build %cmake_build
@ -435,7 +451,7 @@ rm -Rf %{buildroot}%{install_prefix}/lib/{libear,libscanbuild}
# File in the macros file for other packages to use. We are not doing this # File in the macros file for other packages to use. We are not doing this
# in the compat package, because the version macros would # conflict with # in the compat package, because the version macros would # conflict with
# eachother if both clang and the clang compat package were installed together. # eachother if both clang and the clang compat package were installed together.
install -p -m0644 -D %{SOURCE7} %{buildroot}%{_rpmmacrodir}/macros.%{name} install -p -m0644 -D %{SOURCE10} %{buildroot}%{_rpmmacrodir}/macros.%{name}
sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \ sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \
-e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \ -e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \
-e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \ -e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \
@ -502,9 +518,6 @@ popd
mkdir -p %{buildroot}%{pkg_libdir}/clang/%{version}/{include,lib,share}/ mkdir -p %{buildroot}%{pkg_libdir}/clang/%{version}/{include,lib,share}/
# Remove clang-tidy headers. We don't ship the libraries for these.
rm -Rvf %{buildroot}%{_includedir}/clang-tidy/
%if %{without compat_build} %if %{without compat_build}
# Add a symlink in /usr/bin to clang-format-diff # Add a symlink in /usr/bin to clang-format-diff
ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff
@ -516,6 +529,18 @@ sed -i -e "s/'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'/'ASAN_SYMBOLIZER_PAT
%if %{without compat_build} %if %{without compat_build}
%if %{with check} %if %{with check}
# Build test dependencies separately, to prevent invocations of host clang from being affected
# by LD_LIBRARY_PATH below.
%cmake_build --target clang-test-depends \
ExtraToolsUnitTests ClangdUnitTests ClangIncludeCleanerUnitTests ClangPseudoUnitTests
%if %{with bundle_compat_lib}
# Move the compat -cpp.so out of the way so it's not picked up
# by the LD_LIBRARY_PATH below.
compat_lib=$(find %{buildroot}%{_libdir} -name libclang-cpp.so.%{compat_maj_ver})
mv "$compat_lib" .
%endif
# requires lit.py from LLVM utilities # requires lit.py from LLVM utilities
# FIXME: Fix failing ARM tests # FIXME: Fix failing ARM tests
SOURCE_DATA_EPOCH=1629181597 LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \ SOURCE_DATA_EPOCH=1629181597 LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \
@ -524,6 +549,11 @@ SOURCE_DATA_EPOCH=1629181597 LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja}
%else %else
false false
%endif %endif
%if %{with bundle_compat_lib}
mv ./libclang-cpp.so.%{compat_maj_ver} "$compat_lib"
%endif
%endif %endif
%endif %endif
@ -545,11 +575,11 @@ false
%files libs %files libs
%if %{without compat_build} %if %{without compat_build}
%{_libdir}/clang/ %{_libdir}/clang/%{version}/include/*
%{_libdir}/*.so.* %{_libdir}/*.so.*
%else %else
%{pkg_libdir}/*.so.* %{pkg_libdir}/*.so.*
%{pkg_libdir}/clang/%{version} %{pkg_libdir}/clang/%{version}/include/*
%endif %endif
%if %{with bundle_compat_lib} %if %{with bundle_compat_lib}
%{_libdir}/libclang.so.%{compat_maj_ver}* %{_libdir}/libclang.so.%{compat_maj_ver}*
@ -562,6 +592,7 @@ false
%{_includedir}/clang/ %{_includedir}/clang/
%{_includedir}/clang-c/ %{_includedir}/clang-c/
%{_libdir}/cmake/* %{_libdir}/cmake/*
%{_bindir}/clang-tblgen
%dir %{_datadir}/clang/ %dir %{_datadir}/clang/
%{_rpmmacrodir}/macros.%{name} %{_rpmmacrodir}/macros.%{name}
%else %else
@ -572,6 +603,7 @@ false
%endif %endif
%files resource-filesystem %files resource-filesystem
%dir %{pkg_libdir}/clang/
%dir %{pkg_libdir}/clang/%{version}/ %dir %{pkg_libdir}/clang/%{version}/
%dir %{pkg_libdir}/clang/%{version}/include/ %dir %{pkg_libdir}/clang/%{version}/include/
%dir %{pkg_libdir}/clang/%{version}/lib/ %dir %{pkg_libdir}/clang/%{version}/lib/
@ -610,9 +642,11 @@ false
%{_bindir}/clang-include-fixer %{_bindir}/clang-include-fixer
%{_bindir}/clang-move %{_bindir}/clang-move
%{_bindir}/clang-offload-bundler %{_bindir}/clang-offload-bundler
%{_bindir}/clang-offload-packager
%{_bindir}/clang-offload-wrapper %{_bindir}/clang-offload-wrapper
%{_bindir}/clang-linker-wrapper %{_bindir}/clang-linker-wrapper
%{_bindir}/clang-nvlink-wrapper %{_bindir}/clang-nvlink-wrapper
%{_bindir}/clang-pseudo
%{_bindir}/clang-query %{_bindir}/clang-query
%{_bindir}/clang-refactor %{_bindir}/clang-refactor
%{_bindir}/clang-rename %{_bindir}/clang-rename
@ -640,6 +674,9 @@ false
%{_datadir}/clang/run-find-all-symbols.py* %{_datadir}/clang/run-find-all-symbols.py*
%{_datadir}/clang/clang-rename.py* %{_datadir}/clang/clang-rename.py*
%files tools-extra-devel
%{_includedir}/clang-tidy/
%files -n git-clang-format %files -n git-clang-format
%{_bindir}/git-clang-format %{_bindir}/git-clang-format
@ -649,6 +686,18 @@ false
%endif %endif
%changelog %changelog
* Mon Jan 16 2023 Konrad Kleine <kkleine@redhat.com> - 15.0.7-2
- Update to 15.0.7
* Thu Dec 08 2022 Konrad Kleine<kkleine@redhat.com> - 15.0.6-1
- Update to 15.0.6
* Mon Oct 17 2022 Nikita Popov <npopov@redhat.com> - 15.0.1-2
- Default to non-pie, fix rhbz#2134146
* Mon Sep 26 2022 Konrad Kleine <kkleine@redhat.com> - 15.0.1-1
- Update to 15.0.1
* Tue Jul 19 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.6-1 * Tue Jul 19 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.6-1
- Update to 14.0.6 - Update to 14.0.6