Merge remote-tracking branch 'up/f38' into f38-riscv64

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2023-04-24 09:47:43 +03:00
commit 4c03207dee
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
19 changed files with 246 additions and 1004 deletions

242
.gitignore vendored
View File

@ -1,237 +1,5 @@
/cfe-3.7.1.src.tar.xz
/clang-3.8.0-0.1.fc24.src.rpm
/cfe-3.8.0rc2.src.tar.xz
/cfe-3.8.0rc3.src.tar.xz
/cfe-3.8.0.src.tar.xz
/cfe-3.9.0.src.tar.xz
/cfe-3.9.1.src.tar.xz
/clang-tools-extra-3.9.1.src.tar.xz
/cfe-4.0.0.src.tar.xz
/clang-tools-extra-4.0.0.src.tar.xz
/test-suite-4.0.0.src.tar.xz
/cfe-4.0.1.src.tar.xz
/test-suite-4.0.1.src.tar.xz
/clang-tools-extra-4.0.1.src.tar.xz
/cfe-5.0.0.src.tar.xz
/test-suite-5.0.0.src.tar.xz
/clang-tools-extra-5.0.0.src.tar.xz
/clang-tools-extra-5.0.1.src.tar.xz
/cfe-5.0.1.src.tar.xz
/test-suite-5.0.1.src.tar.xz
/cfe-6.0.0rc1.src.tar.xz
/clang-tools-extra-6.0.0rc1.src.tar.xz
/test-suite-6.0.0rc1.src.tar.xz
/cfe-6.0.0rc2.src.tar.xz
/test-suite-6.0.0rc2.src.tar.xz
/clang-tools-extra-6.0.0rc2.src.tar.xz
/cfe-6.0.0.src.tar.xz
/test-suite-6.0.0.src.tar.xz
/clang-tools-extra-6.0.0.src.tar.xz
/cfe-6.0.1rc1.src.tar.xz
/clang-tools-extra-6.0.1rc1.src.tar.xz
/test-suite-6.0.1rc1.src.tar.xz
/cfe-6.0.1rc2.src.tar.xz
/clang-tools-extra-6.0.1rc2.src.tar.xz
/test-suite-6.0.1rc2.src.tar.xz
/cfe-6.0.1.src.tar.xz
/clang-tools-extra-6.0.1.src.tar.xz
/test-suite-6.0.1.src.tar.xz
/cfe-7.0.0rc1.src.tar.xz
/test-suite-7.0.0rc1.src.tar.xz
/clang-tools-extra-7.0.0rc1.src.tar.xz
/test-suite-7.0.0rc1.src.fedora.tar.gz
/test-suite-7.0.0rc1.src.fedora.tar.xz
/cfe-7.0.0rc2.src.tar.xz
/clang-tools-extra-7.0.0rc2.src.tar.xz
/test-suite-7.0.0rc2.src.fedora.tar.xz
/cfe-7.0.0rc3.src.tar.xz
/clang-tools-extra-7.0.0rc3.src.tar.xz
/test-suite-7.0.0rc3.src.fedora.tar.xz
/cfe-7.0.0.src.tar.xz
/test-suite-7.0.0.src.fedora.tar.xz
/clang-tools-extra-7.0.0.src.tar.xz
/clang-tools-extra-7.0.1.src.tar.xz
/cfe-7.0.1.src.tar.xz
/clang-tools-extra-8.0.0rc1.src.tar.xz
/cfe-8.0.0rc1.src.tar.xz
/cfe-8.0.0rc2.src.tar.xz
/clang-tools-extra-8.0.0rc2.src.tar.xz
/cfe-8.0.0rc3.src.tar.xz
/clang-tools-extra-8.0.0rc3.src.tar.xz
/cfe-8.0.0rc4.src.tar.xz
/clang-tools-extra-8.0.0rc4.src.tar.xz
/cfe-8.0.0.src.tar.xz
/clang-tools-extra-8.0.0.src.tar.xz
/cfe-9.0.0rc2.src.tar.xz
/clang-tools-extra-9.0.0rc2.src.tar.xz
/cfe-9.0.0rc3.src.tar.xz
/clang-tools-extra-9.0.0rc3.src.tar.xz
/cfe-9.0.0.src.tar.xz
/clang-tools-extra-9.0.0.src.tar.xz
/clang-9.0.1.src.tar.xz
/clang-tools-extra-9.0.1.src.tar.xz
/clang-10.0.0rc1.src.tar.xz
/clang-tools-extra-10.0.0rc1.src.tar.xz
/clang-10.0.0rc1.src.tar.xz.sig
/clang-tools-extra-10.0.0rc1.src.tar.xz.sig
/clang-10.0.0rc2.src.tar.xz
/clang-tools-extra-10.0.0rc2.src.tar.xz
/clang-tools-extra-10.0.0rc2.src.tar.xz.sig
/clang-10.0.0rc2.src.tar.xz.sig
/clang-10.0.0rc3.src.tar.xz
/clang-tools-extra-10.0.0rc3.src.tar.xz
/clang-tools-extra-10.0.0rc3.src.tar.xz.sig
/clang-10.0.0rc3.src.tar.xz.sig
/clang-10.0.0rc4.src.tar.xz
/clang-tools-extra-10.0.0rc4.src.tar.xz
/clang-tools-extra-10.0.0rc4.src.tar.xz.sig
/clang-10.0.0rc4.src.tar.xz.sig
/clang-10.0.0rc5.src.tar.xz
/clang-tools-extra-10.0.0rc5.src.tar.xz
/clang-tools-extra-10.0.0rc5.src.tar.xz.sig
/clang-10.0.0rc5.src.tar.xz.sig
/clang-10.0.0rc6.src.tar.xz
/clang-tools-extra-10.0.0rc6.src.tar.xz
/clang-tools-extra-10.0.0rc6.src.tar.xz.sig
/clang-10.0.0rc6.src.tar.xz.sig
/clang-10.0.0.src.tar.xz.sig
/clang-tools-extra-10.0.0.src.tar.xz.sig
/clang-tools-extra-10.0.0.src.tar.xz
/clang-10.0.0.src.tar.xz
/clang-11.0.0rc1.src.tar.xz
/clang-tools-extra-11.0.0rc1.src.tar.xz
/clang-tools-extra-11.0.0rc1.src.tar.xz.sig
/clang-11.0.0rc1.src.tar.xz.sig
/clang-11.0.0rc2.src.tar.xz
/clang-tools-extra-11.0.0rc2.src.tar.xz
/clang-tools-extra-11.0.0rc2.src.tar.xz.sig
/clang-11.0.0rc2.src.tar.xz.sig
/clang-11.0.0rc3.src.tar.xz
/clang-tools-extra-11.0.0rc3.src.tar.xz
/clang-tools-extra-11.0.0rc3.src.tar.xz.sig
/clang-11.0.0rc3.src.tar.xz.sig
/clang-11.0.0rc5.src.tar.xz
/clang-11.0.0rc5.src.tar.xz.sig
/clang-tools-extra-11.0.0rc5.src.tar.xz
/clang-tools-extra-11.0.0rc5.src.tar.xz.sig
/clang-11.0.0rc6.src.tar.xz
/clang-11.0.0rc6.src.tar.xz.sig
/clang-tools-extra-11.0.0rc6.src.tar.xz
/clang-tools-extra-11.0.0rc6.src.tar.xz.sig
/clang-11.0.0.src.tar.xz
/clang-11.0.0.src.tar.xz.sig
/clang-tools-extra-11.0.0.src.tar.xz
/clang-tools-extra-11.0.0.src.tar.xz.sig
/clang-11.0.1rc1.src.tar.xz
/clang-11.0.1rc1.src.tar.xz.sig
/clang-tools-extra-11.0.1rc1.src.tar.xz
/clang-tools-extra-11.0.1rc1.src.tar.xz.sig
/clang-tools-extra-11.0.1rc2.src.tar.xz
/clang-tools-extra-11.0.1rc2.src.tar.xz.sig
/clang-11.0.1rc2.src.tar.xz.sig
/clang-11.0.1rc2.src.tar.xz
/clang-11.0.1.src.tar.xz
/clang-11.0.1.src.tar.xz.sig
/clang-tools-extra-11.0.1.src.tar.xz
/clang-tools-extra-11.0.1.src.tar.xz.sig
/clang-11.1.0rc1.src.tar.xz
/clang-tools-extra-11.1.0rc1.src.tar.xz
/clang-tools-extra-11.1.0rc1.src.tar.xz.sig
/clang-11.1.0rc1.src.tar.xz.sig
/clang-11.1.0rc2.src.tar.xz
/clang-tools-extra-11.1.0rc2.src.tar.xz
/clang-tools-extra-11.1.0rc2.src.tar.xz.sig
/clang-11.1.0rc2.src.tar.xz.sig
/clang-12.0.0rc1.src.tar.xz
/clang-tools-extra-12.0.0rc1.src.tar.xz
/clang-tools-extra-12.0.0rc1.src.tar.xz.sig
/clang-12.0.0rc1.src.tar.xz.sig
/clang-12.0.0rc2.src.tar.xz
/clang-tools-extra-12.0.0rc2.src.tar.xz
/clang-tools-extra-12.0.0rc2.src.tar.xz.sig
/clang-12.0.0rc2.src.tar.xz.sig
/clang-12.0.0rc3.src.tar.xz
/clang-12.0.0rc3.src.tar.xz.sig
/clang-tools-extra-12.0.0rc3.src.tar.xz
/clang-tools-extra-12.0.0rc3.src.tar.xz.sig
/clang-12.0.0rc4.src.tar.xz
/clang-tools-extra-12.0.0rc4.src.tar.xz
/clang-tools-extra-12.0.0rc4.src.tar.xz.sig
/clang-12.0.0rc4.src.tar.xz.sig
/clang-12.0.0rc5.src.tar.xz
/clang-tools-extra-12.0.0rc5.src.tar.xz
/clang-tools-extra-12.0.0rc5.src.tar.xz.sig
/clang-12.0.0rc5.src.tar.xz.sig
/clang-12.0.0.src.tar.xz
/clang-12.0.0.src.tar.xz.sig
/clang-tools-extra-12.0.0.src.tar.xz
/clang-tools-extra-12.0.0.src.tar.xz.sig
/clang-tools-extra-12.0.1rc1.src.tar.xz
/clang-tools-extra-12.0.1rc1.src.tar.xz.sig
/clang-12.0.1rc1.src.tar.xz
/clang-12.0.1rc1.src.tar.xz.sig
/clang-12.0.1rc3.src.tar.xz
/clang-12.0.1rc3.src.tar.xz.sig
/clang-tools-extra-12.0.1rc3.src.tar.xz
/clang-tools-extra-12.0.1rc3.src.tar.xz.sig
/clang-12.0.1.src.tar.xz
/clang-12.0.1.src.tar.xz.sig
/clang-tools-extra-12.0.1.src.tar.xz
/clang-tools-extra-12.0.1.src.tar.xz.sig
/clang-13.0.0rc1.src.tar.xz
/clang-13.0.0rc1.src.tar.xz.sig
/clang-tools-extra-13.0.0rc1.src.tar.xz
/clang-tools-extra-13.0.0rc1.src.tar.xz.sig
/clang-13.0.0rc3.src.tar.xz
/clang-13.0.0rc3.src.tar.xz.sig
/clang-tools-extra-13.0.0rc3.src.tar.xz
/clang-tools-extra-13.0.0rc3.src.tar.xz.sig
/clang-13.0.0rc4.src.tar.xz
/clang-tools-extra-13.0.0rc4.src.tar.xz.sig
/clang-tools-extra-13.0.0rc4.src.tar.xz
/clang-13.0.0rc4.src.tar.xz.sig
/clang-13.0.0.src.tar.xz
/clang-13.0.0.src.tar.xz.sig
/clang-tools-extra-13.0.0.src.tar.xz.sig
/clang-tools-extra-13.0.0.src.tar.xz
/clang-13.0.1rc1.src.tar.xz
/clang-13.0.1rc1.src.tar.xz.sig
/clang-tools-extra-13.0.1rc1.src.tar.xz
/clang-tools-extra-13.0.1rc1.src.tar.xz.sig
/clang-13.0.1rc2.src.tar.xz
/clang-13.0.1rc2.src.tar.xz.sig
/clang-tools-extra-13.0.1rc2.src.tar.xz
/clang-tools-extra-13.0.1rc2.src.tar.xz.sig
/clang-13.0.1rc3.src.tar.xz
/clang-13.0.1rc3.src.tar.xz.sig
/clang-tools-extra-13.0.1rc3.src.tar.xz
/clang-tools-extra-13.0.1rc3.src.tar.xz.sig
/clang-13.0.1.src.tar.xz
/clang-13.0.1.src.tar.xz.sig
/clang-tools-extra-13.0.1.src.tar.xz
/clang-tools-extra-13.0.1.src.tar.xz.sig
/clang-14.0.0.src.tar.xz
/clang-tools-extra-14.0.0.src.tar.xz
/clang-tools-extra-14.0.0.src.tar.xz.sig
/clang-14.0.0.src.tar.xz.sig
/clang-tools-extra-14.0.5.src.tar.xz
/clang-tools-extra-14.0.5.src.tar.xz.sig
/clang-14.0.5.src.tar.xz.sig
/clang-14.0.5.src.tar.xz
/clang-tools-extra-15.0.0.src.tar.xz
/clang-tools-extra-15.0.0.src.tar.xz.sig
/clang-15.0.0.src.tar.xz
/clang-15.0.0.src.tar.xz.sig
/clang-tools-extra-15.0.4.src.tar.xz
/clang-tools-extra-15.0.4.src.tar.xz.sig
/clang-15.0.4.src.tar.xz
/clang-15.0.4.src.tar.xz.sig
/clang-15.0.6.src.tar.xz
/clang-15.0.6.src.tar.xz.sig
/clang-tools-extra-15.0.6.src.tar.xz
/clang-tools-extra-15.0.6.src.tar.xz.sig
/clang-15.0.7.src.tar.xz
/clang-15.0.7.src.tar.xz.sig
/clang-tools-extra-15.0.7.src.tar.xz
/clang-tools-extra-15.0.7.src.tar.xz.sig
/*.src.rpm
/*.src.tar.xz
/*.src.tar.xz.sig
/cmake/
/results_clang/

View File

@ -1,29 +0,0 @@
From 537e325f180d3d82bbef64aac71efcb0256d6916 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Fri, 2 Sep 2022 16:30:15 +0200
Subject: [PATCH] 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 d921ea5d5da9..d883fd3a8f04 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4118,7 +4118,8 @@ defm openmp_implicit_rpath: BoolFOption<"openmp-implicit-rpath",
LangOpts<"OpenMP">,
DefaultTrue,
PosFlag<SetTrue, [], "Set rpath on OpenMP executables">,
- NegFlag<SetFalse>>;
+ NegFlag<SetFalse>,
+ BothFlags<[NoArgumentUnused]>>;
def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>,
Group<Link_Group>;
def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, FlangOption, NoXarchOption]>,
--
2.37.2

View File

@ -1,42 +0,0 @@
From c6b921c8d833546946b70a8c2640032fd7c62461 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
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

View File

@ -0,0 +1,26 @@
From 701750a896a08d5841a7bc0d187bcddaa6c0f616 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Date: Thu, 16 Mar 2023 17:22:24 -0300
Subject: [PATCH] [PowerPC][clang] Fix triple
Some Linux distributions use ppc64le instead of powerpc.
---
clang/test/CodeGenCoroutines/pr56329.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/CodeGenCoroutines/pr56329.cpp b/clang/test/CodeGenCoroutines/pr56329.cpp
index 31d4849af4e7..69e0f1d337cf 100644
--- a/clang/test/CodeGenCoroutines/pr56329.cpp
+++ b/clang/test/CodeGenCoroutines/pr56329.cpp
@@ -2,7 +2,7 @@
//
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %s -O3 -S -emit-llvm -o - | FileCheck %s
// This test is expected to fail on PowerPC.
-// XFAIL: target=powerpc{{.*}}
+// XFAIL: target={{(ppc|powerpc).*}}
#include "Inputs/coroutine.h"
--
2.39.2

View File

@ -1,45 +0,0 @@
From a85305a801c39720d7ec1c9441a88fef1ac19435 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Fri, 9 Sep 2022 10:17:01 +0200
Subject: [PATCH] Take into account Fedora Specific install dir for libunwind
---
clang/lib/Driver/ToolChains/CommonArgs.cpp | 8 +++++++-
clang/test/Driver/linux-ld.c | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 443725f..c1401a6 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1529,7 +1529,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D,
CmdArgs.push_back("-lgcc_s");
break;
}
- case ToolChain::UNW_CompilerRT:
+ case ToolChain::UNW_CompilerRT: {
+ SmallString<256> DefaultLibPath =
+ llvm::sys::path::parent_path(TC.getDriver().Dir);
+ llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
+ CmdArgs.push_back(
+ strdup(("-L" + DefaultLibPath + "/llvm-unwind").str().c_str()));
+ }
if (TC.getTriple().isOSAIX()) {
// AIX only has libunwind as a shared library. So do not pass
// anything in if -static is specified.
diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index e76b35d..dfb8eca 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -299,7 +299,7 @@
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-STATIC %s
// CHECK-CLANG-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-CLANG-ANDROID-STATIC: "--start-group" "{{[^"]*}}{{/|\\\\}}libclang_rt.builtins-aarch64-android.a" "-l:libunwind.a" "-lc" "--end-group"
+// CHECK-CLANG-ANDROID-STATIC: "--start-group" "{{[^"]*}}{{/|\\\\}}libclang_rt.builtins-aarch64-android.a" "-L{{[^"]*}}{{/|\\\\}}llvm-unwind" "-l:libunwind.a" "-lc" "--end-group"
//
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
--
1.8.3.1

View File

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

View File

@ -1,280 +0,0 @@
From efe3686d4a519b357cecb5aaf715f1e1b6f2d025 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 22 Nov 2022 14:38:54 +0200
Subject: [PATCH 1/2] [clang] [MinGW] Improve/extend the gcc/sysroot detection
logic
There are three functions that try to detect the right implicit
sysroot and libgcc directory setup to use
- One which looks for mingw sysroots located in
<clangbin>/../<sysrootname>
- One which looks for a mingw-targeting gcc executables in the PATH
- One which looks in the <gccroot>/lib/gcc directory to find the
right one to use, and the right specific triple used for arch
specific directories in the gcc/libstdc++ install
These have mostly tried to look for executables named
"<arch>-w64-mingw32-gcc" or "mingw32-gcc" or subdirectories
named "<arch>-w64-mingw32" or "mingw32".
In the case of findClangRelativeSysroot, it also has looked
for directories with the name of the actual triple. This
was added in deff7536278d355977171726124f83aa4bb95419,
with the intent of looking for a directory matching exactly
the user provided literal triple - however the triple here
is the normalized one, not the one provided by the user on
the command line.
Improve and unify this logic somewhat:
- Always first look for things based on the literal triple
provided by the user.
- Secondly look for things based on the normalized triple
(which usually ends up as e.g. x86_64-w64-windows-gnu),
accessed via the Triple which is passed to the constructor
- Then look for the common triple form <arch>-w64-mingw32
The literal triple provided by the user is available via
Driver::getTargetTriple(), but computeTargetTriple() may
change e.g. the architecture of it, so we need to
reapply the effective architecture on the literal triple
spelling from Driver::getTargetTriple().
Do this consistently for all of findGcc, findClangRelativeSysroot
and findGccLibDir (while keeping the existing plain "mingw32"
cases in findGcc and findGccLibDir too).
Fedora 37 started shipping mingw sysroots targeting UCRT,
in addition to the traditional msvcrt.dll, and these use
triples in the form <arch>-w64-mingw32ucrt - see
https://fedoraproject.org/wiki/Changes/F37MingwUCRT.
Thus, in addition to the existing default tested triples,
try looking for triples in the form <arch>-w64-mingw32ucrt,
to automatically find the UCRT sysroots on Fedora 37.
By explicitly setting a specific target on the Clang command
line, the user can be more explicit with which flavour is
to be preferred.
This should fix the main issue in
https://github.com/llvm/llvm-project/issues/59001.
Differential Revision: https://reviews.llvm.org/D138692
---
clang/lib/Driver/ToolChains/MinGW.cpp | 68 ++++++++++++++-----
clang/lib/Driver/ToolChains/MinGW.h | 2 +-
.../12.2.1/include-fixed/.keep | 0
.../sys-root/mingw/include/.keep | 0
.../sys-root/mingw/include/c++/backward/.keep | 0
.../include/c++/x86_64-w64-mingw32ucrt/.keep | 0
clang/test/Driver/mingw-sysroot.cpp | 13 ++++
clang/test/Driver/mingw.cpp | 4 ++
8 files changed, 68 insertions(+), 19 deletions(-)
create mode 100644 clang/test/Driver/Inputs/mingw_fedora_tree/usr/lib/gcc/x86_64-w64-mingw32ucrt/12.2.1/include-fixed/.keep
create mode 100644 clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/.keep
create mode 100644 clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/backward/.keep
create mode 100644 clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/x86_64-w64-mingw32ucrt/.keep
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index ae7c4c56bf9e..0ebacea6e87f 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -359,13 +359,26 @@ static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
return Ver.size();
}
-void toolchains::MinGW::findGccLibDir() {
- llvm::SmallVector<llvm::SmallString<32>, 2> SubdirNames;
+static llvm::Triple getLiteralTriple(const Driver &D, const llvm::Triple &T) {
+ llvm::Triple LiteralTriple(D.getTargetTriple());
+ // The arch portion of the triple may be overridden by -m32/-m64.
+ LiteralTriple.setArchName(T.getArchName());
+ return LiteralTriple;
+}
+
+void toolchains::MinGW::findGccLibDir(const llvm::Triple &LiteralTriple) {
+ llvm::SmallVector<llvm::SmallString<32>, 5> SubdirNames;
+ SubdirNames.emplace_back(LiteralTriple.str());
+ SubdirNames.emplace_back(getTriple().str());
SubdirNames.emplace_back(getTriple().getArchName());
- SubdirNames[0] += "-w64-mingw32";
+ SubdirNames.back() += "-w64-mingw32";
+ SubdirNames.emplace_back(getTriple().getArchName());
+ SubdirNames.back() += "-w64-mingw32ucrt";
SubdirNames.emplace_back("mingw32");
- if (SubdirName.empty())
- SubdirName = std::string(SubdirNames[0].str());
+ if (SubdirName.empty()) {
+ SubdirName = getTriple().getArchName();
+ SubdirName += "-w64-mingw32";
+ }
// lib: Arch Linux, Ubuntu, Windows
// lib64: openSUSE Linux
for (StringRef CandidateLib : {"lib", "lib64"}) {
@@ -380,10 +393,17 @@ void toolchains::MinGW::findGccLibDir() {
}
}
-static llvm::ErrorOr<std::string> findGcc(const llvm::Triple &T) {
- llvm::SmallVector<llvm::SmallString<32>, 2> Gccs;
+static llvm::ErrorOr<std::string> findGcc(const llvm::Triple &LiteralTriple,
+ const llvm::Triple &T) {
+ llvm::SmallVector<llvm::SmallString<32>, 5> Gccs;
+ Gccs.emplace_back(LiteralTriple.str());
+ Gccs.back() += "-gcc";
+ Gccs.emplace_back(T.str());
+ Gccs.back() += "-gcc";
Gccs.emplace_back(T.getArchName());
- Gccs[0] += "-w64-mingw32-gcc";
+ Gccs.back() += "-w64-mingw32-gcc";
+ Gccs.emplace_back(T.getArchName());
+ Gccs.back() += "-w64-mingw32ucrt-gcc";
Gccs.emplace_back("mingw32-gcc");
// Please do not add "gcc" here
for (StringRef CandidateGcc : Gccs)
@@ -393,12 +413,15 @@ static llvm::ErrorOr<std::string> findGcc(const llvm::Triple &T) {
}
static llvm::ErrorOr<std::string>
-findClangRelativeSysroot(const Driver &D, const llvm::Triple &T,
- std::string &SubdirName) {
- llvm::SmallVector<llvm::SmallString<32>, 2> Subdirs;
+findClangRelativeSysroot(const Driver &D, const llvm::Triple &LiteralTriple,
+ const llvm::Triple &T, std::string &SubdirName) {
+ llvm::SmallVector<llvm::SmallString<32>, 4> Subdirs;
+ Subdirs.emplace_back(LiteralTriple.str());
Subdirs.emplace_back(T.str());
Subdirs.emplace_back(T.getArchName());
- Subdirs[1] += "-w64-mingw32";
+ Subdirs.back() += "-w64-mingw32";
+ Subdirs.emplace_back(T.getArchName());
+ Subdirs.back() += "-w64-mingw32ucrt";
StringRef ClangRoot = llvm::sys::path::parent_path(D.getInstalledDir());
StringRef Sep = llvm::sys::path::get_separator();
for (StringRef CandidateSubdir : Subdirs) {
@@ -418,14 +441,16 @@ toolchains::MinGW::MinGW(const Driver &D, const llvm::Triple &Triple,
// The sequence for detecting a sysroot here should be kept in sync with
// the testTriple function below.
+ llvm::Triple LiteralTriple = getLiteralTriple(D, getTriple());
if (getDriver().SysRoot.size())
Base = getDriver().SysRoot;
// Look for <clang-bin>/../<triplet>; if found, use <clang-bin>/.. as the
// base as it could still be a base for a gcc setup with libgcc.
- else if (llvm::ErrorOr<std::string> TargetSubdir =
- findClangRelativeSysroot(getDriver(), getTriple(), SubdirName))
+ else if (llvm::ErrorOr<std::string> TargetSubdir = findClangRelativeSysroot(
+ getDriver(), LiteralTriple, getTriple(), SubdirName))
Base = std::string(llvm::sys::path::parent_path(TargetSubdir.get()));
- else if (llvm::ErrorOr<std::string> GPPName = findGcc(getTriple()))
+ else if (llvm::ErrorOr<std::string> GPPName =
+ findGcc(LiteralTriple, getTriple()))
Base = std::string(llvm::sys::path::parent_path(
llvm::sys::path::parent_path(GPPName.get())));
else
@@ -433,7 +458,7 @@ toolchains::MinGW::MinGW(const Driver &D, const llvm::Triple &Triple,
llvm::sys::path::parent_path(getDriver().getInstalledDir()));
Base += llvm::sys::path::get_separator();
- findGccLibDir();
+ findGccLibDir(LiteralTriple);
// GccLibDir must precede Base/lib so that the
// correct crtbegin.o ,cetend.o would be found.
getFilePaths().push_back(GccLibDir);
@@ -576,6 +601,12 @@ void toolchains::MinGW::printVerboseInfo(raw_ostream &OS) const {
// /usr/include/c++/4.8/backward
// /usr/x86_64-w64-mingw32/include
+// Fedora
+// /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/x86_64-w64-mingw32ucrt
+// /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/backward
+// /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include
+// /usr/lib/gcc/x86_64-w64-mingw32ucrt/12.2.1/include-fixed
+
void toolchains::MinGW::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
if (DriverArgs.hasArg(options::OPT_nostdinc))
@@ -667,10 +698,11 @@ static bool testTriple(const Driver &D, const llvm::Triple &Triple,
std::string SubdirName;
if (D.SysRoot.size())
return true;
+ llvm::Triple LiteralTriple = getLiteralTriple(D, Triple);
if (llvm::ErrorOr<std::string> TargetSubdir =
- findClangRelativeSysroot(D, Triple, SubdirName))
+ findClangRelativeSysroot(D, LiteralTriple, Triple, SubdirName))
return true;
- if (llvm::ErrorOr<std::string> GPPName = findGcc(Triple))
+ if (llvm::ErrorOr<std::string> GPPName = findGcc(LiteralTriple, Triple))
return true;
// If we neither found a colocated sysroot or a matching gcc executable,
// conclude that we can't know if this is the correct spelling of the triple.
diff --git a/clang/lib/Driver/ToolChains/MinGW.h b/clang/lib/Driver/ToolChains/MinGW.h
index f15f99dc8a8c..bc17d273e776 100644
--- a/clang/lib/Driver/ToolChains/MinGW.h
+++ b/clang/lib/Driver/ToolChains/MinGW.h
@@ -108,7 +108,7 @@ private:
std::string SubdirName;
mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;
mutable std::unique_ptr<tools::gcc::Compiler> Compiler;
- void findGccLibDir();
+ void findGccLibDir(const llvm::Triple &LiteralTriple);
bool NativeLLVMSupport;
};
diff --git a/clang/test/Driver/Inputs/mingw_fedora_tree/usr/lib/gcc/x86_64-w64-mingw32ucrt/12.2.1/include-fixed/.keep b/clang/test/Driver/Inputs/mingw_fedora_tree/usr/lib/gcc/x86_64-w64-mingw32ucrt/12.2.1/include-fixed/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/.keep b/clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/backward/.keep b/clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/backward/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/x86_64-w64-mingw32ucrt/.keep b/clang/test/Driver/Inputs/mingw_fedora_tree/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/x86_64-w64-mingw32ucrt/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/clang/test/Driver/mingw-sysroot.cpp b/clang/test/Driver/mingw-sysroot.cpp
index 1cb51b3aea2d..985be9e5f2ac 100644
--- a/clang/test/Driver/mingw-sysroot.cpp
+++ b/clang/test/Driver/mingw-sysroot.cpp
@@ -14,6 +14,11 @@
// RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/x86_64-w64-mingw32 %T/testroot-clang/x86_64-w64-mingw32
// RUN: ln -s %S/Inputs/mingw_arch_tree/usr/i686-w64-mingw32 %T/testroot-clang/i686-w64-mingw32
+// RUN: rm -rf %T/testroot-custom-triple
+// RUN: mkdir -p %T/testroot-custom-triple/bin
+// RUN: ln -s %clang %T/testroot-custom-triple/bin/x86_64-w64-mingw32foo-clang
+// RUN: ln -s %clang %T/testroot-custom-triple/bin/clang
+// RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/x86_64-w64-mingw32 %T/testroot-custom-triple/x86_64-w64-mingw32foo
// If we find a gcc in the path with the right triplet prefix, pick that as
// sysroot:
@@ -51,3 +56,11 @@
// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %T/testroot-clang/bin/x86_64-w64-mingw32-clang --target=x86_64-w64-mingw32 -m32 -rtlib=compiler-rt -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_CLANG_I686 %s
// CHECK_TESTROOT_CLANG_I686: "{{[^"]+}}/testroot-clang{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include"
+
+
+// If the user calls clang with a custom literal triple, make sure this maps
+// to sysroots with the matching spelling.
+
+// RUN: %T/testroot-custom-triple/bin/x86_64-w64-mingw32foo-clang -rtlib=compiler-rt -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_CUSTOM_TRIPLE %s
+// RUN: %T/testroot-custom-triple/bin/clang --target=x86_64-w64-mingw32foo -rtlib=compiler-rt -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_CUSTOM_TRIPLE %s
+// CHECK_TESTROOT_CUSTOM_TRIPLE: "{{[^"]+}}/testroot-custom-triple{{/|\\\\}}x86_64-w64-mingw32foo{{/|\\\\}}include"
diff --git a/clang/test/Driver/mingw.cpp b/clang/test/Driver/mingw.cpp
index b37503e475d8..bde952fb3565 100644
--- a/clang/test/Driver/mingw.cpp
+++ b/clang/test/Driver/mingw.cpp
@@ -39,6 +39,10 @@
// CHECK_MINGW_OPENSUSE_TREE: "[[BASE]]/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}x86_64-w64-mingw32/sys-root/mingw/include"
+// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_fedora_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_FEDORA_TREE %s
+// CHECK_MINGW_FEDORA_TREE: "[[BASE:[^"]+]]/Inputs/mingw_fedora_tree/usr{{/|\\\\}}x86_64-w64-mingw32ucrt/sys-root/mingw/include"
+
+
// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s
// CHECK_MINGW_ARCH_TREE: "[[BASE:[^"]+]]/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0"
// CHECK_MINGW_ARCH_TREE: "[[BASE]]/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}i686-w64-mingw32"
--
2.38.1

View File

@ -58,13 +58,16 @@ diff --git a/clang-tools-extra/test/lit.cfg.py b/clang-tools-extra/test/lit.cfg.
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(
@@ -59,6 +59,9 @@ 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")
# It is not realistically possible to account for all options that could
# possibly be present in system and user configuration files, so disable
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

View File

@ -1,139 +0,0 @@
From d3b79c2950d590cb272648f1c6a9dd7646f57beb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 22 Nov 2022 14:39:39 +0200
Subject: [PATCH 2/2] [clang] [MinGW] Improve detection of libstdc++ headers on
Fedora
There's some variation in where different toolchain distributions
(and linux distributions) package the mingw sysroots - this is
so far handled by adding specific known subdirectory paths
to the include and lib directory lists.
There are multiple degrees of combinatorics involved here though;
the distros may use different locations such as
/usr/x86_64-w64-mingw32/include or
/usr/x86_64-w64-mingw32/sys-root/mingw/include.
So far, this setup has been treated as base=/usr, subdir=x86_64-w64-mingw32,
and the driver tries to add further subdirectories such as
<base>/<subdir>/include, <base>/<subdir>/sys-root/mingw/include.
When it comes to libstdc++ (and libc++), each of these come with
a large number of potential subdirectories. Instead of further
exploding the combinatorics another step by adding all combinations
of all paths, check whether <base>/<subdir>/sys-root/mingw/include
exists, and if it does, append that subpath into the subdir variable.
This allows finding libstdc++ headers in e.g.
/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/x86_64-w64-mingw32
on Fedora.
The same logic (where everything belonging to this target fits
under one expanded <subdir> path, with just /include and /lib
under it) doesn't seem to apply on Gentoo, where the includes
are found in <base>/<subdir>/usr/include while the libraries
are in <base>/<subdir>/mingw/lib (see
8e218026f8d5eabfdef9141ae5e26aa91d1933e6). But apparently
the libstdc++ headers aren't installed under
<base>/<subdir>/usr/include, so that path hierarchy quirk doesn't
need to be taken into account in AddClangCXXStdlibIncludeArgs.
Differential Revision: https://reviews.llvm.org/D138693
---
clang/lib/Driver/ToolChains/MinGW.cpp | 19 +++++++++----------
clang/lib/Driver/ToolChains/MinGW.h | 1 +
clang/test/Driver/mingw.cpp | 5 ++++-
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 0ebacea6e87f..2a9bf4b18f19 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -376,7 +376,7 @@ void toolchains::MinGW::findGccLibDir(const llvm::Triple &LiteralTriple) {
SubdirNames.back() += "-w64-mingw32ucrt";
SubdirNames.emplace_back("mingw32");
if (SubdirName.empty()) {
- SubdirName = getTriple().getArchName();
+ SubdirName = getTriple().getArchName().str();
SubdirName += "-w64-mingw32";
}
// lib: Arch Linux, Ubuntu, Windows
@@ -459,9 +459,16 @@ toolchains::MinGW::MinGW(const Driver &D, const llvm::Triple &Triple,
Base += llvm::sys::path::get_separator();
findGccLibDir(LiteralTriple);
+ TripleDirName = SubdirName;
// GccLibDir must precede Base/lib so that the
// correct crtbegin.o ,cetend.o would be found.
getFilePaths().push_back(GccLibDir);
+
+ // openSUSE/Fedora
+ std::string CandidateSubdir = SubdirName + "/sys-root/mingw";
+ if (getDriver().getVFS().exists(Base + CandidateSubdir))
+ SubdirName = CandidateSubdir;
+
getFilePaths().push_back(
(Base + SubdirName + llvm::sys::path::get_separator() + "lib").str());
@@ -470,8 +477,6 @@ toolchains::MinGW::MinGW(const Driver &D, const llvm::Triple &Triple,
(Base + SubdirName + llvm::sys::path::get_separator() + "mingw/lib").str());
getFilePaths().push_back(Base + "lib");
- // openSUSE
- getFilePaths().push_back(Base + SubdirName + "/sys-root/mingw/lib");
NativeLLVMSupport =
Args.getLastArgValue(options::OPT_fuse_ld_EQ, CLANG_DEFAULT_LINKER)
@@ -621,12 +626,6 @@ void toolchains::MinGW::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
if (DriverArgs.hasArg(options::OPT_nostdlibinc))
return;
- if (GetRuntimeLibType(DriverArgs) == ToolChain::RLT_Libgcc) {
- // openSUSE
- addSystemInclude(DriverArgs, CC1Args,
- Base + SubdirName + "/sys-root/mingw/include");
- }
-
addSystemInclude(DriverArgs, CC1Args,
Base + SubdirName + llvm::sys::path::get_separator() +
"include");
@@ -684,7 +683,7 @@ void toolchains::MinGW::AddClangCXXStdlibIncludeArgs(
for (auto &CppIncludeBase : CppIncludeBases) {
addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
CppIncludeBase += Slash;
- addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + SubdirName);
+ addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + TripleDirName);
addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + "backward");
}
break;
diff --git a/clang/lib/Driver/ToolChains/MinGW.h b/clang/lib/Driver/ToolChains/MinGW.h
index bc17d273e776..ef9bfb29e175 100644
--- a/clang/lib/Driver/ToolChains/MinGW.h
+++ b/clang/lib/Driver/ToolChains/MinGW.h
@@ -106,6 +106,7 @@ private:
clang::driver::toolchains::Generic_GCC::GCCVersion GccVer;
std::string Ver;
std::string SubdirName;
+ std::string TripleDirName;
mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;
mutable std::unique_ptr<tools::gcc::Compiler> Compiler;
void findGccLibDir(const llvm::Triple &LiteralTriple);
diff --git a/clang/test/Driver/mingw.cpp b/clang/test/Driver/mingw.cpp
index bde952fb3565..46ea55b9500d 100644
--- a/clang/test/Driver/mingw.cpp
+++ b/clang/test/Driver/mingw.cpp
@@ -40,7 +40,10 @@
// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_fedora_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_FEDORA_TREE %s
-// CHECK_MINGW_FEDORA_TREE: "[[BASE:[^"]+]]/Inputs/mingw_fedora_tree/usr{{/|\\\\}}x86_64-w64-mingw32ucrt/sys-root/mingw/include"
+// CHECK_MINGW_FEDORA_TREE: "[[BASE:[^"]+]]/Inputs/mingw_fedora_tree/usr{{/|\\\\}}x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++"
+// CHECK_MINGW_FEDORA_TREE: "[[BASE]]/Inputs/mingw_fedora_tree/usr{{/|\\\\}}x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/x86_64-w64-mingw32ucrt"
+// CHECK_MINGW_FEDORA_TREE: "[[BASE]]/Inputs/mingw_fedora_tree/usr{{/|\\\\}}x86_64-w64-mingw32ucrt/sys-root/mingw/include/c++/backward"
+// CHECK_MINGW_FEDORA_TREE: "[[BASE]]/Inputs/mingw_fedora_tree/usr{{/|\\\\}}x86_64-w64-mingw32ucrt/sys-root/mingw/include"
// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s
--
2.38.1

View File

@ -1,18 +1,17 @@
From c87abee7356b8fde81512ffceadd520776c465d2 Mon Sep 17 00:00:00 2001
From d95d3fbff661c0390072ed0bb4544d5e2aae5c9a Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:09:29 +0100
Subject: [PATCH] [PATCH][clang] Make -funwind-tables the default on all archs
Subject: [PATCH] Make -funwind-tables the default on all archs
---
clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++
1 file changed, 6 insertions(+)
clang/lib/Driver/ToolChains/Gnu.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp
b/clang/lib/Driver/ToolChains/Gnu.cpp
index d0808d061c82..de9c9743cd38 100644
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index c8006f3d8412..6ed03adb7702 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 {
@@ -2863,6 +2863,11 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const {
case llvm::Triple::ppc64le:
case llvm::Triple::x86:
case llvm::Triple::x86_64:
@ -21,9 +20,9 @@ index d0808d061c82..de9c9743cd38 100644
+ // rhbz#1655546
+ case llvm::Triple::systemz:
+ case llvm::Triple::arm:
return true;
return UnwindTableLevel::Asynchronous;
default:
return false;
return UnwindTableLevel::None;
--
2.27.0
2.39.1

View File

@ -1,6 +1,6 @@
From 1f68d73910ddee1beaf3582480b8a9738c941a43 Mon Sep 17 00:00:00 2001
From 4ea62faaaac1aad0fe496cabe9674c809c91c49a Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine@redhat.com>
Date: Thu, 24 Mar 2022 09:44:21 +0100
Date: Mon, 13 Feb 2023 17:11:00 -0300
Subject: [PATCH] Produce DWARF4 by default
Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream:
@ -9,18 +9,19 @@ https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8
---
clang/include/clang/Driver/ToolChain.h | 2 +-
clang/test/CodeGen/dwarf-version.c | 4 ++--
clang/test/Driver/as-options.s | 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(-)
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h
index f20ab164531b..53c86ee82936 100644
index f75f35dc9e65..a70ae2b17833 100644
--- a/clang/include/clang/Driver/ToolChain.h
+++ b/clang/include/clang/Driver/ToolChain.h
@@ -535,7 +535,7 @@ public:
@@ -547,7 +547,7 @@ public:
// Return the DWARF version to emit, in the absence of arguments
// to the contrary.
- virtual unsigned GetDefaultDwarfVersion() const { return 5; }
@ -43,19 +44,41 @@ index 0a6fa4768026..96f01749d0d8 100644
// 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/as-options.s b/clang/test/Driver/as-options.s
index 73d002c7ef7e..71d55f7fd537 100644
--- a/clang/test/Driver/as-options.s
+++ b/clang/test/Driver/as-options.s
@@ -122,7 +122,7 @@
// RUN: FileCheck --check-prefix=DEBUG %s
// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g0 -g %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=DEBUG %s
-// DEBUG: "-g" "-gdwarf-5"
+// DEBUG: "-g" "-gdwarf-4"
// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g -g0 %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=NODEBUG %s
// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 -g0 %s -### 2>&1 | \
@@ -141,7 +141,7 @@
// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-2 %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=GDWARF2 %s
// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf %s -### 2>&1 | \
-// RUN: FileCheck --check-prefix=GDWARF5 %s
+// RUN: FileCheck --check-prefix=GDWARF4 %s
// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=GDWARF5 %s
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index a2e350a0a835..01889ba0bf9b 100644
index 1d588bdfc1b0..1ad57aedc3a4 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -570,7 +570,7 @@
@@ -575,7 +575,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
// RUN: %clang_cl /ZH:MD5 /c -### -- %s 2>&1 | FileCheck -check-prefix=ZH_MD5 %s
// ZH_MD5: "-gsrc-hash=md5"
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
@ -96,5 +119,5 @@ index 5a33d5eceb61..cedf895b36dc 100644
///-----------------------------------------------------------------------------
/// Checking include-path
--
2.37.1
2.39.1

53
D138472.diff Normal file
View File

@ -0,0 +1,53 @@
From 04b642c646048dd9df652eba05d45beaa13bc895 Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine@redhat.com>
Date: Mon, 23 Jan 2023 13:14:17 +0000
Subject: [PATCH] Rebased D138472
---
clang/CMakeLists.txt | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 090cfa352078..f87838776c32 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -118,12 +118,11 @@ if(CLANG_BUILT_STANDALONE)
set(LLVM_UTILS_PROVIDED ON)
set(CLANG_TEST_DEPS FileCheck count not)
endif()
- set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/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} third-party/unittest)
- endif()
+ endif()
+
+ find_package(LLVMGTest HINTS "${LLVM_CMAKE_DIR}")
+ if (NOT TARGET llvm_gtest)
+ message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
endif()
if(LLVM_LIT)
@@ -506,13 +505,11 @@ endif()
if( CLANG_INCLUDE_TESTS )
- if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
- add_subdirectory(unittests)
- list(APPEND CLANG_TEST_DEPS ClangUnitTests)
- list(APPEND CLANG_TEST_PARAMS
- clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
- )
- endif()
+ add_subdirectory(unittests)
+ list(APPEND CLANG_TEST_DEPS ClangUnitTests)
+ list(APPEND CLANG_TEST_PARAMS
+ clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
+ )
add_subdirectory(test)
add_subdirectory(bindings/python/tests)
--
2.34.3

25
D141581.diff Normal file
View File

@ -0,0 +1,25 @@
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -110,7 +110,7 @@
DEPENDS
omp_gen
- RISCVTargetParserTableGen
+ LLVMTargetParser
)
target_link_libraries(clangBasic
diff --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
--- a/clang/lib/Driver/CMakeLists.txt
+++ b/clang/lib/Driver/CMakeLists.txt
@@ -93,7 +93,7 @@
DEPENDS
ClangDriverOptions
- RISCVTargetParserTableGen
+ LLVMTargetParser
LINK_LIBS
clangBasic

View File

@ -7,10 +7,10 @@
%bcond_with compat_build
%bcond_without check
%global maj_ver 15
%global maj_ver 16
%global min_ver 0
%global patch_ver 7
#global rc_ver 3
%global patch_ver 1
#global rc_ver 4
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
%if %{with compat_build}
@ -37,11 +37,12 @@
%endif
%global clang_srcdir clang-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
%global cmake_srcdir cmake-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
%global clang_tools_srcdir clang-tools-extra-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
Name: %pkg_name
Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}}
Release: 3.0.riscv64%{?dist}
Release: 1.0.riscv64%{?dist}
Summary: A C language family front-end for LLVM
License: Apache-2.0 WITH LLVM-exception OR NCSA
@ -52,28 +53,30 @@ Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_
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: release-keys.asc
Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig
Source6: release-keys.asc
%if %{without compat_build}
Source5: macros.%{name}
Source7: macros.%{name}
%endif
# Patches for clang
Patch0: 0001-PATCH-clang-Reorganize-gtest-integration.patch
Patch1: 0003-PATCH-Make-funwind-tables-the-default-on-all-archs.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
# Drop the following patch after debugedit adds support to DWARF-5:
# https://sourceware.org/bugzilla/show_bug.cgi?id=28728
Patch5: 0010-PATCH-clang-Produce-DWARF4-by-default.patch
Patch6: 0001-Take-into-account-Fedora-Specific-install-dir-for-li.patch
# Fix a test based on the triple used on RHEL-based systems.
Patch6: 0001-PowerPC-clang-Fix-triple.patch
# Make clangBasic and clangDriver depend on LLVMTargetParser
# See https://reviews.llvm.org/D141581
Patch7: D141581.diff
# clang/cmake: Use installed gtest libraries for stand-alone builds
# See https://reviews.llvm.org/D138472
Patch8: D138472.diff
# TODO: Can be dropped in LLVM 16: https://reviews.llvm.org/D133316
Patch7: 0001-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch
# TODO: Can be dropped in LLVM 16: https://reviews.llvm.org/D134362
Patch8: 0001-clang-Fix-interaction-between-asm-labels-and-inline-.patch
# TODO: Can be dropped in LLVM 16.
Patch9: 0001-clang-MinGW-Improve-extend-the-gcc-sysroot-detection.patch
Patch10: 0002-clang-MinGW-Improve-detection-of-libstdc-headers-on-.patch
Patch10: fix-ieee128-cross.diff
Patch20: 0001-Bring-back-riscv64-redhat-linux-triplet.patch
@ -259,13 +262,19 @@ Requires: python3
%prep
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE4}'
%setup -T -q -b 4 -n %{cmake_srcdir}
# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir},
# but this is not a CACHED variable, so we can't actually set it externally :(
cd ..
mv %{cmake_srcdir} cmake
%if %{with compat_build}
%autosetup -n %{clang_srcdir} -p2
%else
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE1}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE2}' --data='%{SOURCE1}'
%setup -T -q -b 1 -n %{clang_tools_srcdir}
%autopatch -m200 -p2
@ -337,9 +346,9 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
%endif
%if %{with compat_build}
-DCLANG_BUILD_TOOLS:BOOL=OFF \
-DLLVM_CMAKE_DIR=%{install_libdir}/cmake/llvm \
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
-DCLANG_INCLUDE_TESTS:BOOL=OFF \
-DLLVM_CMAKE_DIR=%{install_libdir}/cmake/llvm \
%else
-DCLANG_INCLUDE_TESTS:BOOL=ON \
-DLLVM_BUILD_UTILS:BOOL=ON \
@ -399,7 +408,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 %{SOURCE5} %{buildroot}%{_rpmmacrodir}/macros.%{name}
install -p -m0644 -D %{SOURCE7} %{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}|" \
@ -411,7 +420,7 @@ 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}
mv %{buildroot}%{_prefix}/%{_lib}/{libear,libscanbuild} %{buildroot}%{python3_sitelib}
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/{libear,libscanbuild}
# Fix permissions of scan-view scripts
@ -450,20 +459,11 @@ ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver}
# Fix permission
chmod u-x %{buildroot}%{_mandir}/man1/scan-build.1*
# create a link to clang's resource directory that is "constant" across minor
# version bumps
# this is required for packages like ccls that hardcode the link to clang's
# resource directory to not require rebuilds on minor version bumps
# Fix for bugs like rhbz#1807574
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}%{pkg_libdir}/clang/%{version}/{include,lib,share}/
mkdir -p %{buildroot}%{pkg_libdir}/clang/%{maj_ver}/{include,lib,share}/
%if %{without compat_build}
@ -507,11 +507,11 @@ false
%files libs
%if %{without compat_build}
%{_libdir}/clang/%{version}/include/*
%{_libdir}/clang/%{maj_ver}/include/*
%{_libdir}/*.so.*
%else
%{pkg_libdir}/*.so.*
%{pkg_libdir}/clang/%{version}/include/*
%{pkg_libdir}/clang/%{maj_ver}/include/*
%endif
%files devel
@ -532,13 +532,10 @@ false
%files resource-filesystem
%dir %{pkg_libdir}/clang/
%dir %{pkg_libdir}/clang/%{version}/
%dir %{pkg_libdir}/clang/%{version}/include/
%dir %{pkg_libdir}/clang/%{version}/lib/
%dir %{pkg_libdir}/clang/%{version}/share/
%if %{without compat_build}
%{pkg_libdir}/clang/%{maj_ver}
%endif
%dir %{pkg_libdir}/clang/%{maj_ver}/
%dir %{pkg_libdir}/clang/%{maj_ver}/include/
%dir %{pkg_libdir}/clang/%{maj_ver}/lib/
%dir %{pkg_libdir}/clang/%{maj_ver}/share/
%if %{without compat_build}
%files analyzer
@ -561,19 +558,19 @@ false
%files tools-extra
%{_bindir}/amdgpu-arch
%{_bindir}/clang-apply-replacements
%{_bindir}/clang-change-namespace
%{_bindir}/clang-check
%{_bindir}/clang-doc
%{_bindir}/clang-extdef-mapping
%{_bindir}/clang-format
%{_bindir}/clang-include-cleaner
%{_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
@ -585,6 +582,7 @@ false
%{_bindir}/clangd
%{_bindir}/diagtool
%{_bindir}/hmaptool
%{_bindir}/nvptx-arch
%{_bindir}/pp-trace
%{_bindir}/c-index-test
%{_bindir}/find-all-symbols
@ -614,11 +612,35 @@ false
%endif
%changelog
* Fri Mar 31 2023 David Abdurachmanov <davidlt@rivosinc.com> - 15.0.7-3.0.riscv64
* Mon Apr 24 2023 David Abdurachmanov <davidlt@rivosinc.com> - 16.0.1-1.0.riscv64
- Ignore test suite failures on riscv64 for now
- Prepare for riscv64
- Add riscv64-redhat-linux triplet
* Wed Apr 12 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.1-1
- Update to LLVM 16.0.1
* Wed Apr 12 2023 Timm Bäder <tbaeder@redhat.com> - 16.0.0-3
- Use correct source for clang.macros file
* Thu Mar 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0-2
- Remove unnecessary patch and macro
* Mon Mar 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0-1
- Update to LLVM 16.0.0
* Thu Mar 16 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc4-2
- Fix tests with the right triple
* Tue Mar 14 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc4-1
- Update to LLVM 16.0.0 RC4
* Tue Mar 14 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc3-2
- Fix RPM macro clang_resource_dir
* Thu Feb 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc3-1
- Update to LLVM 16.0.0 RC3
* Thu Jan 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 15.0.7-3
- Update license to SPDX identifiers.
- Include the Apache license adopted in 2019.

16
fix-ieee128-cross.diff Normal file
View File

@ -0,0 +1,16 @@
diff --git a/clang/test/Driver/ppc-float-abi-warning.cpp b/clang/test/Driver/ppc-float-abi-warning.cpp
index e3baa9f4c059..87d6d87a3b31 100644
--- a/clang/test/Driver/ppc-float-abi-warning.cpp
+++ b/clang/test/Driver/ppc-float-abi-warning.cpp
@@ -17,10 +17,12 @@
// RUN: -mabi=ieeelongdouble -stdlib=libc++ -Wno-unsupported-abi 2>&1 | \
// RUN: FileCheck %s --check-prefix=NOWARN
// RUN: %clang -### --driver-mode=g++ -target powerpc64le-linux-gnu %s\
+// RUN: --dyld-prefix=%S/Inputs/powerpc64le-linux-gnu-tree/gcc-12 \
// RUN: -mabi=%if ppc_linux_default_ieeelongdouble %{ieeelongdouble%} \
// RUN: %else %{ibmlongdouble%} -stdlib=libc++ 2>&1 | \
// RUN: FileCheck %s --check-prefix=NOWARN
// RUN: %clang -### --driver-mode=g++ -target powerpc64le-linux-gnu %s\
+// RUN: --dyld-prefix=%S/Inputs/powerpc64le-linux-gnu-tree/gcc-12 \
// RUN: -mabi=%if ppc_linux_default_ieeelongdouble %{ibmlongdouble%} \
// RUN: %else %{ieeelongdouble%} -stdlib=libc++ 2>&1 | FileCheck %s

View File

@ -1,52 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
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
67H2IH//2sf8dw==
=ADVe
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -8,7 +8,7 @@
# 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}
%clang_resource_dir %{_libdir}/clang/%{clang_major_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.

10
sources
View File

@ -1,4 +1,6 @@
SHA512 (clang-15.0.7.src.tar.xz) = 9fd2736a9f5993ddbb5b3c507fe497234a6def64f6f418f379d1ca56c9c361ad1ae9a5445ab938230fbc1671ec00b4f802a412b048569023863c20dc6bb46a1f
SHA512 (clang-15.0.7.src.tar.xz.sig) = e1b41c5a6509c3554794bfa1b8d048f13268bc2234d7480f04f7700e27bd9d53e40bc1433885716a64da57458f3041c42a66639045476daefffc3f5d2e3d6efd
SHA512 (clang-tools-extra-15.0.7.src.tar.xz) = dd95d261d3a1618967b698e97ac0b41204d872d7479c0c832fcf5a91fe447af6a97fa794de07b3e271285867b30b905688f090e98f516b9df4cdfb3bad9defc6
SHA512 (clang-tools-extra-15.0.7.src.tar.xz.sig) = 10887b80d453d1ec826afbf5cfd937d5b671ed73f54691072b2b097da21f9358b8d6372df79200dc0694cbbc40b816c4139690b4e7033ba03a8a9b92611ee4ce
SHA512 (clang-16.0.1.src.tar.xz) = c7ef4c386471850f30e194d0a8afe95fdd366c9182b1cdd7653342dcbf72a2b90970c0c4cc900314a26ba131163adec234eec00816207266fbe9c2259d01b61a
SHA512 (clang-16.0.1.src.tar.xz.sig) = 31756b55641debde8e075819a3705c9fbf9a3e39d0f5da5a0e8421bd96eb19972ced6f22df0f66f918d48375089c06b5e499f0627dc81d22956421d9791e088e
SHA512 (clang-tools-extra-16.0.1.src.tar.xz) = eb3a5656526db559fa331e4020305b6070a33e9c4e7a082f0ebe2b307ac43d542c989585e99c660fc749041774ff80dbad089678456318b40415e340654424c8
SHA512 (clang-tools-extra-16.0.1.src.tar.xz.sig) = c661a454ddc27aa12fd82aa19f49e26982147519bb108580059042302dc010b351d99fef65dc51c854a3d06a89a9200ee22dd613a1777bcf35b5236fa75ba2af
SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
SHA512 (cmake-16.0.1.src.tar.xz.sig) = 8d49050e9b04df253a5bb2fa3b27796f204d085610432826bef6bb6cab876990d67e7fd5267fc89fadf21d88da73c535c82ae6ea0e1c867f7cd5efac244b0fa2

View File

@ -1,34 +0,0 @@
summary: PoCL clang tests for build/PR gating
adjust:
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
when: >-
trigger is defined
and trigger != commit
and trigger != build
enabled: false
- because: "PoCL is shipped with Fedora, not RHEL/CentOS"
when: >-
distro == rhel
or distro == centos
enabled: false
discover:
how: fmf
test: pocl
url: https://src.fedoraproject.org/tests/clang.git
ref: main
execute:
how: tmt
prepare:
# Programs linked against pocl should be able to run without clang installed,
# so when we run the test we want to make sure clang is not installed to
# verify we haven't introduced an implicit dependency on clang.
- name: Drop clang
how: shell
script: |
dnf erase -y clang
provision:
hardware:
memory: ">= 4 GiB"