We want to parse the -b option in the driver and pass it to the linker if the target OS is AIX. This will establish compatibility with the other AIX compilers.
Details
Diff Detail
Unit Tests
Time | Test | |
---|---|---|
900 ms | x64 debian > Clang.Driver::Xlinker-args.c | |
1,360 ms | x64 windows > Clang.Driver::Xlinker-args.c |
Event Timeline
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
262–269 | Can this be reversed so the error check is first for (!T.isOSAIX()) instead? Then you don't need the else. | |
clang/test/Driver/Xlinker-args.c | ||
15–16 | Does this mean that we need space between -b and the linker option when using clang normally? Or this an artifact of the way we need to write tests? |
clang/test/Driver/Xlinker-args.c | ||
---|---|---|
15–16 | Yes, since the option is defined as "JoinedOrSeparate" in the td file it wouldn't actually need the space. |
LGTM with small nit, thanks.
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
263 | nit, I prefer this error message but it's up to you. |
Thank you reviewing Zarko!
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
263 | I intentionally chose that error msg (without target mention) since that's the one the original option threw (existing '-b' option which was defined as unsupported for all the platforms). |
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
263 | I see, that makes sense. But now with your patch this option is supported even if only for the AIX target. So we could make the case to use the suggested error message. That said, I am still fine with what you choose. |
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
263 | I actually agree on your point. So, eventhough my intention was to leave the behavior on other (non-AIX) platforms unaffected, the change causes the behavior of the option to be more target-specific - since it's now valid/supported option on AIX. So, I am going to change this error message as suggested. Thanks! |
This seems to break tests everywhere, see e.g. https://lab.llvm.org/buildbot/#/builders/109/builds/19680
PTAL.
nit, I prefer this error message but it's up to you.