Skip to content

[clang][AIX] Fix -print-runtime-dir on AIX #104806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Conversation

jakeegan
Copy link
Member

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.

@jakeegan jakeegan requested a review from daltenty August 19, 2024 15:47
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Aug 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 19, 2024

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: Jake Egan (jakeegan)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/104806.diff

1 Files Affected:

  • (modified) clang/lib/Driver/ToolChain.cpp (+2-2)
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 0e8577b1115e3..4059730fa3665 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -831,8 +831,8 @@ std::optional<std::string> ToolChain::getRuntimePath() const {
   llvm::sys::path::append(P, "lib");
   if (auto Ret = getTargetSubDirPath(P))
     return Ret;
-  // Darwin does not use per-target runtime directory.
-  if (Triple.isOSDarwin())
+  // Darwin and AIX does not use per-target runtime directory.
+  if (Triple.isOSDarwin() || Triple.isOSAIX())
     return {};
   llvm::sys::path::append(P, Triple.str());
   return std::string(P);

@daltenty
Copy link
Member

I think you should add a test similar to this one: https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/darwin-print-runtime-dir.c

Copy link
Member

@daltenty daltenty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jakeegan jakeegan merged commit 27e244f into llvm:main Sep 2, 2024
8 checks passed
@jakeegan jakeegan deleted the aixrtdir branch September 2, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants