Page MenuHomePhabricator

[AIX] Emit error for -G option on AIX

Authored by Xiangling_L on Oct 21 2020, 10:29 AM.


  1. Emit error for -G driver option on AIX
  2. Adjust cmake file to use -Wl,-G instead of -G

Rationale to error on -G:
On AIX, legacy XL compiler uses -G to produce a shared object enabled for use with the run-time linker, which has different meanings from what it is used for in Clang. And in Clang, other targets do not have -G map to another functionality in their legacy compiler. So this error is more important when we are on AIX.

Diff Detail

Event Timeline

Xiangling_L created this revision.Oct 21 2020, 10:29 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 21 2020, 10:29 AM
Xiangling_L requested review of this revision.Oct 21 2020, 10:29 AM

Could we add some rationale to the patch summary about why we would want to deliberately emitting an error for AIX?


Question: When do we query RawTriple, and when we should query Triple?

Xiangling_L marked an inline comment as done.Oct 21 2020, 2:02 PM
Xiangling_L added inline comments.

RawTriple in this function means the triple you passed in or the default one.

Triple in this function means a ToolChain's effective triple.
An effective triple is:

the Clang triple to use for this target, which may take into account the command line arguments. For example, on Darwin the -mmacosx-version-min= command line argument (which
sets the deployment target) determines the version in the triple passed to Clang.

So I feel, if there is no special condition we need to consider, we just use RawTriple.

Xiangling_L edited the summary of this revision. (Show Details)Oct 21 2020, 2:08 PM

Does this need a call to not?


Either remove the braces here or add braces for the outer block.

Refer to the

// Use braces for the outer `if` since the nested `for` is braced.

example under

Xiangling_L marked 3 inline comments as done.Oct 22 2020, 8:37 AM
Xiangling_L added inline comments.

Using not will fail the testcase.

Xiangling_L marked an inline comment as done.

Fix the formatting issues;

LGTM; thanks!


Got it; didn't know -### has such an effect on the return code.

This revision is now accepted and ready to land.Oct 22 2020, 9:01 AM
This revision was automatically updated to reflect the committed changes.