Skip to content
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

libbpf-cargo: Stop treating clang arguments as a string #669

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Feb 8, 2024

Please see individual commits for descriptions.

Make the --debug option to the cargo-libbpf sub-command a global one.
This way, we don't have to list it everywhere and it can be provided in
more positions, not just after the sub-command.

Signed-off-by: Daniel Müller <[email protected]>
Factor out the ClangOpts type as a grouping of various clang related
options. In so doing we remove the need for a bunch of duplication and
make it easier to add new clang specific options in the future.

Signed-off-by: Daniel Müller <[email protected]>
It's horrible practice to treat program arguments as a simple string:
nobody knows how to parse them. The current splitting at whitespace
boundaries fails subtly or not so subtly the moment we have, say, spaces
in a file path or usage of quotations.
Work with a proper vector of arguments instead.

Signed-off-by: Daniel Müller <[email protected]>
With commit beff188 ("examples: Use vmlinux.h for current
architecture") we are having a hard time compiling the examples using
the cargo-libbpf command, because the vmlinux.h header file cannot be
found.
Introduce the --clang-args argument to allow for passing in additional
options -- such as an include path -- to the clang invocation. This
would also have helped with libbpf#337.

Signed-off-by: Daniel Müller <[email protected]>
@d-e-s-o d-e-s-o force-pushed the topic/clang-args branch 2 times, most recently from a574b09 to d9f6849 Compare February 8, 2024 23:49
@danielocfb danielocfb merged commit 0851b31 into libbpf:master Feb 9, 2024
12 checks passed
@danielocfb danielocfb deleted the topic/clang-args branch June 28, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants