-
Notifications
You must be signed in to change notification settings - Fork 3.4k
bpf|loader: keep CFLAGS (CLANG_FLAGS) in sync between loader and BPF unit tests #39636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
On this:
It's either this, or fixing the existing issues (many I suspect, but some come from common headers). Also mind (in the last commit message):
Some errors...
cc @ti-mo |
0c8689d
to
b5b0fb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! I think we could do the same for -mcpu
in a follow-on PR.
One note below. Besides that, could you please re-order the patch series? First harmonize the use of -std
and -Wdeclaration-after-statement
, and only de-dup the two paths when they're truly identical.
8559b80
to
c3c2eb4
Compare
Nice, and thanks for rebase to pick up clang 19.1.7 #39632 |
Reordered.
Added the patch here c3c2eb4. As discussed in the commit message, I am not sure if it's worth. |
Yes, my suggestion was to explore this in a follow-on PR (and not expand the scope of this PR). 👍 |
c3c2eb4
to
a2cd19b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you!
Confused about one part in the patch description though:
Unit test machinery and some tests declare after statement, and checkpatch will anyhow spot them.
I find the "checkpatch will warn" aspect difficult to believe. Did we just ignore all those warnings when adding such code in the unit tests?
Well.. explored it is/was, then 😃. Dropped last commit.
You are right, even passing I will drop it from the patch info, if that's ok. Details of checkpatch.pl and an offending commit
But.. that made me realise, there is also this in It seems to me that |
Have a look at how this is used in CI for build testing ( |
Use gnu99 instead of gnu89, to be aligned with BPF unit tests. Signed-off-by: Marc Suñé <marc.sune@isovalent.com>
Remove -Wdeclaration-after-statement from default CLANG flags. Unit test machinery and some tests declare after statement. Signed-off-by: Marc Suñé <marc.sune@isovalent.com>
Prior to this commit BPF unit tests ran with their own set of CFLAGS, (CLANG_FLAGS). They were manually synced to match loader's CFLAGS. This commit reads the golang base CFLAGS definition and uses it as base CFLAGS for the unit tests. Some adjustments will come in upcoming commits. Signed-off-by: Marc Suñé <marc.sune@isovalent.com> Signed-off-by: Alexandre Perrin <alex@isovalent.com>
a2cd19b
to
411198c
Compare
Mention in the commit description dropped. Should be ready to merge now.
ACK. I will align (shared |
cc @ti-mo |
/test |
@cilium/loader I feel this would be a good improvement to merge, wdyt? |
Prior to this commit BPF unit tests ran with their own set of
CFLAGS
(
CLANG_FLAGS
). They were manually synced to match loader'sCFLAGS
.This commit reads the golang base
CFLAGS
definition and uses it asbase
CFLAGS
for the unit tests.This patchset also:
gnu99
-Wdeclaration-after-statement
. See the following message within this PR for the context.