-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
build: Find feature headers outside system include dir #43946
Conversation
Spelling fix from review comments. Addresses: #43946 (comment)
Jakub has made some changes that conflicts with this that I need to consider how it should integrate. I'll rework this shortly. |
@jakule I've incorporated your libelf pkg-config changes and also started using pkg-config for libbpf too, pinning to the specific version we require. I'm not sure if I got a little silly using This still conflicts because I need to rebase, but the contents of this PR is what the final version would look like if you just view the full file (common.mk). |
Use `pkg-config` / `pkgconf` to find the specific version of `libbpf` that we want to link to as well as the dependent libraries such as `libelf`, `libz`, and sometimes `libzstd`. This resolves the variable dependency on `libzstd` depending on the base OS. We still take preference of `/lib/libbpf-$(LIBBPF_VER)` if it exists as it does for the standard buildbox, but that is deprecated and will be removed when we move to the new buildbox. If there is no `libelf.pc` config, fall back to hard-coded libraries as it was previously. Again, this is for use with our existing CentOS 7 buildbox. This cleans up the BPF detection in `common.mk` as it had some head-scratching failure modes when clang or llvm-strip were not found. The logic for enabling BPF is clearer now and safer.
When looking for the PAM header `pam_appl.h` to determine if PAM should be enabled in teleport, first look in the directories specified in the `C_INCLUDE_PATH` environment variable before checking the system header directories. The buildbox-ng has per-architecture include directories and configures `C_INCLUDE_PATH` to find the correct headers. Fall back to the existing default directories if not found in `C_INCLUDE_PATH`.
acfe4a3
to
8adc16c
Compare
I've updated this PR to squash the commits together as that was the easiest way to resolve the conflicts, which I then rebased with I'll merge this tomorrow morning my time in case there are any further objections or comments. |
Look for PAM and BPF header files that control including features in
teleport binaries more generally instead of assuming they are in the
system include headers or the one location in the buildbox (for libbpf
in
/usr/libbpf-1.2.2
).This allows a cross-compiler to be used that sets the standard
environment variables
C_INCLUDE_PATH
andLIBRARY_PATH
to point towhere additional headers and libraries live.
This cleans up the BPF detection in
common.mk
as it had somehead-scratching failure modes when clang or llvm-strip were not found.
The logic for enabling BPF is clearer now and safer.
Make
IS_NATIVE_BUILD
into a proper make variable - empty means false,non-empty means true, and adjust the Makefile where it is used.