This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Driver] Recognize the AIX OBJECT_MODE environment setting
ClosedPublic

Authored by daltenty on Jun 24 2020, 9:26 AM.

Details

Summary

AIX uses an environment variable called OBJECT_MODE to indicate to
utilities in the toolchain whether they should be operating in 32-bit or
64-bit mode. This patch makes the clang driver recognize the current
OBJECT_MODE setting when we are operating with an AIX target and adds a
custom diagnostic for invalid settings.

For more details about OBJECT_MODE on AIX see:

https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.3/com.ibm.xlc1313.aix.doc/compiler_ref/tusetenv1.html
https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.3/com.ibm.xlc1313.aix.doc/compiler_ref/opt_3264.html

Diff Detail

Event Timeline

daltenty created this revision.Jun 24 2020, 9:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2020, 9:26 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jasonliu accepted this revision.Jul 8 2020, 12:33 PM
jasonliu added a subscriber: jasonliu.

LGTM.

This revision is now accepted and ready to land.Jul 8 2020, 12:33 PM
hubert.reinterpretcast marked an inline comment as done.

LGTM with minor nit.

clang/lib/Driver/Driver.cpp
479

Just a note: I guess having an AIX target is an okay proxy for being on AIX here... I don't think enabling OBJECT_MODE for other targets when building on AIX is superior.

clang/test/Driver/aix-object-mode.c
2

Minor nit: Add "that" between "Check" and "setting".

daltenty marked an inline comment as done.Jul 9 2020, 12:12 PM
This revision was automatically updated to reflect the committed changes.