-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[PowerPC][clang] Fix triple constructor ambiguity causing "unknown" target triple on AIX #147488
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Test for the Triple constructor ambiguity fix on AIX | ||
| // This test verifies that the default target triple is correctly resolved | ||
| // and doesn't fall back to "unknown" due to constructor ambiguity. | ||
|
|
||
| // REQUIRES: system-aix | ||
| // RUN: %clang -v %s -c 2>&1 | FileCheck %s --check-prefix=CHECK-TARGET | ||
tonykuttai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Test that the target triple contains AIX and is not "unknown" | ||
| // The target should be something like "powerpc-ibm-aix7.3.0.0" | ||
| // CHECK-TARGET: Target: {{.*}}aix{{.*}} | ||
|
|
||
| int main() { | ||
| return 0; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ static std::string updateTripleOSVersion(std::string TargetTripleString) { | |
| // On AIX, the AIX version and release should be that of the current host | ||
| // unless if the version has already been specified. | ||
| if (Triple(LLVM_HOST_TRIPLE).getOS() == Triple::AIX) { | ||
|
||
| Triple TT(std::move(TargetTripleString)); | ||
| Triple TT{TargetTripleString}; | ||
| if (TT.getOS() == Triple::AIX && !TT.getOSMajorVersion()) { | ||
| struct utsname name; | ||
| if (uname(&name) != -1) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tonykuttai, this is not sufficient. The target also has to be AIX to begin with (as opposed to an AIX-hosted cross-compiling configuration).