Merge llvm-project release/17.x llvmorg-17.0.2-0-gb2417f51dbbd

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-17.0.2-0-gb2417f51dbbd.

PR:		273753
MFC after:	1 month
This commit is contained in:
Dimitry Andric 2023-10-04 20:24:05 +02:00
commit 3bd749dbd9
8 changed files with 36 additions and 31 deletions

View file

@ -699,8 +699,11 @@ void toolchains::MinGW::addClangTargetOptions(
}
}
if (Arg *A = DriverArgs.getLastArgNoClaim(options::OPT_mthreads))
A->ignoreTargetSpecific();
for (auto Opt : {options::OPT_mthreads, options::OPT_mwindows,
options::OPT_mconsole, options::OPT_mdll}) {
if (Arg *A = DriverArgs.getLastArgNoClaim(Opt))
A->ignoreTargetSpecific();
}
}
void toolchains::MinGW::AddClangCXXStdlibIncludeArgs(

View file

@ -288,9 +288,9 @@ struct _LIBCPP_TEMPLATE_VIS pair
# if _LIBCPP_STD_VER >= 23
// This is a workaround for http://llvm.org/PR60710. We should be able to remove it once Clang is fixed.
template <class _PairLike, bool _Enable = tuple_size<remove_cvref_t<_PairLike>>::value == 2>
template <class _PairLike>
_LIBCPP_HIDE_FROM_ABI static constexpr bool __pair_like_explicit_wknd() {
if constexpr (tuple_size<remove_cvref_t<_PairLike>>::value == 2) {
if constexpr (__pair_like<_PairLike>) {
return !is_convertible_v<decltype(std::get<0>(std::declval<_PairLike&&>())), first_type> ||
!is_convertible_v<decltype(std::get<1>(std::declval<_PairLike&&>())), second_type>;
}

View file

@ -342,8 +342,8 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
CHECK(c.getFullName(),
"could not get the filename for the member defining symbol " +
toCOFFString(ctx, sym));
auto future = std::make_shared<std::future<MBErrPair>>(
createFutureForFile(childName));
auto future =
std::make_shared<std::future<MBErrPair>>(createFutureForFile(childName));
enqueueTask([=]() {
auto mbOrErr = future->get();
if (mbOrErr.second)
@ -640,26 +640,24 @@ void LinkerDriver::detectWinSysRoot(const opt::InputArgList &Args) {
void LinkerDriver::addClangLibSearchPaths(const std::string &argv0) {
std::string lldBinary = sys::fs::getMainExecutable(argv0.c_str(), nullptr);
SmallString<128> binDir(lldBinary);
sys::path::remove_filename(binDir); // remove lld-link.exe
sys::path::remove_filename(binDir); // remove lld-link.exe
StringRef rootDir = sys::path::parent_path(binDir); // remove 'bin'
SmallString<128> libDir(rootDir);
sys::path::append(libDir, "lib");
// We need to prepend the paths here in order to make sure that we always
// try to link the clang versions of the builtins over the ones supplied by MSVC.
searchPaths.insert(searchPaths.begin(), saver().save(libDir.str()));
// Add the resource dir library path
SmallString<128> runtimeLibDir(rootDir);
sys::path::append(runtimeLibDir, "lib", "clang", std::to_string(LLVM_VERSION_MAJOR), "lib");
searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDir.str()));
sys::path::append(runtimeLibDir, "lib", "clang",
std::to_string(LLVM_VERSION_MAJOR), "lib");
// Resource dir + osname, which is hardcoded to windows since we are in the
// COFF driver.
SmallString<128> runtimeLibDirWithOS(runtimeLibDir);
sys::path::append(runtimeLibDirWithOS, "windows");
searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDirWithOS.str()));
searchPaths.push_back(saver().save(runtimeLibDirWithOS.str()));
searchPaths.push_back(saver().save(runtimeLibDir.str()));
searchPaths.push_back(saver().save(libDir.str()));
}
void LinkerDriver::addWinSysRootLibSearchPaths() {
@ -1145,8 +1143,7 @@ void LinkerDriver::parseOrderFile(StringRef arg) {
if (set.count(s) == 0) {
if (ctx.config.warnMissingOrderSymbol)
warn("/order:" + arg + ": missing symbol: " + s + " [LNK4037]");
}
else
} else
ctx.config.order[s] = INT_MIN + ctx.config.order.size();
}
@ -1313,8 +1310,8 @@ void LinkerDriver::parsePDBAltPath() {
else if (var.equals_insensitive("%_ext%"))
buf.append(binaryExtension);
else {
warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " +
var + " as literal");
warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " + var +
" as literal");
buf.append(var);
}
@ -1448,8 +1445,8 @@ getVFS(const opt::InputArgList &args) {
return nullptr;
}
if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr), /*DiagHandler*/ nullptr,
arg->getValue()))
if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr),
/*DiagHandler*/ nullptr, arg->getValue()))
return ret;
error("Invalid vfs overlay");
@ -1563,12 +1560,13 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
// Construct search path list.
searchPaths.emplace_back("");
// Prefer the Clang provided builtins over the ones bundled with MSVC.
addClangLibSearchPaths(argsArr[0]);
for (auto *arg : args.filtered(OPT_libpath))
searchPaths.push_back(arg->getValue());
detectWinSysRoot(args);
if (!args.hasArg(OPT_lldignoreenv) && !args.hasArg(OPT_winsysroot))
addLibSearchPaths();
addClangLibSearchPaths(argsArr[0]);
// Handle /ignore
for (auto *arg : args.filtered(OPT_ignore)) {
@ -2083,8 +2081,11 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
raw_svector_ostream stream(buffer);
stream << "Library search paths:\n";
for (StringRef path : searchPaths)
for (StringRef path : searchPaths) {
if (path == "")
path = "(cwd)";
stream << " " << path << "\n";
}
message(buffer);
}
@ -2101,7 +2102,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
// Handle /RELEASE
if (args.hasArg(OPT_release))
config->writeCheckSum = true;
// Handle /safeseh, x86 only, on by default, except for mingw.
if (config->machine == I386) {
config->safeSEH = args.hasFlag(OPT_safeseh, OPT_safeseh_no, !config->mingw);
@ -2342,7 +2343,8 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
std::vector<WrappedSymbol> wrapped = addWrappedSymbols(ctx, args);
// Load more object files that might be needed for wrapped symbols.
if (!wrapped.empty())
while (run());
while (run())
;
if (config->autoImport || config->stdcallFixup) {
// MinGW specific.

View file

@ -57,7 +57,7 @@ void lld::unlinkAsync(StringRef path) {
//
// The code here allows LLD to work on all versions of Windows.
// However, at Windows 10 1903 it seems that the behavior of
// Windows has changed, so that we could simply delete the output
// Windows has changed, so that we could simply delete the output
// file. This code should be simplified once support for older
// versions of Windows is dropped.
//

View file

@ -855,7 +855,7 @@ static MCSectionELF *selectELFSectionForGlobal(
Group = C->getName();
IsComdat = C->getSelectionKind() == Comdat::Any;
}
if (isa<GlobalVariable>(GO)) {
if (isa<GlobalVariable>(GO) && !cast<GlobalVariable>(GO)->isThreadLocal()) {
if (TM.isLargeData()) {
assert(TM.getTargetTriple().getArch() == Triple::x86_64);
Flags |= ELF::SHF_X86_64_LARGE;

View file

@ -1,8 +1,8 @@
#define LLVM_REVISION "llvmorg-17.0.1-25-g098e653a5bed"
#define LLVM_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"
#define CLANG_REVISION "llvmorg-17.0.1-25-g098e653a5bed"
#define CLANG_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
#define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git"
#define LLDB_REVISION "llvmorg-17.0.1-25-g098e653a5bed"
#define LLDB_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
#define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git"

View file

@ -1,4 +1,4 @@
// Local identifier in __FreeBSD_version style
#define LLD_FREEBSD_VERSION 1500000
#define LLD_VERSION_STRING "17.0.2 (FreeBSD llvmorg-17.0.1-25-g098e653a5bed-" __XSTRING(LLD_FREEBSD_VERSION) ")"
#define LLD_VERSION_STRING "17.0.2 (FreeBSD llvmorg-17.0.2-0-gb2417f51dbbd-" __XSTRING(LLD_FREEBSD_VERSION) ")"

View file

@ -1,2 +1,2 @@
#define LLVM_REVISION "llvmorg-17.0.1-25-g098e653a5bed"
#define LLVM_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"