Driver: Don't warn on -mbranch-protection when linking
authorTom Stellard <tstellar@redhat.com>
Wed, 23 Mar 2022 06:17:39 +0000 (23:17 -0700)
committerTom Stellard <tstellar@redhat.com>
Wed, 23 Mar 2022 06:17:42 +0000 (23:17 -0700)
commit98fd3b359866f474ab1c097c22fb5c3be356b996
tree18c3151003e6f9535e561b2d015d1f37fc218549
parent51433662e2cc8329892a70838095de414cfaaacc
Driver: Don't warn on -mbranch-protection when linking

The -mbranch-protection definition in Options.td was not given a Group,
so this was causing clang to emit a -Wunused-command-line-argument
warning when this flag was passed to the linker driver.  This was a
problem, because some build systems, like cmake, automatically pass the
C flags to the linker.  Therefore, any program that was compiled with
-Werror and -mbranch-protection would fail to link with the error:

argument unused during compilation: '-mbranch-protection=standard' [-Werror,-Wunused-command-line-argument]

Reviewed By: vhscampos

Differential Revision: https://reviews.llvm.org/D121983
clang/include/clang/Driver/Options.td
clang/test/Driver/Inputs/main.c [new file with mode: 0644]
clang/test/Driver/aarch64-security-options.c