This change is breaking internal builds. We use the -Xfoo pattern but can
now no longer manage whether we allow an unused -Xfoo option to pass as a
warning or promote it to an error.
This reverts commit 98615fd376cea15af21e120e0e3ffa5ba68c2b6d.
Differential D139717
Revert "[Driver] Remove Joined -X" rsundahl on Dec 9 2022, 7:16 AM. Authored by
Details
This change is breaking internal builds. We use the -Xfoo pattern but can This reverts commit 98615fd376cea15af21e120e0e3ffa5ba68c2b6d.
Diff Detail
Event TimelineComment Actions This is missing a test, like the original commit mentioned. Comment Actions This breaks many projects internally. There's no real complexity to keep this around. Removing is more annoying than anything else. Comment Actions Do you have a justifying example showing which -Xpattern is used? It needs to do useful work, instead of just using an option which happened to be ignored (and probably not ignored by GCC). Comment Actions
Which -Xfoo is used? Do your internal builds reserve -Xfoo as a placeholder to do other non-upstream work? Then you can consider -Gfoo if your builds don't need the mips semantics. Comment Actions We use -Xcompiler and -Xlinker which are passed in programs and they raise error now. Comment Actions We use -Xparser
Possibly. Maybe preferably. Builds are breaking now though. Dependent projects would have to be notified and changes scheduled. Was there a diff that we should have been part of? It looks like at least two of us are surprised with downstream consequences. Comment Actions @MaskRay -- we can discuss options but we can't just "kill" options willy-nilly just because you don't use them. Let's add a test and revert this patch, then we can continue the discussion on how to phase this out. Comment Actions Sorry, I do not understand. clang -Xlinker --verbose a.c works well. -Xcompiler is invalid in GCC. How do your programs use -Xlinker or -Xcompiler. Comment Actions There are two possibilities. First, your downstream projects incorrectly pass a previously-ignored -Xparser. Then it seems the right call is to remove it. Second, there are many projects doing -Xparser and it was intentionally ignored. Another program would analyze -Xparser. For the second case, we can add an ignored Flag called -Xparser, with a comment which tool uses it. We should try avoiding a broad -X*. If you want to carve out a larger namespace, say, -Xparser*, it may be fine as well. But calling it IgnoreGCCCompat with some vendor-specific undocumented thing seems not right.
See the previous paragraph. And we need a clang/test/Driver test to catch accidental removal from other contributors. Comment Actions Xlinker still works. Xcompiler is failing. A google search will show that Xcompiler is a wide-spread option used by many packages. Whether or not GCC supports it is not relevant. Please do not remove options just because you do not use them. Comment Actions It is not. You first deprecate and then you remove. This commit needs to be reverted. HTH, D Comment Actions I added a test so we can catch any regression. If we choose to deprecate then we can modify the test to watch for the "is deprecated" message that should be asserted for "some time" appropriate. Thank you all for your input. Comment Actions Can you give an example how they use -Xcompiler? % gcc -Xcompiler,-fpic -c a.c gcc: error: unrecognized command-line option ‘-Xcompiler,-fpic’ % gcc -Xcompiler -fpic -c a.c gcc: error: unrecognized command-line option ‘-Xcompiler’; did you mean ‘--compile’? My commit message clearly says why the joined form is awkward and should be removed. Comment Actions -Xfoo leads to a warning (expected) which is weird. Can you change it to a form which actually reflects how -X is used? (aka -Xparser) I am not sure adding arbitrary -X* which leads to a -Wunused-command-line-argument warning is useful. It certainly leads to confusion why this is supported at all, if the needs are just -Xparser. Comment Actions This is not about the philosophical correctness of the patch, it's about the transition period and allowing consumers to migrate. Comment Actions -Xparser has always been leading to such a warning: warning: argument unused during compilation: '-Xparser' [-Wunused-command-line-argument], perhaps since forever when the option was added in the first place? Comment Actions Yes. it is. "unused" doesn't mean "will go away". Hope this helps. Comment Actions Sorry, it doesn't help. A compiler option used a linker option leading to a "unused" warning is very different from this case. In your case, at least as stated in the commit message, This change is breaking internal builds. (This message, if not from an affiliation with much contribution to Clang, might be conceived as weird by a casual contributor.) It seems that GCC < 4.6 reports g++: unrecognized option '-Xfoo' but exit with 0 while GCC >= 4.6 reports g++: error: unrecognized option '-Xaaa' and exits with 1. |