From 7f7027337f77779677036e2e8ec7075454195482 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 09 2023 05:20:14 +0000 Subject: import clang-15.0.7-2.el9 --- diff --git a/.clang.metadata b/.clang.metadata index a2655c0..47b73f1 100644 --- a/.clang.metadata +++ b/.clang.metadata @@ -1,3 +1,3 @@ -88442d295bc0b96df7cf3d526ed9eabd7a214ac2 SOURCES/clang-14.0.6.src.tar.xz -dac5046f0eb81e6c47432cf80229599befbf273e SOURCES/clang-tools-extra-14.0.6.src.tar.xz -b8d2648a01d36ed0186fd2c5af325fd28797f9a0 SOURCES/tstellar-gpg-key.asc +7b4d1188cce1ce4ea1cf2ea362fba685c4aca34d SOURCES/clang-15.0.7.src.tar.xz +752fe847136eff2dfbfcc8bbddfaa9319532d104 SOURCES/clang-tools-extra-15.0.7.src.tar.xz +347bdd5ee6d6b93c9644c268511815912c0fb2dc SOURCES/release-keys.asc diff --git a/.gitignore b/.gitignore index be7fa0a..eb8253e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -SOURCES/clang-14.0.6.src.tar.xz -SOURCES/clang-tools-extra-14.0.6.src.tar.xz -SOURCES/tstellar-gpg-key.asc +SOURCES/clang-15.0.7.src.tar.xz +SOURCES/clang-tools-extra-15.0.7.src.tar.xz +SOURCES/release-keys.asc diff --git a/SOURCES/0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch b/SOURCES/0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch deleted file mode 100644 index 6c94b4d..0000000 --- a/SOURCES/0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch +++ /dev/null @@ -1,59 +0,0 @@ -From d68a5a7817dc0d43853d8b84c9185dc24338664f Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Wed, 6 Oct 2021 05:32:44 +0000 -Subject: [PATCH] Driver: Add a gcc equivalent triple to the list of triples to - search - -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. -x86_64-redhat-linux-gnu). When searching for a gcc install, also search -for a gcc equivalent triple if one exists. - -Differential Revision: https://reviews.llvm.org/D111207 ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index fe5bda5c6605..fd4a7f72be14 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -1884,6 +1884,18 @@ static llvm::StringRef getGCCToolchainDir(const ArgList &Args, - return GCC_INSTALL_PREFIX; - } - -+/// This function takes a 'clang' triple and converts it to an equivalent gcc -+/// triple. -+static const char *ConvertToGccTriple(StringRef CandidateTriple) { -+ return llvm::StringSwitch(CandidateTriple) -+ .Case("aarch64-redhat-linux-gnu", "aarch64-redhat-linux") -+ .Case("i686-redhat-linux-gnu", "i686-redhat-linux") -+ .Case("ppc64le-redhat-linux-gnu", "ppc64le-redhat-linux") -+ .Case("s390x-redhat-linux-gnu", "s390x-redhat-linux") -+ .Case("x86_64-redhat-linux-gnu", "x86_64-redhat-linux") -+ .Default(NULL); -+} -+ - /// Initialize a GCCInstallationDetector from the driver. - /// - /// This performs all of the autodetection and sets up the various paths. -@@ -1904,6 +1916,16 @@ void Generic_GCC::GCCInstallationDetector::init( - // The compatible GCC triples for this particular architecture. - SmallVector CandidateTripleAliases; - SmallVector CandidateBiarchTripleAliases; -+ -+ // In some cases gcc uses a slightly different triple than clang for the -+ // same target. Convert the clang triple to the gcc equivalent and use that -+ // to search for the gcc install. -+ const char *ConvertedTriple = ConvertToGccTriple(TargetTriple.str()); -+ if (ConvertedTriple) { -+ CandidateTripleAliases.push_back(ConvertedTriple); -+ CandidateBiarchTripleAliases.push_back(ConvertedTriple); -+ } -+ - CollectLibDirsAndTriples(TargetTriple, BiarchVariantTriple, CandidateLibDirs, - CandidateTripleAliases, CandidateBiarchLibDirs, - CandidateBiarchTripleAliases); --- -2.26.2 - diff --git a/SOURCES/0001-PATCH-clang-Reorganize-gtest-integration.patch b/SOURCES/0001-PATCH-clang-Reorganize-gtest-integration.patch deleted file mode 100644 index e854f01..0000000 --- a/SOURCES/0001-PATCH-clang-Reorganize-gtest-integration.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c6b921c8d833546946b70a8c2640032fd7c62461 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Thu, 25 Feb 2021 14:04:52 +0100 -Subject: [PATCH 1/6] [PATCH][clang] Reorganize gtest integration - ---- - clang/CMakeLists.txt | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - -diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt -index 9e74014..0185276 100644 ---- a/clang/CMakeLists.txt -+++ b/clang/CMakeLists.txt -@@ -153,12 +153,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - set(LLVM_UTILS_PROVIDED ON) - set(CLANG_TEST_DEPS FileCheck count not) - endif() -- set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) -- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h -- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} -- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) -- add_subdirectory(${UNITTEST_DIR} utils/unittest) -- endif() - else() - # Seek installed Lit. - find_program(LLVM_LIT -@@ -537,7 +531,11 @@ endif() - - - if( CLANG_INCLUDE_TESTS ) -- if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h) -+ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) -+ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h -+ AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} -+ AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) -+ add_subdirectory(${UNITTEST_DIR} utils/unittest) - add_subdirectory(unittests) - list(APPEND CLANG_TEST_DEPS ClangUnitTests) - list(APPEND CLANG_TEST_PARAMS --- -1.8.3.1 - diff --git a/SOURCES/0001-Work-around-gcc-miscompile.patch b/SOURCES/0001-Work-around-gcc-miscompile.patch deleted file mode 100644 index 16c1467..0000000 --- a/SOURCES/0001-Work-around-gcc-miscompile.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0f97b7209eed4a428171af6044fe7e0aaf81ee2a Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Thu, 3 Feb 2022 10:34:44 +0100 -Subject: [PATCH] Work around gcc miscompile - -This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104334, -which miscompiles clang on s390x and ppc64le. The issue is already -fixed on the gcc side, but including this as a temporary workaround -to get a working build. ---- - clang/lib/Sema/DeclSpec.cpp | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp -index d4dc790c008a..77a1e6c32c6f 100644 ---- a/clang/lib/Sema/DeclSpec.cpp -+++ b/clang/lib/Sema/DeclSpec.cpp -@@ -1203,8 +1203,9 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) { - } else if (TypeSpecType == TST_double) { - // vector long double and vector long long double are never allowed. - // vector double is OK for Power7 and later, and ZVector. -- if (getTypeSpecWidth() == TypeSpecifierWidth::Long || -- getTypeSpecWidth() == TypeSpecifierWidth::LongLong) -+ TypeSpecifierWidth TypeSpecWidth = getTypeSpecWidth(); -+ if (TypeSpecWidth == TypeSpecifierWidth::Long || -+ TypeSpecWidth == TypeSpecifierWidth::LongLong) - S.Diag(TSWRange.getBegin(), - diag::err_invalid_vector_long_double_decl_spec); - else if (!S.Context.getTargetInfo().hasFeature("vsx") && --- -2.34.1 - - diff --git a/SOURCES/0001-clang-Enforce-instantiation-of-constexpr-template-fu.patch b/SOURCES/0001-clang-Enforce-instantiation-of-constexpr-template-fu.patch deleted file mode 100644 index 3819da9..0000000 --- a/SOURCES/0001-clang-Enforce-instantiation-of-constexpr-template-fu.patch +++ /dev/null @@ -1,90 +0,0 @@ -From c081bf4098c729afacf20303cc9df62bf13c3362 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Sat, 18 Jun 2022 13:48:41 +0200 -Subject: [PATCH] [clang] Enforce instantiation of constexpr template functions - during non-constexpr evaluation - -Otherwise these functions are not instantiated and we end up with an undefined -symbol. - -Fix #55560 - -Differential Revision: https://reviews.llvm.org/D128119 ---- - clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 5 +++-- - .../CodeGenCXX/constexpr-late-instantiation.cpp | 17 +++++++++++++++++ - .../SemaCXX/constexpr-late-instantiation.cpp | 15 +++++++++++++++ - 3 files changed, 35 insertions(+), 2 deletions(-) - create mode 100644 clang/test/CodeGenCXX/constexpr-late-instantiation.cpp - create mode 100644 clang/test/SemaCXX/constexpr-late-instantiation.cpp - -diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp -index 467372c71496..293782822e83 100644 ---- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp -+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp -@@ -4826,7 +4826,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, - /*Complain*/DefinitionRequired)) { - if (DefinitionRequired) - Function->setInvalidDecl(); -- else if (TSK == TSK_ExplicitInstantiationDefinition) { -+ else if (TSK == TSK_ExplicitInstantiationDefinition || -+ (Function->isConstexpr() && !Recursive)) { - // Try again at the end of the translation unit (at which point a - // definition will be required). - assert(!Recursive); -@@ -4841,7 +4842,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, - Diag(PatternDecl->getLocation(), diag::note_forward_template_decl); - if (getLangOpts().CPlusPlus11) - Diag(PointOfInstantiation, diag::note_inst_declaration_hint) -- << Function; -+ << Function; - } - } - -diff --git a/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp b/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp -new file mode 100644 -index 000000000000..1c8eef73f2dd ---- /dev/null -+++ b/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp -@@ -0,0 +1,17 @@ -+// Make sure foo is instantiated and we don't get a link error -+// RUN: %clang_cc1 -S -emit-llvm -triple %itanium_abi_triple %s -o- | FileCheck %s -+ -+template -+constexpr T foo(T a); -+ -+// CHECK-LABEL: define {{.*}} @main -+int main() { -+ // CHECK: call {{.*}} @_Z3fooIiET_S0_ -+ int k = foo(5); -+} -+// CHECK: } -+ -+template -+constexpr T foo(T a) { -+ return a; -+} -diff --git a/clang/test/SemaCXX/constexpr-late-instantiation.cpp b/clang/test/SemaCXX/constexpr-late-instantiation.cpp -new file mode 100644 -index 000000000000..ec8e071217c1 ---- /dev/null -+++ b/clang/test/SemaCXX/constexpr-late-instantiation.cpp -@@ -0,0 +1,15 @@ -+// RUN: %clang_cc1 %s -fsyntax-only -verify -+ -+template -+constexpr T foo(T a); // expected-note {{declared here}} -+ -+int main() { -+ int k = foo(5); // Ok -+ constexpr int j = // expected-error {{constexpr variable 'j' must be initialized by a constant expression}} -+ foo(5); // expected-note {{undefined function 'foo' cannot be used in a constant expression}} -+} -+ -+template -+constexpr T foo(T a) { -+ return a; -+} --- -2.38.1 - diff --git a/SOURCES/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch b/SOURCES/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch new file mode 100644 index 0000000..fea1bd5 --- /dev/null +++ b/SOURCES/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch @@ -0,0 +1,82 @@ +From 1d639f1379fc052b8437284955b1cb0baf880894 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +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 + diff --git a/SOURCES/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch b/SOURCES/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch deleted file mode 100644 index e425475..0000000 --- a/SOURCES/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -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 - diff --git a/SOURCES/0002-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch b/SOURCES/0002-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch new file mode 100644 index 0000000..ece7e39 --- /dev/null +++ b/SOURCES/0002-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch @@ -0,0 +1,58 @@ +From ccf3e4407e7a5c4c1f2e41c89aad9f86a9c7d81d Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Wed, 6 Oct 2021 05:32:44 +0000 +Subject: Driver: Add a gcc equivalent triple to the list of triples to search + +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. +x86_64-redhat-linux-gnu). When searching for a gcc install, also search +for a gcc equivalent triple if one exists. + +Differential Revision: https://reviews.llvm.org/D111207 +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index f203cae1d329..12fa2da3187e 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -1969,6 +1969,18 @@ static llvm::StringRef getGCCToolchainDir(const ArgList &Args, + return GCC_INSTALL_PREFIX; + } + ++/// This function takes a 'clang' triple and converts it to an equivalent gcc ++/// triple. ++static const char *ConvertToGccTriple(StringRef CandidateTriple) { ++ return llvm::StringSwitch(CandidateTriple) ++ .Case("aarch64-redhat-linux-gnu", "aarch64-redhat-linux") ++ .Case("i686-redhat-linux-gnu", "i686-redhat-linux") ++ .Case("ppc64le-redhat-linux-gnu", "ppc64le-redhat-linux") ++ .Case("s390x-redhat-linux-gnu", "s390x-redhat-linux") ++ .Case("x86_64-redhat-linux-gnu", "x86_64-redhat-linux") ++ .Default(NULL); ++} ++ + /// Initialize a GCCInstallationDetector from the driver. + /// + /// This performs all of the autodetection and sets up the various paths. +@@ -1989,6 +2001,16 @@ void Generic_GCC::GCCInstallationDetector::init( + // The compatible GCC triples for this particular architecture. + SmallVector CandidateTripleAliases; + SmallVector CandidateBiarchTripleAliases; ++ ++ // In some cases gcc uses a slightly different triple than clang for the ++ // same target. Convert the clang triple to the gcc equivalent and use that ++ // to search for the gcc install. ++ const char *ConvertedTriple = ConvertToGccTriple(TargetTriple.str()); ++ if (ConvertedTriple) { ++ CandidateTripleAliases.push_back(ConvertedTriple); ++ CandidateBiarchTripleAliases.push_back(ConvertedTriple); ++ } ++ + CollectLibDirsAndTriples(TargetTriple, BiarchVariantTriple, CandidateLibDirs, + CandidateTripleAliases, CandidateBiarchLibDirs, + CandidateBiarchTripleAliases); +-- +2.37.1 + diff --git a/SOURCES/0002-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch b/SOURCES/0002-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch deleted file mode 100644 index e6671f9..0000000 --- a/SOURCES/0002-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c87abee7356b8fde81512ffceadd520776c465d2 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Thu, 25 Feb 2021 14:09:29 +0100 -Subject: [PATCH] [PATCH][clang] Make -funwind-tables the default on all archs - ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp -b/clang/lib/Driver/ToolChains/Gnu.cpp -index d0808d061c82..de9c9743cd38 100644 ---- a/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 { - case llvm::Triple::ppc64le: - case llvm::Triple::x86: - case llvm::Triple::x86_64: -+ -+ // Enable -funwind-tables on all architectures supported by Fedora: -+ // rhbz#1655546 -+ case llvm::Triple::systemz: -+ case llvm::Triple::arm: - return true; - default: - return false; --- -2.27.0 - diff --git a/SOURCES/0003-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch b/SOURCES/0003-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch new file mode 100644 index 0000000..9e79262 --- /dev/null +++ b/SOURCES/0003-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch @@ -0,0 +1,29 @@ +From 1d224b408bc6754bcea9e0b226d6c440f5a4f8fd Mon Sep 17 00:00:00 2001 +From: Nikita Popov +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, +- NegFlag>; ++ NegFlag, ++ BothFlags<[NoArgumentUnused]>>; + def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>, + Group; + def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, FlangOption, NoXarchOption]>, +-- +2.37.1 + diff --git a/SOURCES/0003-PATCH-clang-Don-t-install-static-libraries.patch b/SOURCES/0003-PATCH-clang-Don-t-install-static-libraries.patch deleted file mode 100644 index bc8fa51..0000000 --- a/SOURCES/0003-PATCH-clang-Don-t-install-static-libraries.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 88704fc2eabb9dd19a9c3eb81a9b3dc37d95651c Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Fri, 31 Jan 2020 11:04:57 -0800 -Subject: [PATCH][clang] Don't install static libraries - ---- - clang/cmake/modules/AddClang.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 5752f4277444..0f52822d91f0 100644 ---- a/clang/cmake/modules/AddClang.cmake -+++ b/clang/cmake/modules/AddClang.cmake -@@ -113,7 +113,7 @@ macro(add_clang_library name) - if(TARGET ${lib}) - target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS}) - -- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) -+ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)) - get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries) - install(TARGETS ${lib} - COMPONENT ${lib} --- -2.30.2 - diff --git a/SOURCES/0004-Reorganize-gtest-integration.patch b/SOURCES/0004-Reorganize-gtest-integration.patch new file mode 100644 index 0000000..7c836cc --- /dev/null +++ b/SOURCES/0004-Reorganize-gtest-integration.patch @@ -0,0 +1,42 @@ +From ccfad825687fc45d04ddb987c476dfafb26e56d9 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Thu, 25 Feb 2021 14:04:52 +0100 +Subject: Reorganize gtest integration + +--- + clang/CMakeLists.txt | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt +index 13d76e7fd935..7452bafb0756 100644 +--- a/clang/CMakeLists.txt ++++ b/clang/CMakeLists.txt +@@ -159,12 +159,6 @@ if(CLANG_BUILT_STANDALONE) + set(LLVM_UTILS_PROVIDED ON) + set(CLANG_TEST_DEPS FileCheck count not) + endif() +- set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) +- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h +- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} +- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) +- add_subdirectory(${UNITTEST_DIR} utils/unittest) +- endif() + else() + # Seek installed Lit. + find_program(LLVM_LIT +@@ -586,7 +580,11 @@ endif() + + + if( CLANG_INCLUDE_TESTS ) +- if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h) ++ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) ++ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h ++ AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} ++ AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) ++ add_subdirectory(${UNITTEST_DIR} utils/unittest) + add_subdirectory(unittests) + list(APPEND CLANG_TEST_DEPS ClangUnitTests) + list(APPEND CLANG_TEST_PARAMS +-- +2.37.1 + diff --git a/SOURCES/0005-Work-around-gcc-miscompile.patch b/SOURCES/0005-Work-around-gcc-miscompile.patch new file mode 100644 index 0000000..9260e01 --- /dev/null +++ b/SOURCES/0005-Work-around-gcc-miscompile.patch @@ -0,0 +1,32 @@ +From 0ff89f236b9cc11662cf4f288cfd3254410d8243 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Thu, 3 Feb 2022 10:34:44 +0100 +Subject: Work around gcc miscompile + +This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104334, +which miscompiles clang on s390x and ppc64le. The issue is already +fixed on the gcc side, but including this as a temporary workaround +to get a working build. +--- + clang/lib/Sema/DeclSpec.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp +index d4dc790c008a..77a1e6c32c6f 100644 +--- a/clang/lib/Sema/DeclSpec.cpp ++++ b/clang/lib/Sema/DeclSpec.cpp +@@ -1203,8 +1203,9 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) { + } else if (TypeSpecType == TST_double) { + // vector long double and vector long long double are never allowed. + // vector double is OK for Power7 and later, and ZVector. +- if (getTypeSpecWidth() == TypeSpecifierWidth::Long || +- getTypeSpecWidth() == TypeSpecifierWidth::LongLong) ++ TypeSpecifierWidth TypeSpecWidth = getTypeSpecWidth(); ++ if (TypeSpecWidth == TypeSpecifierWidth::Long || ++ TypeSpecWidth == TypeSpecifierWidth::LongLong) + S.Diag(TSWRange.getBegin(), + diag::err_invalid_vector_long_double_decl_spec); + else if (!S.Context.getTargetInfo().hasFeature("vsx") && +-- +2.37.1 + diff --git a/SOURCES/0006-Don-t-install-static-libraries.patch b/SOURCES/0006-Don-t-install-static-libraries.patch new file mode 100644 index 0000000..175c186 --- /dev/null +++ b/SOURCES/0006-Don-t-install-static-libraries.patch @@ -0,0 +1,25 @@ +From 6e0c48576740a1da9abeecfb8070127b8e91ab73 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 31 Jan 2020 11:04:57 -0800 +Subject: Don't install static libraries + +--- + clang/cmake/modules/AddClang.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 21ac332e4f5f..d0cf20cced21 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -114,7 +114,7 @@ macro(add_clang_library name) + if(TARGET ${lib}) + target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS}) + +- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) ++ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)) + get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries) + install(TARGETS ${lib} + COMPONENT ${lib} +-- +2.37.1 + diff --git a/SOURCES/0007-Make-funwind-tables-the-default-on-all-archs.patch b/SOURCES/0007-Make-funwind-tables-the-default-on-all-archs.patch new file mode 100644 index 0000000..78b77e9 --- /dev/null +++ b/SOURCES/0007-Make-funwind-tables-the-default-on-all-archs.patch @@ -0,0 +1,27 @@ +From 54806261c76384ae45de93b7b5ac2de4e74bb7ae Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Wed, 21 Sep 2022 12:21:06 +0200 +Subject: Make -funwind-tables the default on all archs + +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 12fa2da3187e..96527ed52445 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2845,6 +2845,10 @@ bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const { + case llvm::Triple::ppc64le: + case llvm::Triple::x86: + case llvm::Triple::x86_64: ++ // Enable -funwind-tables on all architectures supported by Fedora: ++ // rhbz#1655546 ++ case llvm::Triple::systemz: ++ case llvm::Triple::arm: + return true; + default: + return false; +-- +2.37.1 + diff --git a/SOURCES/0008-Produce-DWARF4-by-default.patch b/SOURCES/0008-Produce-DWARF4-by-default.patch new file mode 100644 index 0000000..3aafaa9 --- /dev/null +++ b/SOURCES/0008-Produce-DWARF4-by-default.patch @@ -0,0 +1,100 @@ +From 62728c7321a2d07f7d22dadc2b8565ad512b3da4 Mon Sep 17 00:00:00 2001 +From: Konrad Kleine +Date: Thu, 24 Mar 2022 09:44:21 +0100 +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: + +https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8f5b4?diff=unified +--- + clang/include/clang/Driver/ToolChain.h | 2 +- + clang/test/CodeGen/dwarf-version.c | 4 ++-- + 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.cpp | 2 +- + 6 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h +index f20ab164531b..53c86ee82936 100644 +--- a/clang/include/clang/Driver/ToolChain.h ++++ b/clang/include/clang/Driver/ToolChain.h +@@ -535,7 +535,7 @@ public: + + // Return the DWARF version to emit, in the absence of arguments + // to the contrary. +- virtual unsigned GetDefaultDwarfVersion() const { return 5; } ++ virtual unsigned GetDefaultDwarfVersion() const { return 4; } + + // Some toolchains may have different restrictions on the DWARF version and + // may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host +diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c +index 0a6fa4768026..96f01749d0d8 100644 +--- a/clang/test/CodeGen/dwarf-version.c ++++ b/clang/test/CodeGen/dwarf-version.c +@@ -2,8 +2,8 @@ + // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3 + // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 + // RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 +-// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 +-// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 ++// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 ++// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 + + // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT + // 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 +index a2e350a0a835..01889ba0bf9b 100644 +--- a/clang/test/Driver/cl-options.c ++++ b/clang/test/Driver/cl-options.c +@@ -570,7 +570,7 @@ + // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s + // Z7_gdwarf: "-gcodeview" + // Z7_gdwarf: "-debug-info-kind=constructor" +-// Z7_gdwarf: "-dwarf-version= ++// Z7_gdwarf: "-dwarf-version=4 + + // RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s + // CXX11: -std=c++11 +diff --git a/clang/test/Driver/clang-g-opts.c b/clang/test/Driver/clang-g-opts.c +index d982b1070cae..bb129e75769c 100644 +--- a/clang/test/Driver/clang-g-opts.c ++++ b/clang/test/Driver/clang-g-opts.c +@@ -32,7 +32,7 @@ + + // CHECK-WITHOUT-G-NOT: -debug-info-kind + // CHECK-WITH-G: "-debug-info-kind=constructor" +-// CHECK-WITH-G: "-dwarf-version=5" ++// CHECK-WITH-G: "-dwarf-version=4" + // CHECK-WITH-G-DWARF2: "-dwarf-version=2" + + // CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone" +diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c +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 + diff --git a/SOURCES/0009-disable-recommonmark.patch b/SOURCES/0009-disable-recommonmark.patch new file mode 100644 index 0000000..8a259af --- /dev/null +++ b/SOURCES/0009-disable-recommonmark.patch @@ -0,0 +1,38 @@ +From f4e2d711e5cfd8e357d770e2da7a114086ee8659 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timm=20B=C3=A4der?= +Date: Thu, 22 Sep 2022 10:49:43 +0200 +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', + } + +-try: +- import recommonmark +-except ImportError: +- # manpages do not use any .md sources +- if not tags.has('builder-man'): +- raise +-else: +- import sphinx +- if sphinx.version_info >= (3, 0): +- # This requires 0.5 or later. +- extensions.append('recommonmark') +- else: +- source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} +- source_suffix['.md'] = 'markdown' ++import sphinx + + # The encoding of source files. + #source_encoding = 'utf-8-sig' +-- +2.37.1 + diff --git a/SOURCES/0010-PATCH-clang-Produce-DWARF4-by-default.patch b/SOURCES/0010-PATCH-clang-Produce-DWARF4-by-default.patch deleted file mode 100644 index d05b776..0000000 --- a/SOURCES/0010-PATCH-clang-Produce-DWARF4-by-default.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 6509777d4c12a42c7487814d868375a86712bf5b Mon Sep 17 00:00:00 2001 -From: Konrad Kleine -Date: Thu, 24 Mar 2022 09:44:21 +0100 -Subject: [PATCH][clang]Produce DWARF4 by default - -Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream: - -https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8f5b4?diff=unified ---- - clang/include/clang/Driver/ToolChain.h | 2 +- - clang/test/CodeGen/dwarf-version.c | 4 ++-- - clang/test/Driver/cl-options.c | 2 +- - clang/test/Driver/ve-toolchain.c | 2 +- - clang/test/Driver/ve-toolchain.cpp | 2 +- - 5 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h -index adf1753e8d3a..c8adc4d917ce 100644 ---- a/clang/include/clang/Driver/ToolChain.h -+++ b/clang/include/clang/Driver/ToolChain.h -@@ -515,7 +515,7 @@ public: - - // Return the DWARF version to emit, in the absence of arguments - // to the contrary. -- virtual unsigned GetDefaultDwarfVersion() const { return 5; } -+ virtual unsigned GetDefaultDwarfVersion() const { return 4; } - - // Some toolchains may have different restrictions on the DWARF version and - // may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host -diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c -index 0a6fa4768026..96f01749d0d8 100644 ---- a/clang/test/CodeGen/dwarf-version.c -+++ b/clang/test/CodeGen/dwarf-version.c -@@ -2,8 +2,8 @@ - // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3 - // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 - // RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 --// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 --// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5 -+// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 -+// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 - - // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT - // 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 -index f332cd83b26e..911779fffbef 100644 ---- a/clang/test/Driver/cl-options.c -+++ b/clang/test/Driver/cl-options.c -@@ -597,7 +597,7 @@ - // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s - // Z7_gdwarf: "-gcodeview" - // Z7_gdwarf: "-debug-info-kind=constructor" --// Z7_gdwarf: "-dwarf-version= -+// Z7_gdwarf: "-dwarf-version=4 - - // RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s - // CXX11: -std=c++11 -diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c -index 753dee19fcbf..dfd12cc0bba4 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 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 @@ - - // CHECK-WITHOUT-G-NOT: -debug-info-kind - // CHECK-WITH-G: "-debug-info-kind=constructor" --// CHECK-WITH-G: "-dwarf-version=5" -+// CHECK-WITH-G: "-dwarf-version=4" - // CHECK-WITH-G-DWARF2: "-dwarf-version=2" - - // CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone" --- -2.35.1 - diff --git a/SOURCES/0010-clang-Fix-interaction-between-asm-labels-and-inline-.patch b/SOURCES/0010-clang-Fix-interaction-between-asm-labels-and-inline-.patch new file mode 100644 index 0000000..948d164 --- /dev/null +++ b/SOURCES/0010-clang-Fix-interaction-between-asm-labels-and-inline-.patch @@ -0,0 +1,74 @@ +From bc9aa904bf9d24e7f39a2a866ff6b463858b6ccb Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +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(); ++ 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 + diff --git a/SOURCES/clang-14.0.6.src.tar.xz.sig b/SOURCES/clang-14.0.6.src.tar.xz.sig deleted file mode 100644 index 3f0ecf4..0000000 Binary files a/SOURCES/clang-14.0.6.src.tar.xz.sig and /dev/null differ diff --git a/SOURCES/clang-15.0.7.src.tar.xz.sig b/SOURCES/clang-15.0.7.src.tar.xz.sig new file mode 100644 index 0000000..4385f7a Binary files /dev/null and b/SOURCES/clang-15.0.7.src.tar.xz.sig differ diff --git a/SOURCES/clang-tools-extra-14.0.6.src.tar.xz.sig b/SOURCES/clang-tools-extra-14.0.6.src.tar.xz.sig deleted file mode 100644 index 9559103..0000000 Binary files a/SOURCES/clang-tools-extra-14.0.6.src.tar.xz.sig and /dev/null differ diff --git a/SOURCES/clang-tools-extra-15.0.7.src.tar.xz.sig b/SOURCES/clang-tools-extra-15.0.7.src.tar.xz.sig new file mode 100644 index 0000000..b9613b4 Binary files /dev/null and b/SOURCES/clang-tools-extra-15.0.7.src.tar.xz.sig differ diff --git a/SOURCES/disable-recommonmark.patch b/SOURCES/disable-recommonmark.patch deleted file mode 100644 index 3df4ddb..0000000 --- a/SOURCES/disable-recommonmark.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ruN clang-14.0.0.src.orig/docs/conf.py clang-14.0.0.src/docs/conf.py ---- a/clang-14.0.0.src.orig/docs/conf.py 2022-03-14 10:44:55.000000000 +0100 -+++ b/clang-14.0.0.src/docs/conf.py 2022-04-11 11:13:44.483641113 +0200 -@@ -37,20 +37,7 @@ - '.rst': 'restructuredtext', - } - --try: -- import recommonmark --except ImportError: -- # manpages do not use any .md sources -- if not tags.has('builder-man'): -- raise --else: -- import sphinx -- if sphinx.version_info >= (3, 0): -- # This requires 0.5 or later. -- extensions.append('recommonmark') -- else: -- source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} -- source_suffix['.md'] = 'markdown' -+import sphinx - - # The encoding of source files. - #source_encoding = 'utf-8-sig' - diff --git a/SOURCES/llvm-hello.patch b/SOURCES/llvm-hello.patch deleted file mode 100644 index d28e349..0000000 --- a/SOURCES/llvm-hello.patch +++ /dev/null @@ -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. diff --git a/SOURCES/remove-test.patch b/SOURCES/remove-test.patch deleted file mode 100644 index ba43de9..0000000 --- a/SOURCES/remove-test.patch +++ /dev/null @@ -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 - ) diff --git a/SPECS/clang.spec b/SPECS/clang.spec index 093e20e..cc57c6d 100644 --- a/SPECS/clang.spec +++ b/SPECS/clang.spec @@ -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 bundle_compat_lib %bcond_without check -%global maj_ver 14 +%global maj_ver 15 %global min_ver 0 -%global patch_ver 6 +%global patch_ver 7 %global clang_version %{maj_ver}.%{min_ver}.%{patch_ver} %if %{with compat_build} @@ -26,62 +30,64 @@ %endif %if %{with bundle_compat_lib} -%global compat_maj_ver 13 -%global compat_ver %{compat_maj_ver}.0.1 +%global compat_maj_ver 14 +%global compat_ver %{compat_maj_ver}.0.6 %endif %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 %endif %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 -%if !%{maj_ver} && 0%{?rc_ver} -%global abi_revision 2 -%endif - Name: %pkg_name Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}} -Release: 4%{?dist} +Release: 2%{?dist} Summary: A C language family front-end for LLVM License: NCSA 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 -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} -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.sig +Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz.sig %endif -Source4: tstellar-gpg-key.asc +Source4: release-keys.asc %if %{with bundle_compat_lib} -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 +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}/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 %if !0%{with compat_build} -Source7: macros.%{name} +Source10: macros.%{name} %endif # 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 + +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: 0001-Work-around-gcc-miscompile.patch -Patch7: 0010-PATCH-clang-Produce-DWARF4-by-default.patch -Patch8: disable-recommonmark.patch -Patch9: 0001-clang-Enforce-instantiation-of-constexpr-template-fu.patch +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 # See https://reviews.llvm.org/D120301 -Patch201: llvm-hello.patch -# See https://github.com/llvm/llvm-project/issues/54116 -Patch202: remove-test.patch +Patch201: 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch +%endif # RHEL only: We build LLVM with clang, which now defaults to using the # libstdc++ from gcc-toolset-12. Since we're linking some clang @@ -90,6 +96,8 @@ Patch202: remove-test.patch # to compile clang. BuildRequires: gcc-toolset-12-gcc-c++ BuildRequires: gcc-toolset-12-annobin-plugin-gcc +BuildRequires: gcc-toolset-12-libatomic-devel +BuildRequires: clang BuildRequires: cmake BuildRequires: ninja-build %if %{with compat_build} @@ -120,12 +128,14 @@ BuildRequires: libatomic # We need python3-devel for %%py3_shebang_fix BuildRequires: python3-devel +%if %{without compat_build} # For reproducible pyc file generation # See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility %if 0%{?fedora} BuildRequires: /usr/bin/marshalparser %global py_reproducible_pyc_path %{buildroot}%{python3_sitelib} %endif +%endif # Needed for %%multilib_fix_c_header BuildRequires: multilib-rpm-config @@ -178,6 +188,8 @@ Summary: Runtime library for clang Requires: %{name}-resource-filesystem%{?_isa} = %{version} Requires: gcc-toolset-12-gcc-c++ 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 # with -fopenmp. Recommends: libomp-devel%{_isa} = %{version} @@ -193,11 +205,11 @@ Runtime library for clang. %package devel Summary: Development header files for clang +Requires: %{name}-libs = %{version}-%{release} %if %{without compat_build} Requires: %{name}%{?_isa} = %{version}-%{release} # The clang CMake files reference tools from clang-tools-extra. Requires: %{name}-tools-extra%{?_isa} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} %endif %description devel @@ -231,6 +243,13 @@ Requires: emacs-filesystem %description tools-extra 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 # and we don't want to force users to install all those dependenices if they # just want clang. @@ -246,7 +265,7 @@ clang-format integration for git. %package -n python3-clang Summary: Python3 bindings for clang -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: python3 %description -n python3-clang %{summary}. @@ -256,29 +275,27 @@ Requires: python3 %prep -%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %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 6 -n llvm-%{compat_ver}.src +%setup -T -q -b 7 -n llvm-%{compat_ver}.src %endif %if %{with compat_build} %autosetup -n %{clang_srcdir} -p2 %else -%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE1}' -%setup -T -q -b 1 -n %{clang_tools_srcdir} +%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE2}' +%setup -T -q -b 2 -n %{clang_tools_srcdir} %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 -rm test/clang-tidy/checkers/altera-struct-pack-align.cpp +rm test/clang-tidy/checkers/altera/struct-pack-align.cpp %py3_shebang_fix \ clang-tidy/tool/ \ @@ -302,16 +319,7 @@ rm test/CodeGen/profile-filter.c %endif %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} %if 0%{?__isa_bits} == 64 @@ -320,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 %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 %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif -%set_build_flags -CXXFLAGS="$CXXFLAGS -Wno-address -Wno-nonnull -Wno-maybe-uninitialized" -CFLAGS="$CFLAGS -Wno-address -Wno-nonnull -Wno-maybe-uninitialized" +# Disable dwz on aarch64, because it takes a huge amount of time to decide not to optimize things. +%ifarch aarch64 +%define _find_debuginfo_dwz_opts %{nil} +%endif + %if %{with bundle_compat_lib} @@ -341,10 +351,12 @@ mv ../clang-%{compat_ver}.src ../clang %cmake -S ../llvm-%{compat_ver}.src -B ../clang-compat-libs -G Ninja \ -DLLVM_ENABLE_PROJECTS=clang \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_ENABLE_EH=ON \ - -DLLVM_ENABLE_RTTI=ON \ - -DCMAKE_SKIP_RPATH:BOOL=ON + -DLLVM_ENABLE_RTTI: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-cpp.so @@ -352,11 +364,13 @@ mv ../clang-%{compat_ver}.src ../clang %endif -# -DLLVM_ENABLE_NEW_PASS_MANAGER=ON can be removed once this patch is committed: -# https://reviews.llvm.org/D107628 +# We set CLANG_DEFAULT_PIE_ON_LINUX=OFF to match the default used by Fedora's GCC. +# See https://bugzilla.redhat.com/show_bug.cgi?id=2134146 %cmake -G Ninja \ - -DCMAKE_C_COMPILER=/opt/rh/gcc-toolset-12/root/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/opt/rh/gcc-toolset-12/root/usr/bin/g++ \ +%ifarch %ix86 + -DHAVE_CXX_ATOMICS64_WITHOUT_LIB=OFF \ +%endif + -DCLANG_DEFAULT_PIE_ON_LINUX=OFF \ -DLLVM_PARALLEL_LINK_JOBS=1 \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ @@ -373,6 +387,7 @@ mv ../clang-%{compat_ver}.src ../clang -DCLANG_INCLUDE_TESTS:BOOL=OFF \ %else -DCLANG_INCLUDE_TESTS:BOOL=ON \ + -DLLVM_BUILD_UTILS:BOOL=ON \ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../%{clang_tools_srcdir} \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ -DLLVM_LIT_ARGS="-vv" \ @@ -397,10 +412,8 @@ mv ../clang-%{compat_ver}.src ../clang -DLLVM_ENABLE_EH=ON \ -DLLVM_ENABLE_RTTI=ON \ -DLLVM_BUILD_DOCS=ON \ - -DLLVM_ENABLE_NEW_PASS_MANAGER=ON \ -DLLVM_ENABLE_SPHINX=ON \ -DCLANG_LINK_CLANG_DYLIB=ON \ - %{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \ \ -DCLANG_BUILD_EXAMPLES:BOOL=OFF \ @@ -410,7 +423,8 @@ mv ../clang-%{compat_ver}.src ../clang -DCLANG_DEFAULT_LINKER=lld \ %endif -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 @@ -437,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 # in the compat package, because the version macros would # conflict with # 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}|" \ -e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \ -e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \ @@ -504,9 +518,6 @@ popd 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} # Add a symlink in /usr/bin to clang-format-diff ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff @@ -518,6 +529,18 @@ sed -i -e "s/'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'/'ASAN_SYMBOLIZER_PAT %if %{without compat_build} %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 # FIXME: Fix failing ARM tests SOURCE_DATA_EPOCH=1629181597 LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \ @@ -526,6 +549,11 @@ SOURCE_DATA_EPOCH=1629181597 LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} %else false %endif + +%if %{with bundle_compat_lib} +mv ./libclang-cpp.so.%{compat_maj_ver} "$compat_lib" +%endif + %endif %endif @@ -547,11 +575,11 @@ false %files libs %if %{without compat_build} -%{_libdir}/clang/ +%{_libdir}/clang/%{version}/include/* %{_libdir}/*.so.* %else %{pkg_libdir}/*.so.* -%{pkg_libdir}/clang/%{version} +%{pkg_libdir}/clang/%{version}/include/* %endif %if %{with bundle_compat_lib} %{_libdir}/libclang.so.%{compat_maj_ver}* @@ -564,6 +592,7 @@ false %{_includedir}/clang/ %{_includedir}/clang-c/ %{_libdir}/cmake/* +%{_bindir}/clang-tblgen %dir %{_datadir}/clang/ %{_rpmmacrodir}/macros.%{name} %else @@ -574,6 +603,7 @@ false %endif %files resource-filesystem +%dir %{pkg_libdir}/clang/ %dir %{pkg_libdir}/clang/%{version}/ %dir %{pkg_libdir}/clang/%{version}/include/ %dir %{pkg_libdir}/clang/%{version}/lib/ @@ -612,9 +642,11 @@ false %{_bindir}/clang-include-fixer %{_bindir}/clang-move %{_bindir}/clang-offload-bundler +%{_bindir}/clang-offload-packager %{_bindir}/clang-offload-wrapper %{_bindir}/clang-linker-wrapper %{_bindir}/clang-nvlink-wrapper +%{_bindir}/clang-pseudo %{_bindir}/clang-query %{_bindir}/clang-refactor %{_bindir}/clang-rename @@ -642,6 +674,9 @@ false %{_datadir}/clang/run-find-all-symbols.py* %{_datadir}/clang/clang-rename.py* +%files tools-extra-devel +%{_includedir}/clang-tidy/ + %files -n git-clang-format %{_bindir}/git-clang-format @@ -651,15 +686,17 @@ false %endif %changelog -* Tue Dec 13 2022 Konrad Kleine - 14.0.6-4 -- Bump release version +* Mon Jan 16 2023 Konrad Kleine - 15.0.7-2 +- Update to 15.0.7 + +* Thu Dec 08 2022 Konrad Kleine - 15.0.6-1 +- Update to 15.0.6 -* Fri Dec 09 2022 Timm Bäder - 14.0.6-3 -- Print executed tests +* Mon Oct 17 2022 Nikita Popov - 15.0.1-2 +- Default to non-pie, fix rhbz#2134146 -* Tue Dec 06 2022 Timm Bäder - 14.0.6-2 -- Fix upstream bug llvm#55560 -- https://bugzilla.redhat.com/show_bug.cgi?id=2150854 +* Mon Sep 26 2022 Konrad Kleine - 15.0.1-1 +- Update to 15.0.1 * Tue Jul 19 2022 Timm Bäder - 14.0.6-1 - Update to 14.0.6