This is an archive of the discontinued LLVM Phabricator instance.

Driver: Don't warn on -mbranch-protection when linking
ClosedPublic

Authored by tstellar on Mar 18 2022, 12:56 AM.

Details

Summary

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]

Diff Detail

Event Timeline

tstellar created this revision.Mar 18 2022, 12:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2022, 12:56 AM
tstellar requested review of this revision.Mar 18 2022, 12:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2022, 12:56 AM
vhscampos accepted this revision.Mar 18 2022, 1:49 AM

LGTM, thanks

This revision is now accepted and ready to land.Mar 18 2022, 1:49 AM
This revision was landed with ongoing or failed builds.Mar 22 2022, 11:18 PM
This revision was automatically updated to reflect the committed changes.