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

cmake: always link to packaged libbpf if CMAKE_USE_LIBBPF_PACKAGE is set #3210

Merged
merged 2 commits into from
Jan 8, 2021

Conversation

bluca
Copy link
Contributor

@bluca bluca commented Jan 1, 2021

For some binaries, even if CMAKE_USE_LIBBPF_PACKAGE is set static linking is still used, breaking expectations. If the option to use the packaged version is set, it should be respected.

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@bluca
Copy link
Contributor Author

bluca commented Jan 4, 2021

CMake's NAME_WLE was introduced in v3.14, changed to NAME_WE which is available in older releases. Let's see if this works or it needs permissions:

@bluca
Copy link
Contributor Author

bluca commented Jan 4, 2021

[buildbot, test this please]

1 similar comment
@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song
Copy link
Collaborator

[buildbot, ok to test]

bluca added 2 commits January 5, 2021 11:07
Some of the executables still link to the local static versions
even if the user requested CMAKE_USE_LIBBPF_PACKAGE. Fix this by
using bcc-shared-no-libbpf more widely if the variable is set.
…PF_PACKAGE is set

Skip the git submodule and the extraction commands if the user
set CMAKE_USE_LIBBPF_PACKAGE
@bluca
Copy link
Contributor Author

bluca commented Jan 5, 2021

The build failure on the Ubuntu CIs was due to the order of linker flags being changed - on some compilers it matters. I've fix it and restored the original order - bpf-static first, then its dependencies (elf/zlib).

@bluca
Copy link
Contributor Author

bluca commented Jan 8, 2021

@yonghong-song gentle ping for review. We will be using these patches in the upcoming Debian 11 release (and as a consequence in the next Ubuntu release and other derivatives). TIA!

@yonghong-song
Copy link
Collaborator

The change looks good to me. Thanks!

@yonghong-song yonghong-song merged commit 300296a into iovisor:master Jan 8, 2021
@bluca bluca deleted the packaged_lib branch January 8, 2021 17:02
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
…set (iovisor#3210)

Some of the executables still link to the local static versions
even if the user requested CMAKE_USE_LIBBPF_PACKAGE. Fix this by
using bcc-shared-no-libbpf more widely if the variable is set.

Skip the git submodule and the extraction commands if the user
set CMAKE_USE_LIBBPF_PACKAGE
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