diff --git a/0001-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch b/0001-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch deleted file mode 100644 index 87c9b931c2e7623911047bc471c5388ecf14ab15..0000000000000000000000000000000000000000 --- a/0001-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 537e325f180d3d82bbef64aac71efcb0256d6916 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -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, -- NegFlag>; -+ NegFlag, -+ BothFlags<[NoArgumentUnused]>>; - def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>, - Group; - def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, FlangOption, NoXarchOption]>, --- -2.37.2 - diff --git a/0001-PATCH-clang-Reorganize-gtest-integration.patch b/0001-PATCH-clang-Reorganize-gtest-integration.patch deleted file mode 100644 index e854f0163fab91f0d755a07697e0265c6b79bf8a..0000000000000000000000000000000000000000 --- a/0001-PATCH-clang-Reorganize-gtest-integration.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c6b921c8d833546946b70a8c2640032fd7c62461 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Thu, 25 Feb 2021 14:04:52 +0100 -Subject: [PATCH 1/6] [PATCH][clang] Reorganize gtest integration - ---- - clang/CMakeLists.txt | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - -diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt -index 9e74014..0185276 100644 ---- a/clang/CMakeLists.txt -+++ b/clang/CMakeLists.txt -@@ -153,12 +153,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - set(LLVM_UTILS_PROVIDED ON) - set(CLANG_TEST_DEPS FileCheck count not) - endif() -- set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) -- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h -- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} -- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) -- add_subdirectory(${UNITTEST_DIR} utils/unittest) -- endif() - else() - # Seek installed Lit. - find_program(LLVM_LIT -@@ -537,7 +531,11 @@ endif() - - - if( CLANG_INCLUDE_TESTS ) -- if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h) -+ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) -+ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h -+ AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} -+ AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) -+ add_subdirectory(${UNITTEST_DIR} utils/unittest) - add_subdirectory(unittests) - list(APPEND CLANG_TEST_DEPS ClangUnitTests) - list(APPEND CLANG_TEST_PARAMS --- -1.8.3.1 - diff --git a/0001-Take-into-account-Fedora-Specific-install-dir-for-li.patch b/0001-Take-into-account-Fedora-Specific-install-dir-for-li.patch deleted file mode 100644 index 4a8fda9693b8cbdcfd2e41ec6acaba1de74feccc..0000000000000000000000000000000000000000 --- a/0001-Take-into-account-Fedora-Specific-install-dir-for-li.patch +++ /dev/null @@ -1,45 +0,0 @@ -From a85305a801c39720d7ec1c9441a88fef1ac19435 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -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 - diff --git a/0001-clang-Fix-interaction-between-asm-labels-and-inline-.patch b/0001-clang-Fix-interaction-between-asm-labels-and-inline-.patch deleted file mode 100644 index 948d1642a0ba4b8af0b3c251bc9e5f52833b3532..0000000000000000000000000000000000000000 --- a/0001-clang-Fix-interaction-between-asm-labels-and-inline-.patch +++ /dev/null @@ -1,74 +0,0 @@ -From bc9aa904bf9d24e7f39a2a866ff6b463858b6ccb Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Wed, 21 Sep 2022 16:08:45 +0200 -Subject: [PATCH] [clang] Fix interaction between asm labels and inline - builtins - -One must pick the same name as the one referenced in CodeGenFunction when -generating .inline version of an inline builtin, otherwise they are not -correctly replaced. - -Differential Revision: https://reviews.llvm.org/D134362 ---- - clang/lib/CodeGen/CGExpr.cpp | 5 ++- - .../test/CodeGen/asm-label-inline-builtins.c | 32 +++++++++++++++++++ - 2 files changed, 36 insertions(+), 1 deletion(-) - create mode 100644 clang/test/CodeGen/asm-label-inline-builtins.c - -diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp -index bf3dd812b9e8..a951d53423bf 100644 ---- a/clang/lib/CodeGen/CGExpr.cpp -+++ b/clang/lib/CodeGen/CGExpr.cpp -@@ -5046,7 +5046,10 @@ static CGCallee EmitDirectCallee(CodeGenFunction &CGF, GlobalDecl GD) { - if (auto builtinID = FD->getBuiltinID()) { - std::string NoBuiltinFD = ("no-builtin-" + FD->getName()).str(); - std::string NoBuiltins = "no-builtins"; -- std::string FDInlineName = (FD->getName() + ".inline").str(); -+ -+ auto *A = FD->getAttr(); -+ StringRef Ident = A ? A->getLabel() : FD->getName(); -+ std::string FDInlineName = (Ident + ".inline").str(); - - bool IsPredefinedLibFunction = - CGF.getContext().BuiltinInfo.isPredefinedLibFunction(builtinID); -diff --git a/clang/test/CodeGen/asm-label-inline-builtins.c b/clang/test/CodeGen/asm-label-inline-builtins.c -new file mode 100644 -index 000000000000..ab9afc29411d ---- /dev/null -+++ b/clang/test/CodeGen/asm-label-inline-builtins.c -@@ -0,0 +1,32 @@ -+// RUN: %clang_cc1 -triple x86_64 -S -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s -+// -+// Verifies that clang-generated *.inline carry the same name at call and callee -+// site, in spite of asm labels. -+ -+typedef struct _IO_FILE FILE; -+extern FILE *stdout; -+extern int vprintf (const char *__restrict __format, __builtin_va_list __arg); -+extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, -+ const char *__restrict __format, __builtin_va_list __ap); -+extern int __vprintf_chk (int __flag, const char *__restrict __format, -+ __builtin_va_list __ap); -+ -+extern __typeof (vprintf) vprintf __asm ("__vprintfieee128"); -+extern __typeof (__vfprintf_chk) __vfprintf_chk __asm ("__vfprintf_chkieee128"); -+extern __typeof (__vprintf_chk) __vprintf_chk __asm ("__vprintf_chkieee128"); -+ -+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int -+vprintf (const char *__restrict __fmt, __builtin_va_list __ap) -+{ -+ return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap); -+} -+ -+void test(const char *fmt, __builtin_va_list ap) { -+ vprintf(fmt, ap); -+} -+ -+// CHECK-LABEL: void @test( -+// CHECK: call i32 @__vprintfieee128.inline( -+// -+// CHECK-LABEL: internal i32 @__vprintfieee128.inline( -+// CHECK: call i32 @__vfprintf_chkieee128( --- -2.37.2 - diff --git a/0001-clang-MinGW-Improve-extend-the-gcc-sysroot-detection.patch b/0001-clang-MinGW-Improve-extend-the-gcc-sysroot-detection.patch deleted file mode 100644 index 7f54d320ac26b584168f6ec2a795d8d11cec4461..0000000000000000000000000000000000000000 --- a/0001-clang-MinGW-Improve-extend-the-gcc-sysroot-detection.patch +++ /dev/null @@ -1,280 +0,0 @@ -From efe3686d4a519b357cecb5aaf715f1e1b6f2d025 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Storsj=C3=B6?= -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 - /../ -- One which looks for a mingw-targeting gcc executables in the PATH -- One which looks in the /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 -"-w64-mingw32-gcc" or "mingw32-gcc" or subdirectories -named "-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 -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 -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 -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, 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, 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 findGcc(const llvm::Triple &T) { -- llvm::SmallVector, 2> Gccs; -+static llvm::ErrorOr findGcc(const llvm::Triple &LiteralTriple, -+ const llvm::Triple &T) { -+ llvm::SmallVector, 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 findGcc(const llvm::Triple &T) { - } - - static llvm::ErrorOr --findClangRelativeSysroot(const Driver &D, const llvm::Triple &T, -- std::string &SubdirName) { -- llvm::SmallVector, 2> Subdirs; -+findClangRelativeSysroot(const Driver &D, const llvm::Triple &LiteralTriple, -+ const llvm::Triple &T, std::string &SubdirName) { -+ llvm::SmallVector, 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 /../; if found, use /.. as the - // base as it could still be a base for a gcc setup with libgcc. -- else if (llvm::ErrorOr TargetSubdir = -- findClangRelativeSysroot(getDriver(), getTriple(), SubdirName)) -+ else if (llvm::ErrorOr TargetSubdir = findClangRelativeSysroot( -+ getDriver(), LiteralTriple, getTriple(), SubdirName)) - Base = std::string(llvm::sys::path::parent_path(TargetSubdir.get())); -- else if (llvm::ErrorOr GPPName = findGcc(getTriple())) -+ else if (llvm::ErrorOr 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 TargetSubdir = -- findClangRelativeSysroot(D, Triple, SubdirName)) -+ findClangRelativeSysroot(D, LiteralTriple, Triple, SubdirName)) - return true; -- if (llvm::ErrorOr GPPName = findGcc(Triple)) -+ if (llvm::ErrorOr 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 Preprocessor; - mutable std::unique_ptr 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 - diff --git a/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch b/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch index 8f30ef40d1681abfe495f242f461a04161009eba..a0b8cb03cc0406e63f164b0b3afb4d335359ea12 100644 --- a/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch +++ b/0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch @@ -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 diff --git a/0002-clang-MinGW-Improve-detection-of-libstdc-headers-on-.patch b/0002-clang-MinGW-Improve-detection-of-libstdc-headers-on-.patch deleted file mode 100644 index 7376d7f87a1ce053a35a70113128953178cbeec4..0000000000000000000000000000000000000000 --- a/0002-clang-MinGW-Improve-detection-of-libstdc-headers-on-.patch +++ /dev/null @@ -1,139 +0,0 @@ -From d3b79c2950d590cb272648f1c6a9dd7646f57beb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Storsj=C3=B6?= -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 -//include, //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 //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 path, with just /include and /lib -under it) doesn't seem to apply on Gentoo, where the includes -are found in //usr/include while the libraries -are in //mingw/lib (see -8e218026f8d5eabfdef9141ae5e26aa91d1933e6). But apparently -the libstdc++ headers aren't installed under -//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 Preprocessor; - mutable std::unique_ptr 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 - diff --git a/0003-PATCH-Make-funwind-tables-the-default-on-all-archs.patch b/0003-PATCH-Make-funwind-tables-the-default-on-all-archs.patch index e6671f90f8d381cc0fd4cc62a390dcdea22a225a..ce920f93e16c7682656af55392cc03dbc1e55c2d 100644 --- a/0003-PATCH-Make-funwind-tables-the-default-on-all-archs.patch +++ b/0003-PATCH-Make-funwind-tables-the-default-on-all-archs.patch @@ -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 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 diff --git a/0010-PATCH-clang-Produce-DWARF4-by-default.patch b/0010-PATCH-clang-Produce-DWARF4-by-default.patch index 2d698c5e63331eddc3b09c9e493041c8f2f07c6e..ea81f74c75560bf92dfe06101ddcb14e309cdb1c 100644 --- a/0010-PATCH-clang-Produce-DWARF4-by-default.patch +++ b/0010-PATCH-clang-Produce-DWARF4-by-default.patch @@ -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 -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 diff --git a/1001-add-anolis-os-support-in-driver.patch b/1001-add-anolis-os-support-in-driver.patch index f78cd1490f886710ae71d5eb2a4151bc0a7614ab..75c4d0ac705cfaeb44424c8a7e51c1dfd92a4ac4 100644 --- a/1001-add-anolis-os-support-in-driver.patch +++ b/1001-add-anolis-os-support-in-driver.patch @@ -5,7 +5,7 @@ Subject: [PATCH] add anolis os support in driver --- lib/Driver/ToolChains/Gnu.cpp | 5 +++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/a1/lib/Driver/ToolChains/Gnu.cpp b/b1/lib/Driver/ToolChains/Gnu.cpp index 8536701a..25d3d42d 100644 diff --git a/D138472.diff b/D138472.diff new file mode 100644 index 0000000000000000000000000000000000000000..5d3cd607f060a361c5ac7ba7144fc231e3cd0cc0 --- /dev/null +++ b/D138472.diff @@ -0,0 +1,53 @@ +From 04b642c646048dd9df652eba05d45beaa13bc895 Mon Sep 17 00:00:00 2001 +From: Konrad Kleine +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 + diff --git a/D141581.diff b/D141581.diff new file mode 100644 index 0000000000000000000000000000000000000000..c227e2220b1eb0a5d5fd3a5381d931d732f7ee99 --- /dev/null +++ b/D141581.diff @@ -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 + diff --git a/clang-15.0.7.src.tar.xz b/clang-16.0.1.src.tar.xz similarity index 64% rename from clang-15.0.7.src.tar.xz rename to clang-16.0.1.src.tar.xz index 0062fa6d3e3a5fd0522d9d1d26aecd6708a5d051..dc95199d0688f917e4c12771b4d25c879934cd5f 100644 Binary files a/clang-15.0.7.src.tar.xz and b/clang-16.0.1.src.tar.xz differ diff --git a/clang-tools-extra-15.0.7.src.tar.xz b/clang-tools-extra-16.0.1.src.tar.xz similarity index 30% rename from clang-tools-extra-15.0.7.src.tar.xz rename to clang-tools-extra-16.0.1.src.tar.xz index 113884182abe53e4a1e8bfa1b0d0a9d42d986d9a..4259dbea90fe90c23198e5dcfac9c8916d4da9ea 100644 Binary files a/clang-tools-extra-15.0.7.src.tar.xz and b/clang-tools-extra-16.0.1.src.tar.xz differ diff --git a/clang.spec b/clang.spec index b96b71f4235ad1a10b687cee9fbad576cc622767..7acb0c47b5ae58b2fd57db89a79d21991a3148fc 100644 --- a/clang.spec +++ b/clang.spec @@ -1,18 +1,19 @@ -%define anolis_release 4 +%define anolis_release 1 %global toolchain clang %undefine _include_frame_pointers %bcond_with compat_build -%bcond_without check +%bcond_with check -%global maj_ver 15 +%global maj_ver 16 %global min_ver 0 -%global patch_ver 7 +%global patch_ver 1 %global clang_version %{maj_ver}.%{min_ver}.%{patch_ver} %global clang_srcdir clang-%{clang_version}.src +%global cmake_srcdir cmake-%{clang_version}.src %global clang_tools_srcdir clang-tools-extra-%{clang_version}.src Name: clang @@ -23,41 +24,41 @@ Summary: A C language family front-end for LLVM License: Apache-2.0 WITH LLVM-exception OR NCSA URL: http://llvm.org Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}/%{clang_srcdir}.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}/%{clang_tools_srcdir}.tar.xz -Source5: macros.%{name} +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}/%{clang_tools_srcdir}.tar.xz +Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}/%{cmake_srcdir}.tar.xz +Source7: macros.%{name} # 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 +# 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 + +Patch10: fix-ieee128-cross.diff +# Add anolis support in driver +Patch11: 1001-add-anolis-os-support-in-driver.patch -# 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 - # Patches for clang-tools-extra # See https://reviews.llvm.org/D120301 Patch201: 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch -Patch100: 1001-add-anolis-os-support-in-driver.patch BuildRequires: clang BuildRequires: cmake BuildRequires: ninja-build -BuildRequires: llvm-devel >= %{version} -BuildRequires: llvm-test >= %{version} +BuildRequires: llvm-devel = %{version} +BuildRequires: llvm-test = %{version} # llvm-static is required, because clang-tablegen needs libLLVMTableGen, which # is not included in libLLVM.so. -BuildRequires: llvm-static >= %{version} -BuildRequires: llvm-googletest >= %{version} +BuildRequires: llvm-static = %{version} +BuildRequires: llvm-googletest = %{version} BuildRequires: libxml2-devel BuildRequires: perl-generators @@ -194,15 +195,25 @@ Requires: python3 %{summary}. %prep +%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 + %setup -T -q -b 1 -n %{clang_tools_srcdir} %autopatch -m200 -p2 - + + # failing test case rm test/clang-tidy/checkers/altera/struct-pack-align.cpp %py3_shebang_fix \ - clang-tidy/tool/ \ - clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py + clang-tidy/tool/ \ + clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py %setup -q -n %{clang_srcdir} %autopatch -M200 -p2 @@ -211,24 +222,23 @@ rm test/clang-tidy/checkers/altera/struct-pack-align.cpp rm test/CodeGen/profile-filter.c %py3_shebang_fix \ - tools/clang-format/ \ - tools/clang-format/git-clang-format \ - utils/hmaptool/hmaptool \ - tools/scan-view/bin/scan-view \ - tools/scan-view/share/Reporter.py \ - tools/scan-view/share/startfile.py \ - tools/scan-build-py/bin/* \ - tools/scan-build-py/libexec/* + tools/clang-format/ \ + tools/clang-format/git-clang-format \ + utils/hmaptool/hmaptool \ + tools/scan-view/bin/scan-view \ + tools/scan-view/share/Reporter.py \ + tools/scan-view/share/startfile.py \ + tools/scan-build-py/bin/* \ + tools/scan-build-py/libexec/* +%endif %build -%if "%{toolchain}" == "clang" # Use ThinLTO to limit build time. %define _lto_cflags -flto=thin # And disable LTO on AArch64 entirely. %ifarch aarch64 %define _lto_cflags %{nil} %endif -%endif sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py @@ -241,7 +251,7 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py %endif # We set CLANG_DEFAULT_PIE_ON_LINUX=OFF and PPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON to match the -# defaults used by Fedora's GCC. +# defaults used by our GCC. %cmake -G Ninja \ -DCLANG_DEFAULT_PIE_ON_LINUX=OFF \ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON \ @@ -254,6 +264,7 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py -DLLVM_BUILD_UTILS:BOOL=ON \ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../%{clang_tools_srcdir} \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ + -DLLVM_LIT_ARGS="-vv" \ -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -DLLVM_LIBDIR_SUFFIX=64 \ \ @@ -268,7 +279,6 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py -DLLVM_BUILD_DOCS=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 \ @@ -285,7 +295,7 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py # 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}|" \ @@ -297,7 +307,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 @@ -318,7 +328,6 @@ rm -Rvf %{buildroot}%{_docdir}/Clang/clang/html rm -Rvf %{buildroot}%{_datadir}/clang/clang-doc-default-stylesheet.css rm -Rvf %{buildroot}%{_datadir}/clang/index.js -# TODO: What are the Fedora guidelines for packaging bash autocomplete files? rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh # Create Manpage symlinks @@ -333,28 +342,22 @@ 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 - # 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}%{_libdir}/clang/%{maj_ver}/{include,lib,share}/ # Add a symlink in /usr/bin to clang-format-diff ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff %check %if %{with check} +# Build test dependencies separately, to prevent invocations of host clang from being affected +# by LD_LIBRARY_PATH below. +%cmake_build --target clang-test-depends \ + ExtraToolsUnitTests ClangdUnitTests ClangIncludeCleanerUnitTests ClangPseudoUnitTests # requires lit.py from LLVM utilities -# FIXME (Feb 2023): TEST 'Clang :: Driver/XRay/xray-instrument-os.c' FAILED -LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \ -true +# FIXME: Fix failing ARM tests +LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || false %endif %files @@ -371,7 +374,7 @@ true %{_mandir}/man1/clang++-%{maj_ver}.1* %files libs -%{_libdir}/clang/ +%{_libdir}/clang/%{maj_ver}/include/* %{_libdir}/*.so.* %files devel @@ -385,11 +388,10 @@ true %files resource-filesystem %dir %{_libdir}/clang/ -%dir %{_libdir}/clang/%{version}/ -%dir %{_libdir}/clang/%{version}/include/ -%dir %{_libdir}/clang/%{version}/lib/ -%dir %{_libdir}/clang/%{version}/share/ -%{_libdir}/clang/%{maj_ver} +%dir %{_libdir}/clang/%{maj_ver}/ +%dir %{_libdir}/clang/%{maj_ver}/include/ +%dir %{_libdir}/clang/%{maj_ver}/lib/ +%dir %{_libdir}/clang/%{maj_ver}/share/ %files analyzer %{_bindir}/scan-view @@ -411,19 +413,19 @@ true %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 @@ -435,6 +437,7 @@ true %{_bindir}/clangd %{_bindir}/diagtool %{_bindir}/hmaptool +%{_bindir}/nvptx-arch %{_bindir}/pp-trace %{_bindir}/c-index-test %{_bindir}/find-all-symbols @@ -462,6 +465,9 @@ true %{python3_sitelib}/clang/ %changelog +* Wed Apr 5 2023 Funda Wang - 16.0.1-1 +- New version 16.0.1 + * Tue Mar 28 2023 mgb01105731 - 15.0.7-4 - Del Specific Fields diff --git a/cmake-16.0.1.src.tar.xz b/cmake-16.0.1.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..ee563132336eac9571bda9c89e77153ecee46e8c Binary files /dev/null and b/cmake-16.0.1.src.tar.xz differ diff --git a/fix-ieee128-cross.diff b/fix-ieee128-cross.diff new file mode 100644 index 0000000000000000000000000000000000000000..218c2292ef201ec59a6e860d4c9c41665bacd481 --- /dev/null +++ b/fix-ieee128-cross.diff @@ -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 diff --git a/macros.clang b/macros.clang index 1f26e35fdf2c2184b1c2667a7b6b5027bd7a9775..6f35452b2b5e02748bba05f4e972b85d8f65abc5 100644 --- a/macros.clang +++ b/macros.clang @@ -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.