Vendor import of llvm-project branch release/17.x llvmorg-17.0.2-0-gb2417f51dbbd.
This commit is contained in:
parent
4bbf1f460e
commit
7d1b501677
|
@ -699,9 +699,12 @@ void toolchains::MinGW::addClangTargetOptions(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Arg *A = DriverArgs.getLastArgNoClaim(options::OPT_mthreads))
|
for (auto Opt : {options::OPT_mthreads, options::OPT_mwindows,
|
||||||
|
options::OPT_mconsole, options::OPT_mdll}) {
|
||||||
|
if (Arg *A = DriverArgs.getLastArgNoClaim(Opt))
|
||||||
A->ignoreTargetSpecific();
|
A->ignoreTargetSpecific();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void toolchains::MinGW::AddClangCXXStdlibIncludeArgs(
|
void toolchains::MinGW::AddClangCXXStdlibIncludeArgs(
|
||||||
const ArgList &DriverArgs, ArgStringList &CC1Args) const {
|
const ArgList &DriverArgs, ArgStringList &CC1Args) const {
|
||||||
|
|
|
@ -288,9 +288,9 @@ struct _LIBCPP_TEMPLATE_VIS pair
|
||||||
|
|
||||||
# if _LIBCPP_STD_VER >= 23
|
# 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.
|
// 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() {
|
_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> ||
|
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>;
|
!is_convertible_v<decltype(std::get<1>(std::declval<_PairLike&&>())), second_type>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,8 +342,8 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
|
||||||
CHECK(c.getFullName(),
|
CHECK(c.getFullName(),
|
||||||
"could not get the filename for the member defining symbol " +
|
"could not get the filename for the member defining symbol " +
|
||||||
toCOFFString(ctx, sym));
|
toCOFFString(ctx, sym));
|
||||||
auto future = std::make_shared<std::future<MBErrPair>>(
|
auto future =
|
||||||
createFutureForFile(childName));
|
std::make_shared<std::future<MBErrPair>>(createFutureForFile(childName));
|
||||||
enqueueTask([=]() {
|
enqueueTask([=]() {
|
||||||
auto mbOrErr = future->get();
|
auto mbOrErr = future->get();
|
||||||
if (mbOrErr.second)
|
if (mbOrErr.second)
|
||||||
|
@ -645,21 +645,19 @@ void LinkerDriver::addClangLibSearchPaths(const std::string &argv0) {
|
||||||
|
|
||||||
SmallString<128> libDir(rootDir);
|
SmallString<128> libDir(rootDir);
|
||||||
sys::path::append(libDir, "lib");
|
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
|
// Add the resource dir library path
|
||||||
SmallString<128> runtimeLibDir(rootDir);
|
SmallString<128> runtimeLibDir(rootDir);
|
||||||
sys::path::append(runtimeLibDir, "lib", "clang", std::to_string(LLVM_VERSION_MAJOR), "lib");
|
sys::path::append(runtimeLibDir, "lib", "clang",
|
||||||
searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDir.str()));
|
std::to_string(LLVM_VERSION_MAJOR), "lib");
|
||||||
|
|
||||||
// Resource dir + osname, which is hardcoded to windows since we are in the
|
// Resource dir + osname, which is hardcoded to windows since we are in the
|
||||||
// COFF driver.
|
// COFF driver.
|
||||||
SmallString<128> runtimeLibDirWithOS(runtimeLibDir);
|
SmallString<128> runtimeLibDirWithOS(runtimeLibDir);
|
||||||
sys::path::append(runtimeLibDirWithOS, "windows");
|
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() {
|
void LinkerDriver::addWinSysRootLibSearchPaths() {
|
||||||
|
@ -1145,8 +1143,7 @@ void LinkerDriver::parseOrderFile(StringRef arg) {
|
||||||
if (set.count(s) == 0) {
|
if (set.count(s) == 0) {
|
||||||
if (ctx.config.warnMissingOrderSymbol)
|
if (ctx.config.warnMissingOrderSymbol)
|
||||||
warn("/order:" + arg + ": missing symbol: " + s + " [LNK4037]");
|
warn("/order:" + arg + ": missing symbol: " + s + " [LNK4037]");
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
ctx.config.order[s] = INT_MIN + ctx.config.order.size();
|
ctx.config.order[s] = INT_MIN + ctx.config.order.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1313,8 +1310,8 @@ void LinkerDriver::parsePDBAltPath() {
|
||||||
else if (var.equals_insensitive("%_ext%"))
|
else if (var.equals_insensitive("%_ext%"))
|
||||||
buf.append(binaryExtension);
|
buf.append(binaryExtension);
|
||||||
else {
|
else {
|
||||||
warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " +
|
warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " + var +
|
||||||
var + " as literal");
|
" as literal");
|
||||||
buf.append(var);
|
buf.append(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1448,8 +1445,8 @@ getVFS(const opt::InputArgList &args) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr), /*DiagHandler*/ nullptr,
|
if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr),
|
||||||
arg->getValue()))
|
/*DiagHandler*/ nullptr, arg->getValue()))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error("Invalid vfs overlay");
|
error("Invalid vfs overlay");
|
||||||
|
@ -1563,12 +1560,13 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
|
||||||
|
|
||||||
// Construct search path list.
|
// Construct search path list.
|
||||||
searchPaths.emplace_back("");
|
searchPaths.emplace_back("");
|
||||||
|
// Prefer the Clang provided builtins over the ones bundled with MSVC.
|
||||||
|
addClangLibSearchPaths(argsArr[0]);
|
||||||
for (auto *arg : args.filtered(OPT_libpath))
|
for (auto *arg : args.filtered(OPT_libpath))
|
||||||
searchPaths.push_back(arg->getValue());
|
searchPaths.push_back(arg->getValue());
|
||||||
detectWinSysRoot(args);
|
detectWinSysRoot(args);
|
||||||
if (!args.hasArg(OPT_lldignoreenv) && !args.hasArg(OPT_winsysroot))
|
if (!args.hasArg(OPT_lldignoreenv) && !args.hasArg(OPT_winsysroot))
|
||||||
addLibSearchPaths();
|
addLibSearchPaths();
|
||||||
addClangLibSearchPaths(argsArr[0]);
|
|
||||||
|
|
||||||
// Handle /ignore
|
// Handle /ignore
|
||||||
for (auto *arg : args.filtered(OPT_ignore)) {
|
for (auto *arg : args.filtered(OPT_ignore)) {
|
||||||
|
@ -2083,8 +2081,11 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
|
||||||
raw_svector_ostream stream(buffer);
|
raw_svector_ostream stream(buffer);
|
||||||
stream << "Library search paths:\n";
|
stream << "Library search paths:\n";
|
||||||
|
|
||||||
for (StringRef path : searchPaths)
|
for (StringRef path : searchPaths) {
|
||||||
|
if (path == "")
|
||||||
|
path = "(cwd)";
|
||||||
stream << " " << path << "\n";
|
stream << " " << path << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
message(buffer);
|
message(buffer);
|
||||||
}
|
}
|
||||||
|
@ -2342,7 +2343,8 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
|
||||||
std::vector<WrappedSymbol> wrapped = addWrappedSymbols(ctx, args);
|
std::vector<WrappedSymbol> wrapped = addWrappedSymbols(ctx, args);
|
||||||
// Load more object files that might be needed for wrapped symbols.
|
// Load more object files that might be needed for wrapped symbols.
|
||||||
if (!wrapped.empty())
|
if (!wrapped.empty())
|
||||||
while (run());
|
while (run())
|
||||||
|
;
|
||||||
|
|
||||||
if (config->autoImport || config->stdcallFixup) {
|
if (config->autoImport || config->stdcallFixup) {
|
||||||
// MinGW specific.
|
// MinGW specific.
|
||||||
|
|
|
@ -855,7 +855,7 @@ static MCSectionELF *selectELFSectionForGlobal(
|
||||||
Group = C->getName();
|
Group = C->getName();
|
||||||
IsComdat = C->getSelectionKind() == Comdat::Any;
|
IsComdat = C->getSelectionKind() == Comdat::Any;
|
||||||
}
|
}
|
||||||
if (isa<GlobalVariable>(GO)) {
|
if (isa<GlobalVariable>(GO) && !cast<GlobalVariable>(GO)->isThreadLocal()) {
|
||||||
if (TM.isLargeData()) {
|
if (TM.isLargeData()) {
|
||||||
assert(TM.getTargetTriple().getArch() == Triple::x86_64);
|
assert(TM.getTargetTriple().getArch() == Triple::x86_64);
|
||||||
Flags |= ELF::SHF_X86_64_LARGE;
|
Flags |= ELF::SHF_X86_64_LARGE;
|
||||||
|
|
Loading…
Reference in New Issue