import clang-13.0.1-1.module+el8.6.0+14118+d530a951

This commit is contained in:
CentOS Sources 2022-05-10 03:06:20 -04:00 committed by Stepan Oksanichenko
parent 3f8d12f68a
commit c2acd51e08
17 changed files with 367 additions and 6679 deletions

View File

@ -1,3 +1,3 @@
e3cdd3fb39c78a5bcb0a1d5706678cf8643a48f6 SOURCES/clang-12.0.1.src.tar.xz
42f179bb59432c4d2785239952853ad6308d0863 SOURCES/clang-tools-extra-12.0.1.src.tar.xz
9cdc305550fbd27d52d023e8506c50c41e97b7fa SOURCES/clang-13.0.1.src.tar.xz
ee28b71609e57e677205f44076e450fe5f577a22 SOURCES/clang-tools-extra-13.0.1.src.tar.xz
b8d2648a01d36ed0186fd2c5af325fd28797f9a0 SOURCES/tstellar-gpg-key.asc

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
SOURCES/clang-12.0.1.src.tar.xz
SOURCES/clang-tools-extra-12.0.1.src.tar.xz
SOURCES/clang-13.0.1.src.tar.xz
SOURCES/clang-tools-extra-13.0.1.src.tar.xz
SOURCES/tstellar-gpg-key.asc

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
From d68a5a7817dc0d43853d8b84c9185dc24338664f Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
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<const char *>(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<StringRef, 16> CandidateTripleAliases;
SmallVector<StringRef, 16> 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

View File

@ -0,0 +1,36 @@
From 62eaebcb6bb872830299efa3f87506f1d23ef366 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Mon, 13 Sep 2021 10:25:45 +0200
Subject: [PATCH][clang] Fix scan-build-py executable lookup path
Once installed, scan-build-py doesn't know anything about its auxiliary
executable and can't find them.
Use relative path wrt. scan-build-py script.
Differential Revision: https://reviews.llvm.org/D109659
(cherry picked from commit c84755a046bbdcd0564693e30b2508034b06002b)
---
clang/tools/scan-build-py/lib/libscanbuild/analyze.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/clang/tools/scan-build-py/lib/libscanbuild/analyze.py b/clang/tools/scan-build-py/lib/libscanbuild/analyze.py
index 9a249a8..d83ff2a 100644
--- a/clang/tools/scan-build-py/lib/libscanbuild/analyze.py
+++ b/clang/tools/scan-build-py/lib/libscanbuild/analyze.py
@@ -39,8 +39,10 @@ from libscanbuild.shell import decode
__all__ = ['scan_build', 'analyze_build', 'analyze_compiler_wrapper']
-COMPILER_WRAPPER_CC = 'analyze-cc'
-COMPILER_WRAPPER_CXX = 'analyze-c++'
+scanbuild_dir = os.path.dirname(__import__('sys').argv[0])
+
+COMPILER_WRAPPER_CC = os.path.join(scanbuild_dir, '..', 'libexec', 'analyze-cc')
+COMPILER_WRAPPER_CXX = os.path.join(scanbuild_dir, '..', 'libexec', 'analyze-c++')
CTU_EXTDEF_MAP_FILENAME = 'externalDefMap.txt'
CTU_TEMP_DEFMAP_FOLDER = 'tmpExternalDefMaps'
--
1.8.3.1

View File

@ -0,0 +1,39 @@
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,4 +1,4 @@
From 9613c86f0427be88ee43bddb7ae7cde74c1157ac Mon Sep 17 00:00:00 2001
From e7ab823a5f3f57e843069d43033a16165809723a Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 4 Nov 2021 11:11:53 +0100
Subject: [PATCH 2/3] Misleading bidirectional detection
@ -20,10 +20,10 @@ Differential Revision: https://reviews.llvm.org/D112913
create mode 100644 clang-tools-extra/test/clang-tidy/checkers/misc-misleading-bidirectional.cpp
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index d438a47..d6bb718 100644
index 7cafe54..e6abac8 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -11,6 +11,7 @@ add_clang_library(clangTidyMiscModule
@@ -16,6 +16,7 @@ add_clang_library(clangTidyMiscModule
DefinitionsInHeadersCheck.cpp
Homoglyph.cpp
MiscTidyModule.cpp
@ -57,7 +57,7 @@ new file mode 100644
index 0000000..7a2f06b
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cpp
@@ -0,0 +1,131 @@
@@ -0,0 +1,139 @@
+//===--- MisleadingBidirectional.cpp - clang-tidy -------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@ -73,15 +73,13 @@ index 0000000..7a2f06b
+#include "llvm/Support/ConvertUTF.h"
+
+using namespace clang;
+using namespace clang::tidy::misc;
+
+static bool containsMisleadingBidi(StringRef Buffer,
+ bool HonorLineBreaks = true) {
+ const char *CurPtr = Buffer.begin();
+ unsigned EmbeddingOverride = 0, Isolate = 0;
+ unsigned i = 0;
+
+ enum {
+ LS = 0x2028,
+ enum BidiChar {
+ PS = 0x2029,
+ RLO = 0x202E,
+ RLE = 0x202B,
@ -94,20 +92,22 @@ index 0000000..7a2f06b
+ PDI = 0x2069
+ };
+
+ // Scan each character while maintaining a count of opened bidi context.
+ SmallVector<BidiChar> BidiContexts;
+
+ // Scan each character while maintaining a stack of opened bidi context.
+ // RLO/RLE/LRO/LRE all are closed by PDF while RLI LRI and FSI are closed by
+ // PDI. New lines reset the context count. Extra PDF / PDI are ignored.
+ //
+ // Warn if we end up with an unclosed context.
+ while (CurPtr < Buffer.end()) {
+ ++i;
+ unsigned char C = *CurPtr;
+ if (isASCII(C)) {
+ ++CurPtr;
+ // Line break: https://www.unicode.org/reports/tr14/tr14-32.html
+ if (C == '\n' || C == '\r' || C == '\f' || C == '\v' ||
+ C == 0x85 /*next line*/)
+ EmbeddingOverride = Isolate = 0;
+ bool IsParagrapSep =
+ (C == 0xA || C == 0xD || (0x1C <= C && C <= 0x1E) || C == 0x85);
+ bool IsSegmentSep = (C == 0x9 || C == 0xB || C == 0x1F);
+ if (IsParagrapSep || IsSegmentSep)
+ BidiContexts.clear();
+ continue;
+ }
+ llvm::UTF32 CodePoint;
@ -121,24 +121,33 @@ index 0000000..7a2f06b
+ continue;
+ }
+
+ // Open a PDF context.
+ if (CodePoint == RLO || CodePoint == RLE || CodePoint == LRO ||
+ CodePoint == LRE)
+ EmbeddingOverride += 1;
+ else if (CodePoint == PDF)
+ EmbeddingOverride = std::min(EmbeddingOverride - 1, EmbeddingOverride);
+ BidiContexts.push_back(PDF);
+ // Close PDF Context.
+ else if (CodePoint == PDF) {
+ if (!BidiContexts.empty() && BidiContexts.back() == PDF)
+ BidiContexts.pop_back();
+ }
+ // Open a PDI Context.
+ else if (CodePoint == RLI || CodePoint == LRI || CodePoint == FSI)
+ Isolate += 1;
+ else if (CodePoint == PDI)
+ Isolate = std::min(Isolate - 1, Isolate);
+ // Line break: https://www.unicode.org/reports/tr14/tr14-32.html
+ else if (CodePoint == LS || CodePoint == PS)
+ EmbeddingOverride = Isolate = 0;
+ BidiContexts.push_back(PDI);
+ // Close a PDI Context.
+ else if (CodePoint == PDI) {
+ auto R = std::find(BidiContexts.rbegin(), BidiContexts.rend(), PDI);
+ if (R != BidiContexts.rend())
+ BidiContexts.resize(BidiContexts.rend() - R - 1);
+ }
+ // Line break or equivalent
+ else if (CodePoint == PS)
+ BidiContexts.clear();
+ }
+ return EmbeddingOverride != 0 || Isolate != 0;
+ return !BidiContexts.empty();
+}
+
+class clang::tidy::misc::MisleadingBidirectionalCheck::
+ MisleadingBidirectionalHandler : public CommentHandler {
+class MisleadingBidirectionalCheck::MisleadingBidirectionalHandler
+ : public CommentHandler {
+public:
+ MisleadingBidirectionalHandler(MisleadingBidirectionalCheck &Check,
+ llvm::Optional<std::string> User)
@ -161,21 +170,20 @@ index 0000000..7a2f06b
+ MisleadingBidirectionalCheck &Check;
+};
+
+clang::tidy::misc::MisleadingBidirectionalCheck::MisleadingBidirectionalCheck(
+MisleadingBidirectionalCheck::MisleadingBidirectionalCheck(
+ StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ Handler(std::make_unique<MisleadingBidirectionalHandler>(
+ *this, Context->getOptions().User)) {}
+
+clang::tidy::misc::MisleadingBidirectionalCheck::
+ ~MisleadingBidirectionalCheck() = default;
+MisleadingBidirectionalCheck::~MisleadingBidirectionalCheck() = default;
+
+void clang::tidy::misc::MisleadingBidirectionalCheck::registerPPCallbacks(
+void MisleadingBidirectionalCheck::registerPPCallbacks(
+ const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
+ PP->addCommentHandler(Handler.get());
+}
+
+void clang::tidy::misc::MisleadingBidirectionalCheck::check(
+void MisleadingBidirectionalCheck::check(
+ const ast_matchers::MatchFinder::MatchResult &Result) {
+ if (const auto *SL = Result.Nodes.getNodeAs<StringLiteral>("strlit")) {
+ StringRef Literal = SL->getBytes();
@ -185,7 +193,7 @@ index 0000000..7a2f06b
+ }
+}
+
+void clang::tidy::misc::MisleadingBidirectionalCheck::registerMatchers(
+void MisleadingBidirectionalCheck::registerMatchers(
+ ast_matchers::MatchFinder *Finder) {
+ Finder->addMatcher(ast_matchers::stringLiteral().bind("strlit"), this);
+}
@ -234,10 +242,10 @@ index 0000000..18e7060
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGBIDIRECTIONALCHECK_H
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index e4ad7b9..546d544 100644
index 37a717e..1eec7db 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -326,6 +326,11 @@ New checks
@@ -218,6 +218,11 @@ New checks
Detects confusable unicode identifiers.
@ -250,10 +258,10 @@ index e4ad7b9..546d544 100644
^^^^^^^^^^^^^^^^^
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index 47ff5b7..977867d 100644
index df9a95c..b118639 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -202,7 +202,8 @@ Clang-Tidy Checks
@@ -207,7 +207,8 @@ Clang-Tidy Checks
`llvmlibc-implementation-in-namespace <llvmlibc-implementation-in-namespace.html>`_,
`llvmlibc-restrict-system-libc-headers <llvmlibc-restrict-system-libc-headers.html>`_, "Yes"
`misc-definitions-in-headers <misc-definitions-in-headers.html>`_, "Yes"
@ -292,7 +300,7 @@ index 0000000..16ffc97
+ }
diff --git a/clang-tools-extra/test/clang-tidy/checkers/misc-misleading-bidirectional.cpp b/clang-tools-extra/test/clang-tidy/checkers/misc-misleading-bidirectional.cpp
new file mode 100644
index 0000000..12fdf63
index 0000000..7a1746d
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/checkers/misc-misleading-bidirectional.cpp
@@ -0,0 +1,31 @@

View File

@ -1,32 +1,49 @@
From d214ffa5e0bea78f85f61e96dc1071e4ed4ac69f Mon Sep 17 00:00:00 2001
From dbfbbab65139552549604931dfa2759c9aa392de Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Fri, 15 Oct 2021 15:18:52 +0200
Subject: [PATCH 3/3] Misleading unicode identifier detection pass
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Detect when an identifier contains some Right-To-Left characters.
This pass relates to https://trojansource.codes/
Example of misleading source:
short int א = (short int)0;
short int ג = (short int)12345;
int main() {
int א = ג; // a local variable, set to zero?
printf("ג is %d\n", ג);
printf("א is %d\n", א);
}
This is a recommit of 299aa4dfa1d8c120648b1404b481d858b76c8173 with missing
option registration fixed.
Differential Revision: https://reviews.llvm.org/D112914
---
clang-tools-extra/clang-tidy/misc/CMakeLists.txt | 1 +
.../clang-tidy/misc/MiscTidyModule.cpp | 3 +
.../clang-tidy/misc/MisleadingIdentifier.cpp | 163 +++++++++++++++++++++
.../clang-tidy/misc/MisleadingIdentifier.cpp | 166 +++++++++++++++++++++
.../clang-tidy/misc/MisleadingIdentifier.h | 31 ++++
clang-tools-extra/docs/ReleaseNotes.rst | 9 ++
clang-tools-extra/docs/ReleaseNotes.rst | 4 +
clang-tools-extra/docs/clang-tidy/checks/list.rst | 1 +
.../checks/misc-misleading-identifier.rst | 23 +++
.../checkers/misc-misleading-identifier.cpp | 15 ++
8 files changed, 246 insertions(+)
8 files changed, 244 insertions(+)
create mode 100644 clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
create mode 100644 clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.h
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/misc-misleading-identifier.rst
create mode 100644 clang-tools-extra/test/clang-tidy/checkers/misc-misleading-identifier.cpp
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index d6bb718..1974245 100644
index e6abac8..22d1659 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -12,6 +12,7 @@ add_clang_library(clangTidyMiscModule
@@ -17,6 +17,7 @@ add_clang_library(clangTidyMiscModule
Homoglyph.cpp
MiscTidyModule.cpp
MisleadingBidirectional.cpp
@ -57,10 +74,10 @@ index bb5fde2..b484db8 100644
"misc-new-delete-overloads");
diff --git a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
new file mode 100644
index 0000000..f9b3075
index 0000000..4ddb8ba
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
@@ -0,0 +1,163 @@
@@ -0,0 +1,166 @@
+//===--- MisleadingIdentifier.cpp - clang-tidy-----------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@ -211,8 +228,11 @@ index 0000000..f9b3075
+ const ast_matchers::MatchFinder::MatchResult &Result) {
+ if (const auto *ND = Result.Nodes.getNodeAs<NamedDecl>("nameddecl")) {
+ IdentifierInfo *II = ND->getIdentifier();
+ if (II && hasRTLCharacters(II->getName()))
+ diag(ND->getBeginLoc(), "identifier has right-to-left codepoints");
+ if (II) {
+ StringRef NDName = II->getName();
+ if (hasRTLCharacters(NDName))
+ diag(ND->getBeginLoc(), "identifier has right-to-left codepoints");
+ }
+ }
+}
+
@ -262,22 +282,10 @@ index 0000000..9580ae6
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISLEADINGIDENTIFIERCHECK_H
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 546d544..3f0ab3b 100644
index 1eec7db..07977d0 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -308,6 +308,11 @@ New checks
- New :doc:`bugprone-signal-handler
<clang-tidy/checks/bugprone-signal-handler>` check.
+- New :doc:`readability-data-pointer <clang-tidy/checks/readability-data-pointer>` check.
+
+- New :doc:`concurrency-thread-canceltype-asynchronous
+ <clang-tidy/checks/concurrency-thread-canceltype-asynchronous>` check.
+
Finds functions registered as signal handlers that call non asynchronous-safe
functions.
@@ -331,6 +336,10 @@ New checks
@@ -223,6 +223,10 @@ New checks
Inspect string literal and comments for unterminated bidirectional Unicode
characters.
@ -289,10 +297,10 @@ index 546d544..3f0ab3b 100644
^^^^^^^^^^^^^^^^^
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index 977867d..9c0a5b0 100644
index b118639..592d69b 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -204,6 +204,7 @@ Clang-Tidy Checks
@@ -209,6 +209,7 @@ Clang-Tidy Checks
`misc-definitions-in-headers <misc-definitions-in-headers.html>`_, "Yes"
`misc-homoglyph <misc-homoglyph.html>`_,
`misc-misleading-bidirectional <misc-misleading-bidirectional.html>`_,
@ -302,7 +310,7 @@ index 977867d..9c0a5b0 100644
`misc-no-recursion <misc-no-recursion.html>`_,
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-misleading-identifier.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-misleading-identifier.rst
new file mode 100644
index 0000000..7ccbc94
index 0000000..8bd9999
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc-misleading-identifier.rst
@@ -0,0 +1,23 @@

View File

@ -1,25 +1,25 @@
From 2c6cd40d016f492d53e16f1c7424a0d9878ae7ec Mon Sep 17 00:00:00 2001
From 88704fc2eabb9dd19a9c3eb81a9b3dc37d95651c Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 31 Jan 2020 11:04:57 -0800
Subject: [PATCH 3/6] [PATCH][clang] Don't install static libraries
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 704278a..1737b24 100644
index 5752f4277444..0f52822d91f0 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -111,7 +111,7 @@ macro(add_clang_library name)
@@ -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))
set(export_to_clangtargets)
if(${lib} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
"clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries)
install(TARGETS ${lib}
COMPONENT ${lib}
--
1.8.3.1
2.30.2

View File

@ -1,132 +0,0 @@
From d8af49687765744efaae7ba0f0c4c0fcd58a0e31 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Wed, 23 Sep 2020 12:47:30 +0000
Subject: [PATCH 4/6] [PATCH][clang] Prefer gcc toolchains with libgcc_s.so
when not static linking libgcc
Fedora ships cross-compilers on all platforms, so a user could end up
with a gcc x86_64 cross-compiler installed on an x86_64 system. clang
maintains a list of supported triples for each target and when all
else is equal will prefer toolchains with triples that appear earlier
in the list.
The cross-compiler triple on Fedora is x86_64-linux-gnu and this comes
before the Fedora system compiler's triple: x86_64-redhat-linux in
the triples list, so the cross compiler is always preferred. This
is a problem, because the cross compiler is missing libraries, like
libgcc_s.so, that clang expects to be there so linker invocations
will fail.
This patch fixes this by checking for the existence of libgcc_s.so
when it is required and taking that into account when selecting a
toolchain.
---
clang/lib/Driver/ToolChains/Gnu.cpp | 16 ++++++++++++++--
clang/lib/Driver/ToolChains/Gnu.h | 4 +++-
.../usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o | 0
.../usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o | 0
.../usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so | 0
clang/test/Driver/linux-ld.c | 12 ++++++++++++
6 files changed, 29 insertions(+), 3 deletions(-)
create mode 100644 clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o
create mode 100644 clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
create mode 100644 clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 5deeb10..5d51517 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2539,6 +2539,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
(TargetArch == llvm::Triple::x86 &&
TargetTriple.getOS() != llvm::Triple::Solaris)}};
+ bool NeedLibgccShared = !Args.hasArg(options::OPT_static_libgcc) &&
+ !Args.hasArg(options::OPT_static);
for (auto &Suffix : Suffixes) {
if (!Suffix.Active)
continue;
@@ -2556,8 +2558,17 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
continue; // Saw this path before; no need to look at it again.
if (CandidateVersion.isOlderThan(4, 1, 1))
continue;
- if (CandidateVersion <= Version)
- continue;
+
+ bool CandidateHasLibGccShared = false;
+ if (CandidateVersion <= Version) {
+ if (NeedLibgccShared && !HasLibGccShared) {
+ CandidateHasLibGccShared =
+ D.getVFS().exists(LI->path() + "/libgcc_s.so");
+
+ }
+ if (HasLibGccShared || !CandidateHasLibGccShared)
+ continue;
+ }
if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(),
NeedsBiarchSuffix))
@@ -2571,6 +2582,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
GCCInstallPath = (LibDir + "/" + LibSuffix + "/" + VersionText).str();
GCCParentLibPath = (GCCInstallPath + "/../" + Suffix.ReversePath).str();
IsValid = true;
+ HasLibGccShared = CandidateHasLibGccShared;
}
}
}
diff --git a/clang/lib/Driver/ToolChains/Gnu.h b/clang/lib/Driver/ToolChains/Gnu.h
index 90d3baf..9d0cea2 100644
--- a/clang/lib/Driver/ToolChains/Gnu.h
+++ b/clang/lib/Driver/ToolChains/Gnu.h
@@ -190,6 +190,7 @@ public:
/// Driver, and has logic for fuzzing that where appropriate.
class GCCInstallationDetector {
bool IsValid;
+ bool HasLibGccShared;
llvm::Triple GCCTriple;
const Driver &D;
@@ -216,7 +217,8 @@ public:
const std::string GentooConfigDir = "/etc/env.d/gcc";
public:
- explicit GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {}
+ explicit GCCInstallationDetector(const Driver &D)
+ : IsValid(false), HasLibGccShared(false), D(D) {}
void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args,
ArrayRef<std::string> ExtraTripleAliases = None);
diff --git a/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o b/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o
new file mode 100644
index 0000000..e69de29
diff --git a/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o b/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
new file mode 100644
index 0000000..e69de29
diff --git a/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so b/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so
new file mode 100644
index 0000000..e69de29
diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index 24d3c78..071bb9b 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -784,6 +784,18 @@
// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtend.o"
// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtn.o"
//
+// Check that clang does not select the cross compiler by default on Fedora 28.
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux-gnu \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/fedora_28_tree \
+// RUN: | FileCheck --check-prefix=CHECK-FEDORA-28-X86_64 %s
+//
+// CHECK-FEDORA-28-X86_64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-FEDORA-28-X86_64: "[[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o"
+// CHECK-FEDORA-28-X86_64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7"
+//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \
// RUN: --gcc-toolchain="" \
--
1.8.3.1

View File

@ -1,77 +0,0 @@
From 1ef1e91142ac48ecb826f33e1e7072c7402d9fe7 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Wed, 3 Mar 2021 09:58:31 +0100
Subject: [PATCH 6/6] [PATCH][clang] Allow __ieee128 as an alias to __float128
on ppc
This matches gcc behavior.
Differential Revision: https://reviews.llvm.org/D97846
(cherry picked from commit 4aa510be78a75a4da82657fe433016f00dad0784)
---
clang/include/clang/Basic/LangOptions.def | 1 +
clang/lib/Basic/IdentifierTable.cpp | 3 +++
clang/lib/Basic/Targets/PPC.cpp | 1 +
clang/test/Sema/128bitfloat.cpp | 7 +++++++
4 files changed, 12 insertions(+)
diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
index c01f0cc..3c22393e 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -107,6 +107,7 @@ LANGOPT(Bool , 1, 0, "bool, true, and false keywords")
LANGOPT(Half , 1, 0, "half keyword")
LANGOPT(WChar , 1, CPlusPlus, "wchar_t keyword")
LANGOPT(Char8 , 1, 0, "char8_t keyword")
+LANGOPT(IEEE128 , 1, 0, "__ieee128 keyword")
LANGOPT(DeclSpecKeyword , 1, 0, "__declspec keyword")
BENIGN_LANGOPT(DollarIdents , 1, 1, "'$' in identifiers")
BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode")
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 51c6e02..cedc94a 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -227,6 +227,9 @@ void IdentifierTable::AddKeywords(const LangOptions &LangOpts) {
if (LangOpts.DeclSpecKeyword)
AddKeyword("__declspec", tok::kw___declspec, KEYALL, LangOpts, *this);
+ if (LangOpts.IEEE128)
+ AddKeyword("__ieee128", tok::kw___float128, KEYALL, LangOpts, *this);
+
// Add the 'import' contextual keyword.
get("import").setModulesImport(true);
}
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index ff09c0f..38f286c 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -551,6 +551,7 @@ void PPCTargetInfo::adjust(LangOptions &Opts) {
LongDoubleFormat = Opts.PPCIEEELongDouble
? &llvm::APFloat::IEEEquad()
: &llvm::APFloat::PPCDoubleDouble();
+ Opts.IEEE128 = 1;
}
ArrayRef<Builtin::Info> PPCTargetInfo::getTargetBuiltins() const {
diff --git a/clang/test/Sema/128bitfloat.cpp b/clang/test/Sema/128bitfloat.cpp
index 4a826b4..6a9ae74 100644
--- a/clang/test/Sema/128bitfloat.cpp
+++ b/clang/test/Sema/128bitfloat.cpp
@@ -6,6 +6,13 @@
// RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s
#if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
+
+#if defined(__ppc__)
+template <typename> struct __is_float128 { static constexpr bool value = false; };
+template <> struct __is_float128<__float128> { static constexpr bool value = true; };
+static_assert(__is_float128<__ieee128>::value, "__ieee128 aliases to __float128");
+#endif
+
__float128 f;
template<typename> struct __is_floating_point_helper {};
template<> struct __is_floating_point_helper<__float128> {};
--
1.8.3.1

Binary file not shown.

Binary file not shown.

Binary file not shown.

16
SOURCES/macros.clang Normal file
View File

@ -0,0 +1,16 @@
%clang_major_version @@CLANG_MAJOR_VERSION@@
%clang_minor_version @@CLANG_MINOR_VERSION@@
%clang_patch_version @@CLANG_PATCH_VERSION@@
%clang_version %{clang_major_version}.%{clang_minor_version}.%{clang_patch_version}
# This is the path to the clang resource directory that has clang's internal
# headers and libraries. This path should be used by packages that need to
# install files into this directory. This macro's value changes every time
# clang's version changes.
%clang_resource_dir %{_libdir}/clang/%{clang_version}
# This is the path to the clang resource directory that should be used
# by packages that need to read files from this directory at runtime.
# This macro only changes when clang's major version changes.
%clang_resource_dir_readonly %{_libdir}/clang/%{clang_major_version}

View File

@ -1,9 +1,11 @@
%global compat_build 0
%bcond_with compat_build
%bcond_without check
%global maj_ver 12
%global maj_ver 13
%global min_ver 0
%global patch_ver 1
#%%global rc_ver 5
#global rc_ver 4
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
%global clang_tools_binaries \
%{_bindir}/clang-apply-replacements \
@ -20,6 +22,7 @@
%{_bindir}/clang-refactor \
%{_bindir}/clang-rename \
%{_bindir}/clang-reorder-fields \
%{_bindir}/clang-repl \
%{_bindir}/clang-scan-deps \
%{_bindir}/clang-tidy \
%{_bindir}/clangd \
@ -35,7 +38,7 @@
%{_bindir}/clang-cl \
%{_bindir}/clang-cpp \
%if 0%{?compat_build}
%if %{with compat_build}
%global pkg_name clang%{maj_ver}
# Install clang to same prefix as llvm, so that apps that use llvm-config
# will also be able to find clang libs.
@ -53,40 +56,52 @@
%global pkg_libdir %{_libdir}
%endif
%global build_install_prefix %{buildroot}%{install_prefix}
%ifarch ppc64le aarch64
# Too many threads on some 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
%if 0%{?fedora} || 0%{?rhel} > 7
%bcond_without python3
%else
%bcond_with python3
%endif
%global build_install_prefix %{buildroot}%{install_prefix}
%global _smp_mflags -j2
%global clang_srcdir clang-%{version}%{?rc_ver:rc%{rc_ver}}.src
%global clang_tools_srcdir clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src
Name: %pkg_name
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 4%{?dist}
Release: 1%{?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-%{version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz.sig
%if !0%{?compat_build}
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz.sig
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
%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
%endif
Source4: tstellar-gpg-key.asc
%if !0%{?compat_build}
Source5: 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: 0004-PATCH-clang-Prefer-gcc-toolchains-with-libgcc_s.so-w.patch
Patch5: 0006-PATCH-clang-Allow-__ieee128-as-an-alias-to-__float12.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
Patch5: 0001-PATCH-clang-Fix-scan-build-py-executable-lookup-path.patch
# Patches for clang-tools-extra
%if !0%{?compat_build}
@ -99,14 +114,11 @@ Patch202: 0001-Confusable-identifiers-detection.patch
Patch203: 0002-Misleading-bidirectional-detection.patch
Patch204: 0003-Misleading-unicode-identifier-detection-pass.patch
# Not Upstream
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: ninja-build
%if 0%{?compat_build}
%if %{with compat_build}
BuildRequires: llvm%{maj_ver}-devel = %{version}
BuildRequires: llvm%{maj_ver}-static = %{version}
%else
@ -202,7 +214,7 @@ Runtime library for clang.
%package devel
Summary: Development header files for clang
%if !0%{?compat_build}
%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}
@ -219,7 +231,7 @@ Provides: %{name}-resource-filesystem(major) = %{maj_ver}
%description resource-filesystem
This package owns the clang resouce directory: $libdir/clang/$version/
%if !0%{?compat_build}
%if %{without compat_build}
%package analyzer
Summary: A source code analysis framework
License: NCSA and MIT
@ -265,7 +277,7 @@ Requires: python3
%prep
%if 0%{?compat_build}
%if %{with compat_build}
%autosetup -n %{clang_srcdir} -p2
%else
%setup -T -q -b 1 -n %{clang_tools_srcdir}
@ -288,7 +300,9 @@ pathfix.py -i %{__python3} -pn \
tools/clang-format/*.py \
tools/clang-format/git-clang-format \
utils/hmaptool/hmaptool \
tools/scan-view/bin/scan-view
tools/scan-view/bin/scan-view \
tools/scan-build-py/bin/* \
tools/scan-build-py/libexec/*
%endif
%build
@ -333,9 +347,9 @@ cd %{_vpath_builddir}
-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
%endif
%if 0%{?compat_build}
%if %{with compat_build}
-DCLANG_BUILD_TOOLS:BOOL=OFF \
-DLLVM_CONFIG:FILEPATH=%{_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} \
-DLLVM_CONFIG:FILEPATH=%{_bindir}/llvm-config-%{maj_ver} \
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
-DCLANG_INCLUDE_TESTS:BOOL=OFF \
%else
@ -350,7 +364,7 @@ cd %{_vpath_builddir}
%endif
%endif
\
%if 0%{compat_build}
%if %{with compat_build}
-DLLVM_TABLEGEN_EXE:FILEPATH=%{_bindir}/llvm-tblgen-%{maj_ver} \
%else
-DLLVM_TABLEGEN_EXE:FILEPATH=%{_bindir}/llvm-tblgen \
@ -363,8 +377,10 @@ cd %{_vpath_builddir}
-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 \
@ -380,25 +396,33 @@ pushd %{_vpath_builddir}
%cmake_install
popd
%if 0%{?compat_build}
%if %{with compat_build}
# Remove binaries/other files
rm -Rf %{buildroot}%{install_bindir}
rm -Rf %{buildroot}%{install_prefix}/share
rm -Rf %{buildroot}%{install_prefix}/libexec
# Move include files
mkdir -p %{buildroot}%{pkg_includedir}
mv %{buildroot}/%{install_includedir}/clang %{buildroot}/%{pkg_includedir}/
mv %{buildroot}/%{install_includedir}/clang-c %{buildroot}/%{pkg_includedir}/
%else
# 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 %{SOURCE5} %{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}|" \
%{buildroot}%{_rpmmacrodir}/macros.%{name}
# install clang python bindings
mkdir -p %{buildroot}%{python3_sitelib}/clang/
install -p -m644 bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang
# install scanbuild-py to python sitelib.
mv %{buildroot}%{_prefix}/lib/{libear,libscanbuild} %{buildroot}%{python3_sitelib}
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/{libear,libscanbuild}
# multilib fix
%multilib_fix_c_header --file %{_includedir}/clang/Config/config.h
@ -441,25 +465,30 @@ pushd %{buildroot}%{_libdir}/clang/
ln -s %{version} %{maj_ver}
popd
%endif
# Create sub-directories in the clang resource directory that will be
# populated by other packages
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/{include,lib,share}/
mkdir -p %{buildroot}%{pkg_libdir}/clang/%{version}/{include,lib,share}/
%endif
# 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
%endif
%check
cd %{_vpath_builddir}
%if !0%{?compat_build}
%if %{without compat_build}
%if %{with check}
# requires lit.py from LLVM utilities
# FIXME: Fix failing ARM tests
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %cmake_build --target check-all || \
%endif
%ifarch %{arm}
:
%else
@ -469,7 +498,7 @@ false
%endif
%if !0%{?compat_build}
%if %{without compat_build}
%files
%license LICENSE.TXT
%{clang_binaries}
@ -480,7 +509,7 @@ false
%endif
%files libs
%if !0%{?compat_build}
%if %{without compat_build}
%{_libdir}/clang/
%{_libdir}/*.so.*
%else
@ -489,12 +518,13 @@ false
%endif
%files devel
%if !0%{?compat_build}
%if %{without compat_build}
%{_libdir}/*.so
%{_includedir}/clang/
%{_includedir}/clang-c/
%{_libdir}/cmake/*
%dir %{_datadir}/clang/
%{_rpmmacrodir}/macros.%{name}
%else
%{pkg_libdir}/*.so
%{pkg_includedir}/clang/
@ -507,19 +537,28 @@ false
%dir %{pkg_libdir}/clang/%{version}/include/
%dir %{pkg_libdir}/clang/%{version}/lib/
%dir %{pkg_libdir}/clang/%{version}/share/
%if !0%{?compat_build}
%if %{without compat_build}
%{pkg_libdir}/clang/%{maj_ver}
%endif
%if !0%{?compat_build}
%if %{without compat_build}
%files analyzer
%{_bindir}/scan-view
%{_bindir}/scan-build
%{_bindir}/analyze-build
%{_bindir}/intercept-build
%{_bindir}/scan-build-py
%{_libexecdir}/ccc-analyzer
%{_libexecdir}/c++-analyzer
%{_libexecdir}/analyze-c++
%{_libexecdir}/analyze-cc
%{_libexecdir}/intercept-c++
%{_libexecdir}/intercept-cc
%{_datadir}/scan-view/
%{_datadir}/scan-build/
%{_mandir}/man1/scan-build.1.*
%{python3_sitelib}/libear
%{python3_sitelib}/libscanbuild
%files tools-extra
%{clang_tools_binaries}
@ -535,7 +574,7 @@ false
%{_datadir}/clang/clang-format-diff.py*
%{_datadir}/clang/clang-include-fixer.py*
%{_datadir}/clang/clang-tidy-diff.py*
%{_datadir}/clang/run-clang-tidy.py*
%{_bindir}/run-clang-tidy
%{_datadir}/clang/run-find-all-symbols.py*
%{_datadir}/clang/clang-rename.py*
@ -548,14 +587,17 @@ false
%endif
%changelog
* Wed Nov 10 2021 sguelton@redhat.com - 12.0.1-4
- Trojan source clang-tidy patchset fix
* Thu Feb 03 2022 Tom Stellard <tstellar@redhat.com> - 13.0.1-1
- 13.0.1 Release
* Thu Nov 4 2021 sguelton@redhat.com - 12.0.1-3
- Trojan source clang-tidy patchset
* Fri Jan 21 2022 Serge Guelton - 13.0.0-3
- Backport bidi patches
* Fri Sep 17 2021 Tom Stellard <tstellar@redhat.com> - 12.0.1-2
- Only enable -funwind-tables by default on some arches
* Fri Oct 22 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-2
- Don't emit unwind tables for bpf
* Fri Oct 15 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-1
- 13.0.0 Release
* Fri Jul 16 2021 sguelton@redhat.com - 12.0.1-1
- 12.0.1 release