Skip to content

Commit 6d91fcd

Browse files
committed
Fix/Debug
1 parent ff8bd1f commit 6d91fcd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,10 +954,12 @@ llvm::Triple ToolChain::getTripleWithoutOSVersion() const {
954954

955955
std::optional<std::string>
956956
ToolChain::getTargetSubDirPath(StringRef BaseDir) const {
957+
dbgs() << "getTargetSubDirPath: " << BaseDir << "\n";
957958
auto getPathForTriple =
958959
[&](const llvm::Triple &Triple) -> std::optional<std::string> {
959960
SmallString<128> P(BaseDir);
960961
llvm::sys::path::append(P, Triple.str());
962+
dbgs() << "getTargetSubDirPath: " << P << "\n";
961963
if (getVFS().exists(P))
962964
return std::string(P);
963965
return {};
@@ -1032,7 +1034,13 @@ std::optional<std::string> ToolChain::getRuntimePath() const {
10321034

10331035
std::optional<std::string> ToolChain::getStdlibPath() const {
10341036
SmallString<128> P(D.Dir);
1037+
if (Triple.isOSDarwin())
1038+
dbgs() << "getStdlibPath(): " << P << "\n";
10351039
llvm::sys::path::append(P, "..", "lib");
1040+
// Darwin does not use per-target runtime directory.
1041+
if (Triple.isOSDarwin())
1042+
return std::string(P);
1043+
dbgs() << "getStdlibPath(): " << P << "\n";
10361044
return getTargetSubDirPath(P);
10371045
}
10381046

@@ -1551,9 +1559,11 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
15511559

15521560
void ToolChain::AddFilePathLibArgs(const ArgList &Args,
15531561
ArgStringList &CmdArgs) const {
1554-
for (const auto &LibPath : getFilePaths())
1562+
for (const auto &LibPath : getFilePaths()) {
1563+
llvm::dbgs() << "LibPath: " << LibPath << "\n";
15551564
if(LibPath.length() > 0)
15561565
CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
1566+
}
15571567
}
15581568

15591569
void ToolChain::AddCCKextLibArgs(const ArgList &Args,

0 commit comments

Comments
 (0)