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

mirror: Set DESTDIR to empty when building libbpf #140

Merged
merged 1 commit into from
Apr 8, 2024
Merged

mirror: Set DESTDIR to empty when building libbpf #140

merged 1 commit into from
Apr 8, 2024

Conversation

dylanorz
Copy link
Contributor

@dylanorz dylanorz commented Apr 7, 2024

If a value is assigned to the variable DESTDIR when compiling bpftool, this variable will be passed to libbpf's Makefile.

In this case, libbpf's header files will be installed in an unexpected directory, causing bpftool to be unable to find the header files.

when run this command

OUTPUT=/root/output_3rd/bpftool_build/ DESTDIR=/root/output_3rd/bpftool_root/ V=1 make -j8 install

Part of the output is as follows, we can see that the path is wrong

make[1]: 进入目录“/root/bpftool/libbpf/src”
mkdir -p /root/output_3rd/bpftool_build/libbpf/staticobjs
if [ ! -d '/root/output_3rd/bpftool_root//root/output_3rd/bpftool_build/libbpf/include/bpf' ]; then install -d -m 755 '/root/output_3rd/bpftool_root//root/output_3rd/bpftool_build/libbpf/include/bpf'; fi;
cc -I. -I../include -I../include/uapi -g -O2 -Werror -Wall -std=gnu89 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wno-unknown-warning-option -Wno-format-overflow   -c bpf.c -o /root/output_3rd/bpftool_build/libbpf/staticobjs/bpf.o

Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I was not aware of the issue, but I can reproduce and the fix looks correct. It doesn't affect the Makefile in the kernel repo, so this mirror is the right place to submit.

I just have a request, could you please move DESTDIR to the same locations and order (with regards to PREFIX) as they appear in the Makefile from the kernel repo? The two Makefile are mostly similar, and keeping them as close as possible helps with sync-ups.

src/Makefile Outdated Show resolved Hide resolved
src/Makefile Outdated Show resolved Hide resolved
If a value is assigned to the variable DESTDIR when compiling bpftool,
this variable will be passed to libbpf's Makefile.

In this case, libbpf's header files will be installed in an unexpected
directory, causing bpftool to be unable to find the header files.

Signed-off-by: jinzhiguang <[email protected]>
@dylanorz dylanorz requested a review from qmonnet April 8, 2024 01:22
@dylanorz
Copy link
Contributor Author

dylanorz commented Apr 8, 2024

I just have a request, could you please move DESTDIR to the same locations and order (with regards to PREFIX) as they appear in the Makefile from the kernel repo? The two Makefile are mostly similar, and keeping them as close as possible helps with sync-ups.

I've modified this pr as per your suggestion

Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@qmonnet qmonnet merged commit 06c61ec into libbpf:main Apr 8, 2024
6 checks passed
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