rebase of the patch

This commit is contained in:
Sylvestre Ledru 2024-03-20 09:23:11 +01:00
parent e6ae36a279
commit 5018d1a639
10 changed files with 94 additions and 86 deletions

View File

@ -3,10 +3,10 @@
tools/llvm-shlib/CMakeLists.txt | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm-toolchain-18_18.1.0-rc4/clang/tools/libclang/CMakeLists.txt
Index: llvm-toolchain-18_18.1.2/clang/tools/libclang/CMakeLists.txt
===================================================================
--- llvm-toolchain-18_18.1.0-rc4.orig/clang/tools/libclang/CMakeLists.txt
+++ llvm-toolchain-18_18.1.0-rc4/clang/tools/libclang/CMakeLists.txt
--- llvm-toolchain-18_18.1.2.orig/clang/tools/libclang/CMakeLists.txt
+++ llvm-toolchain-18_18.1.2/clang/tools/libclang/CMakeLists.txt
@@ -135,7 +135,7 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHE
remove_definitions("-D_XOPEN_SOURCE=700")
endif()
@ -16,13 +16,13 @@ Index: llvm-toolchain-18_18.1.0-rc4/clang/tools/libclang/CMakeLists.txt
OUTPUT_NAME ${output_name}
${SOURCES}
Index: llvm-toolchain-18_18.1.0-rc4/llvm/tools/llvm-shlib/CMakeLists.txt
Index: llvm-toolchain-18_18.1.2/llvm/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm-toolchain-18_18.1.0-rc4.orig/llvm/tools/llvm-shlib/CMakeLists.txt
+++ llvm-toolchain-18_18.1.0-rc4/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -38,6 +38,8 @@ if(LLVM_BUILD_LLVM_DYLIB)
get_target_property(LLVM_DYLIB_SOVERSION LLVM SOVERSION)
llvm_install_library_symlink(LLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} LLVM SHARED COMPONENT LLVM SOVERSION ${LLVM_DYLIB_SOVERSION})
--- llvm-toolchain-18_18.1.2.orig/llvm/tools/llvm-shlib/CMakeLists.txt
+++ llvm-toolchain-18_18.1.2/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -41,6 +41,8 @@ if(LLVM_BUILD_LLVM_DYLIB)
llvm_install_library_symlink(LLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} $<TARGET_FILE_NAME:LLVM> SHARED FULL_DEST COMPONENT LLVM)
endif()
+ set_property(TARGET LLVM PROPERTY VERSION "1") # Append .1 to SONAME
+

View File

@ -3,9 +3,11 @@ Restore that for now, we're not GenToo ...
https://reviews.llvm.org/D148945
https://reviews.llvm.org/D122444
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -333,6 +333,13 @@ Linux::Linux(const Driver &D, const llvm
Index: llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/Linux.cpp
===================================================================
--- llvm-toolchain-18_18.1.2.orig/clang/lib/Driver/ToolChains/Linux.cpp
+++ llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/Linux.cpp
@@ -337,6 +337,13 @@ Linux::Linux(const Driver &D, const llvm
Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);

View File

@ -1,6 +1,8 @@
--- a/llvm/lib/TargetParser/ARMTargetParser.cpp
+++ b/llvm/lib/TargetParser/ARMTargetParser.cpp
@@ -637,9 +637,9 @@ StringRef ARM::getARMCPUForArch(const ll
Index: llvm-toolchain-18_18.1.2/llvm/lib/TargetParser/ARMTargetParser.cpp
===================================================================
--- llvm-toolchain-18_18.1.2.orig/llvm/lib/TargetParser/ARMTargetParser.cpp
+++ llvm-toolchain-18_18.1.2/llvm/lib/TargetParser/ARMTargetParser.cpp
@@ -636,9 +636,9 @@ StringRef ARM::getARMCPUForArch(const ll
case llvm::Triple::EABIHF:
case llvm::Triple::GNUEABIHF:
case llvm::Triple::MuslEABIHF:

View File

@ -1,8 +1,8 @@
Index: llvm-toolchain-snapshot_18~++20231114093943+6229cd0272a8/compiler-rt/lib/builtins/CMakeLists.txt
Index: llvm-toolchain-18_18.1.2/compiler-rt/lib/builtins/CMakeLists.txt
===================================================================
--- llvm-toolchain-snapshot_18~++20231114093943+6229cd0272a8.orig/compiler-rt/lib/builtins/CMakeLists.txt
+++ llvm-toolchain-snapshot_18~++20231114093943+6229cd0272a8/compiler-rt/lib/builtins/CMakeLists.txt
@@ -764,6 +764,12 @@ else ()
--- llvm-toolchain-18_18.1.2.orig/compiler-rt/lib/builtins/CMakeLists.txt
+++ llvm-toolchain-18_18.1.2/compiler-rt/lib/builtins/CMakeLists.txt
@@ -772,6 +772,12 @@ else ()
append_list_if(COMPILER_RT_ENABLE_CET -fcf-protection=full BUILTIN_CFLAGS)
endif()

View File

@ -1,6 +1,8 @@
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -196,7 +196,7 @@
Index: llvm-toolchain-18_18.1.2/clang/tools/libclang/CMakeLists.txt
===================================================================
--- llvm-toolchain-18_18.1.2.orig/clang/tools/libclang/CMakeLists.txt
+++ llvm-toolchain-18_18.1.2/clang/tools/libclang/CMakeLists.txt
@@ -208,7 +208,7 @@ if(ENABLE_SHARED)
OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libclang.map)
set_target_properties(libclang PROPERTIES

View File

@ -15,10 +15,10 @@ Date: Tue Feb 1 23:13:01 2022 -0800
Differential Revision: https://reviews.llvm.org/D112181
Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang-tools-extra/docs/conf.py
Index: llvm-toolchain-18_18.1.2/clang-tools-extra/docs/conf.py
===================================================================
--- llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e.orig/clang-tools-extra/docs/conf.py
+++ llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang-tools-extra/docs/conf.py
--- llvm-toolchain-18_18.1.2.orig/clang-tools-extra/docs/conf.py
+++ llvm-toolchain-18_18.1.2/clang-tools-extra/docs/conf.py
@@ -44,6 +44,15 @@ master_doc = "index"
project = "Extra Clang Tools"
copyright = "2007-%d, The Clang Team" % date.today().year
@ -47,11 +47,11 @@ Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang-tools-extr
# -- Options for HTML output ---------------------------------------------------
Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang/docs/conf.py
Index: llvm-toolchain-18_18.1.2/clang/docs/conf.py
===================================================================
--- llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e.orig/clang/docs/conf.py
+++ llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang/docs/conf.py
@@ -63,6 +63,15 @@ master_doc = "index"
--- llvm-toolchain-18_18.1.2.orig/clang/docs/conf.py
+++ llvm-toolchain-18_18.1.2/clang/docs/conf.py
@@ -48,6 +48,15 @@ master_doc = "index"
project = "Clang"
copyright = "2007-%d, The Clang Team" % date.today().year
@ -67,7 +67,7 @@ Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang/docs/conf.
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
@@ -94,11 +103,6 @@ exclude_patterns = ["_build"]
@@ -79,11 +88,6 @@ exclude_patterns = ["_build"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "friendly"
@ -79,10 +79,10 @@ Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/clang/docs/conf.
# -- Options for HTML output ---------------------------------------------------
Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/lld/docs/conf.py
Index: llvm-toolchain-18_18.1.2/lld/docs/conf.py
===================================================================
--- llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e.orig/lld/docs/conf.py
+++ llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/lld/docs/conf.py
--- llvm-toolchain-18_18.1.2.orig/lld/docs/conf.py
+++ llvm-toolchain-18_18.1.2/lld/docs/conf.py
@@ -43,6 +43,15 @@ master_doc = "index"
project = "lld"
copyright = "2011-%d, LLVM Project" % date.today().year
@ -99,10 +99,10 @@ Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/lld/docs/conf.py
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/llvm/cmake/modules/AddSphinxTarget.cmake
Index: llvm-toolchain-18_18.1.2/llvm/cmake/modules/AddSphinxTarget.cmake
===================================================================
--- llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e.orig/llvm/cmake/modules/AddSphinxTarget.cmake
+++ llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/llvm/cmake/modules/AddSphinxTarget.cmake
--- llvm-toolchain-18_18.1.2.orig/llvm/cmake/modules/AddSphinxTarget.cmake
+++ llvm-toolchain-18_18.1.2/llvm/cmake/modules/AddSphinxTarget.cmake
@@ -39,10 +39,6 @@ function (add_sphinx_target builder proj
set(ARG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
@ -124,11 +124,11 @@ Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/llvm/cmake/modul
${SPHINX_WARNINGS_AS_ERRORS_FLAG} # Treat warnings as errors if requested
"${ARG_SOURCE_DIR}" # Source
"${SPHINX_BUILD_DIR}" # Output
Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/llvm/docs/conf.py
Index: llvm-toolchain-18_18.1.2/llvm/docs/conf.py
===================================================================
--- llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e.orig/llvm/docs/conf.py
+++ llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/llvm/docs/conf.py
@@ -62,6 +62,15 @@ master_doc = "index"
--- llvm-toolchain-18_18.1.2.orig/llvm/docs/conf.py
+++ llvm-toolchain-18_18.1.2/llvm/docs/conf.py
@@ -52,6 +52,15 @@ master_doc = "index"
project = "LLVM"
copyright = "2003-%d, LLVM Project" % date.today().year
@ -144,10 +144,10 @@ Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/llvm/docs/conf.p
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
Index: llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/polly/docs/conf.py
Index: llvm-toolchain-18_18.1.2/polly/docs/conf.py
===================================================================
--- llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e.orig/polly/docs/conf.py
+++ llvm-toolchain-snapshot_17~++20230526082102+a22ef958cb7e/polly/docs/conf.py
--- llvm-toolchain-18_18.1.2.orig/polly/docs/conf.py
+++ llvm-toolchain-18_18.1.2/polly/docs/conf.py
@@ -44,6 +44,15 @@ master_doc = "index"
project = "Polly"
copyright = "2010-%d, The Polly Team" % date.today().year

View File

@ -1,8 +1,8 @@
Index: llvm-toolchain-snapshot_17~++20230523093327+96a003b9bf79/libunwind/CMakeLists.txt
Index: llvm-toolchain-18_18.1.2/libunwind/CMakeLists.txt
===================================================================
--- llvm-toolchain-snapshot_17~++20230523093327+96a003b9bf79.orig/libunwind/CMakeLists.txt
+++ llvm-toolchain-snapshot_17~++20230523093327+96a003b9bf79/libunwind/CMakeLists.txt
@@ -277,14 +277,17 @@ if (MSVC)
--- llvm-toolchain-18_18.1.2.orig/libunwind/CMakeLists.txt
+++ llvm-toolchain-18_18.1.2/libunwind/CMakeLists.txt
@@ -301,14 +301,17 @@ if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()

View File

@ -1,6 +1,8 @@
--- a/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ b/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -369,6 +369,18 @@ ToolChain::RuntimeLibType WebAssembly::G
Index: llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.cpp
===================================================================
--- llvm-toolchain-18_18.1.2.orig/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -421,6 +421,18 @@ ToolChain::RuntimeLibType WebAssembly::G
return ToolChain::RLT_CompilerRT;
}
@ -19,9 +21,11 @@
ToolChain::CXXStdlibType
WebAssembly::GetCXXStdlibType(const ArgList &Args) const {
if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
--- a/clang/lib/Driver/ToolChains/WebAssembly.h
+++ b/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -61,6 +61,7 @@ private:
Index: llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.h
===================================================================
--- llvm-toolchain-18_18.1.2.orig/clang/lib/Driver/ToolChains/WebAssembly.h
+++ llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -56,6 +56,7 @@ private:
llvm::opt::ArgStringList &CC1Args,
Action::OffloadKind DeviceOffloadKind) const override;
RuntimeLibType GetDefaultRuntimeLibType() const override;

View File

@ -1,27 +1,25 @@
Index: llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/clang/lib/Driver/ToolChains/WebAssembly.h
Index: llvm-toolchain-snapshot_19~++20240319094628+703920d4138d/clang/lib/Driver/ToolChains/WebAssembly.cpp
===================================================================
--- llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8.orig/clang/lib/Driver/ToolChains/WebAssembly.h
+++ llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -10,9 +10,13 @@
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_WEBASSEMBLY_H
--- llvm-toolchain-snapshot_19~++20240319094628+703920d4138d.orig/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ llvm-toolchain-snapshot_19~++20240319094628+703920d4138d/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -20,6 +20,11 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "Gnu.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_VERSION_MAJOR
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"
+
+#define TOSTR2(X) #X
+#define TOSTR(X) TOSTR2(X)
+
namespace clang {
namespace driver {
namespace tools {
@@ -68,7 +72,7 @@ private:
llvm::opt::ArgStringList &CmdArgs) const override;
SanitizerMask getSupportedSanitizers() const override;
using namespace clang::driver;
using namespace clang::driver::tools;
using namespace clang::driver::toolchains;
@@ -241,7 +246,7 @@ WebAssembly::WebAssembly(const Driver &D
const char *WebAssembly::getDefaultLinker() const {
if (getOS() == "wasip2")
return "wasm-component-ld";
- return "wasm-ld";
+ return "wasm-ld-" TOSTR(LLVM_VERSION_MAJOR);
}
- const char *getDefaultLinker() const override { return "wasm-ld"; }
+ const char *getDefaultLinker() const override { return "wasm-ld-" TOSTR(LLVM_VERSION_MAJOR); }
CXXStdlibType GetDefaultCXXStdlibType() const override {
return ToolChain::CST_Libcxx;
bool WebAssembly::IsMathErrnoDefault() const { return false; }

View File

@ -1,8 +1,8 @@
Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
Index: llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.cpp
===================================================================
--- llvm-toolchain-16-16.0.6.orig/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -174,7 +174,7 @@ WebAssembly::WebAssembly(const Driver &D
--- llvm-toolchain-18_18.1.2.orig/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -222,7 +222,7 @@ WebAssembly::WebAssembly(const Driver &D
getProgramPaths().push_back(getDriver().getInstalledDir());
@ -11,7 +11,7 @@ Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
if (getTriple().getOS() == llvm::Triple::UnknownOS) {
// Theoretically an "unknown" OS should mean no standard libraries, however
// it could also mean that a custom set of libraries is in use, so just add
@@ -402,6 +402,7 @@ void WebAssembly::AddClangSystemIncludeA
@@ -454,6 +454,7 @@ void WebAssembly::AddClangSystemIncludeA
return;
const Driver &D = getDriver();
@ -19,7 +19,7 @@ Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
SmallString<128> P(D.ResourceDir);
@@ -425,12 +426,20 @@ void WebAssembly::AddClangSystemIncludeA
@@ -477,12 +478,20 @@ void WebAssembly::AddClangSystemIncludeA
return;
}
@ -43,7 +43,7 @@ Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
}
void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
@@ -478,6 +487,17 @@ Tool *WebAssembly::buildLinker() const {
@@ -533,6 +542,17 @@ Tool *WebAssembly::buildLinker() const {
return new tools::wasm::Linker(*this);
}
@ -61,7 +61,7 @@ Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
void WebAssembly::addLibCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const {
@@ -488,18 +508,22 @@ void WebAssembly::addLibCxxIncludePaths(
@@ -543,18 +563,22 @@ void WebAssembly::addLibCxxIncludePaths(
getMultiarchTriple(D, getTriple(), SysRoot);
bool IsKnownOs = (getTriple().getOS() != llvm::Triple::UnknownOS);
@ -91,7 +91,7 @@ Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
}
void WebAssembly::addLibStdCXXIncludePaths(
@@ -546,8 +570,11 @@ void WebAssembly::addLibStdCXXIncludePat
@@ -601,8 +625,11 @@ void WebAssembly::addLibStdCXXIncludePat
addSystemInclude(DriverArgs, CC1Args, TargetDir);
}
@ -107,11 +107,11 @@ Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
+ addSystemInclude(DriverArgs, CC1Args, LibPath + "/c++/" + Version + "/backward");
+ }
}
Index: llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.h
Index: llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.h
===================================================================
--- llvm-toolchain-16-16.0.6.orig/clang/lib/Driver/ToolChains/WebAssembly.h
+++ llvm-toolchain-16-16.0.6/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -89,6 +89,8 @@ private:
--- llvm-toolchain-18_18.1.2.orig/clang/lib/Driver/ToolChains/WebAssembly.h
+++ llvm-toolchain-18_18.1.2/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -84,6 +84,8 @@ private:
llvm::opt::ArgStringList &CC1Args) const;
void addLibStdCXXIncludePaths(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const;