This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Update default arch on AIX
ClosedPublic

Authored by stevewan on Mar 2 2021, 5:42 PM.

Details

Summary

On AIX, the default arch level should match the minimum supported arch level of the OS version.

Diff Detail

Event Timeline

stevewan requested review of this revision.Mar 2 2021, 5:42 PM
stevewan created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2021, 5:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jsji accepted this revision.Mar 2 2021, 8:19 PM

LGTM. Thanks.

clang/lib/Driver/ToolChains/CommonArgs.cpp
405

Please add comments here about AIX 7.2's minimal arch is P7.

This revision is now accepted and ready to land.Mar 2 2021, 8:19 PM
jsji added inline comments.Mar 2 2021, 8:21 PM
clang/lib/Driver/ToolChains/CommonArgs.cpp
405

major == 7 should this be major <= 7 ? Or else, we may get pwr7 for AIX 5.1.

stevewan added inline comments.Mar 3 2021, 7:34 AM
clang/lib/Driver/ToolChains/CommonArgs.cpp
405

That's a great idea. Although I think we'd need to change major == 7 && minor < 2 to major < 7 || minor < 2 to also handle 4.3 and 5.3 properly. Let me know if you have further comments.

jsji added inline comments.Mar 3 2021, 7:46 AM
clang/lib/Driver/ToolChains/CommonArgs.cpp
403

micro unsed.

405

major < 7 || minor < 2 will have problem with AIX 8.1 later if we have AIX 8.

Maybe it is better to use
(major < 7 || (major == 7 && minor < 2))? "pwr4": "pwr7"

stevewan updated this revision to Diff 327798.Mar 3 2021, 7:47 AM

Address comments with regard to handling older AIX versions.

stevewan updated this revision to Diff 327803.Mar 3 2021, 8:05 AM

Improve handling different AIX versions.

stevewan marked 3 inline comments as done.Mar 3 2021, 8:06 AM
stevewan added inline comments.Mar 3 2021, 8:37 AM
clang/lib/Driver/ToolChains/CommonArgs.cpp
403

Sorry I missed this comment. I agree that the unused micro is a bit ugly, do you have a preference on how you'd like it to be improved? We don't have an existing query for only major and minor, and creating one seems unnecessary IMHO. If you think renaming the variable to unused_micro mitigates the problem, I can do that.

jsji accepted this revision.Mar 3 2021, 9:11 AM
jsji added inline comments.
clang/lib/Driver/ToolChains/CommonArgs.cpp
403

That's ok to me

stevewan updated this revision to Diff 327825.Mar 3 2021, 9:34 AM

Reflect varible is unused in its name.

stevewan marked 2 inline comments as done.Mar 3 2021, 9:35 AM
stevewan retitled this revision from Update default arch on AIX to [AIX] Update default arch on AIX.Mar 3 2021, 9:55 AM
This revision was landed with ongoing or failed builds.Mar 3 2021, 4:08 PM
This revision was automatically updated to reflect the committed changes.