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
bpf: Replace deprecated "-target bpf" with "--target=bpf" for clang #26553
Conversation
Passing the target to clang with "-target <name>" has been considered deprecated since clang 3.4 [0], released in 2013, in favour of the more recent syntax "--target=<name>". Let's update our code and documentation to use the recommended syntax. This replicates a similar patch submitted to the Linux kernel [1]. [0] llvm/llvm-project@274b6f0 [1] https://lore.kernel.org/all/20230624001856.1903733-1-maskray@google.com/ Signed-off-by: Quentin Monnet <quentin@isovalent.com>
/test |
FWIW, clang command line args seem like a mess. They mix double dashes, single dashes, space separated, equals separated. Another point to think about: what kind of flags does gcc accept? Might make it easier to experiment with bpf-gcc in the future if both compilers agree. |
@lmb Yep, I noticed :). I don't mind much between the two syntaxes to be honest, I simply thought it would be best to remain in sync with whatever the kernel goes with.
That's a good question. So apparently there's no direct equivalent to To compare with those used with clang: (There is a GCC does have a number of eBPF-related options though, none being identical to clang's, so the command line invocations won't be interchangeable anyway. Thanks for the reviews! |
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.
Looks good!
Passing the target to clang with
-target <name>
has been considered deprecated since clang 3.4, released in 2013, in favour of the more recent syntax--target=<name>
. Let's update our code and documentation to use the recommended syntax.This replicates a similar patch submitted to the Linux kernel.