[PATCH] D99556: Add support to -Wa,--version in clang

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 30 10:20:03 PDT 2021


nickdesaulniers added a comment.

In D99556#2657509 <https://reviews.llvm.org/D99556#2657509>, @MaskRay wrote:

> gcc does not understand options in `-Wa,` so `-Wa,--version` needs to be used this way: `gcc -Wa,--version -c -x assembler /dev/null -o /dev/null`
> The verbose syntax makes it not that useful. If the kernel really wants to use it, I have no issue with it.

I agree; the kernel only uses the compiler as the driver for assembler sources, as the kernel assembler is almost entirely `-x assembler-with-cpp`, so the C pre processor must be run first over the sources.  This is done to share important constants like the `PAGE_SIZE` between C and assembler.  For this reason, the maintainer of the kernel build system (Kbuild) would prefer to detect assembler version via `$(CC) -Wa,--version`.

@jcai19 would you mind adding a test like clang/test/Driver/version.c? clang/test/Driver/version.s perhaps?  Testing that there is some output from `-Wa,--version` might be helpful.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99556/new/

https://reviews.llvm.org/D99556



More information about the cfe-commits mailing list