Skip to content

Commit 27e244f

Browse files
authored
[clang][AIX] Fix -print-runtime-dir on AIX (#104806)
Currently the option prints a path to a nonexistent directory with the full triple, `lib/powerpc64-ibm-aix7.2.0.0`. It should only be `lib/aix`.
1 parent 77523f9 commit 27e244f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ std::optional<std::string> ToolChain::getRuntimePath() const {
843843
llvm::sys::path::append(P, "lib");
844844
if (auto Ret = getTargetSubDirPath(P))
845845
return Ret;
846-
// Darwin does not use per-target runtime directory.
847-
if (Triple.isOSDarwin())
846+
// Darwin and AIX does not use per-target runtime directory.
847+
if (Triple.isOSDarwin() || Triple.isOSAIX())
848848
return {};
849849
llvm::sys::path::append(P, Triple.str());
850850
return std::string(P);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Test output of -print-runtime-dir on AIX
2+
3+
// RUN: %clang -print-runtime-dir --target=powerpc-ibm-aix \
4+
// RUN: -resource-dir=%S/Inputs/resource_dir \
5+
// RUN: | FileCheck --check-prefix=PRINT-RUNTIME-DIR %s
6+
7+
// RUN: %clang -print-runtime-dir --target=powerpc64-ibm-aix \
8+
// RUN: -resource-dir=%S/Inputs/resource_dir \
9+
// RUN: | FileCheck --check-prefix=PRINT-RUNTIME-DIR %s
10+
11+
// PRINT-RUNTIME-DIR: lib{{/|\\}}aix{{$}}

0 commit comments

Comments
 (0)