3 Commits

Author SHA1 Message Date
David Spickett
7e6a5fe160
[clang][bpf] Fix invalid RUN lines in stack protector warning test (#65251)
2 of them were missing the ":" on the end.

Adding them broke the test so I had to add a new prefix just for the
warning runs only.

I manually checked the first RUNs and there is no warning emitted, as
expected.
2023-09-14 10:24:26 +01:00
Yonghong Song
183d075055 [BPF][Clang] Fix func argument pattern in bpf-stack-protector test
Commit 56b038f887f3("[BPF][clang] Ignore stack protector options for BPF
target") added a test for its corresponding functionality.
Douglas Yung found that the test will fail with the release build
buildbot due to different func argument patterns (from %msg
to %0). This patch fixed the issue by using pattern [0-9a-z]+
which allows both %msg and %0.
2023-01-21 22:33:15 -08:00
Eduard Zingerman
56b038f887 [BPF][clang] Ignore stack protector options for BPF target
Stack protector builtin functions are not implemented for BPF target,
thus compiling programs with one of the following options would result
in an error:
  -fstack-protector
  -fstack-protector-all
  -fstack-protector-strong

This commit adds logic to ignore these options for BPF target.
Searching through DiagnosticDriverKinds.td shows that all messages for
such kind of behavior are implemented as warnings, this commit follows
the suit.

Here is an example of the diagnostic message:
  clang-16: warning: ignoring '-fstack-protector' option as it is not currently supported for target 'bpf' [-Woption-ignored]

Differential Revision: https://reviews.llvm.org/D142046
2023-01-20 15:12:43 -08:00