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

fix linker issue #42

Merged
merged 1 commit into from
Oct 11, 2023
Merged

fix linker issue #42

merged 1 commit into from
Oct 11, 2023

Conversation

pettai
Copy link
Contributor

@pettai pettai commented Oct 11, 2023

fix linker issue
undefined reference to `zip_archive_open'

fix linker issue
"undefined reference to `zip_archive_open'" ...
@pettai
Copy link
Contributor Author

pettai commented Oct 11, 2023

Resolve this issue during make:

[...]
mkdir -p build/
clang -L/usr/lib/x86_64-linux-gnu -lconfig -lelf -lz -I modules/xdp-tools/lib/libbpf/src -I /usr/include -I /usr/local/include -o build/xdpfw modules/xdp-tools/lib/libbpf/src/staticobjs/bpf_prog_linfo.o modules/xdp-tools/lib/libbpf/src/staticobjs/bpf.o modules/xdp-tools/lib/libbpf/src/staticobjs/btf_dump.o modules/xdp-tools/lib/libbpf/src/staticobjs/btf.o modules/xdp-tools/lib/libbpf/src/staticobjs/gen_loader.o   modules/xdp-tools/lib/libbpf/src/staticobjs/hashmap.o modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf_errno.o modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf_probes.o  modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf.o modules/xdp-tools/lib/libbpf/src/staticobjs/linker.o modules/xdp-tools/lib/libbpf/src/staticobjs/netlink.o  modules/xdp-tools/lib/libbpf/src/staticobjs/nlattr.o modules/xdp-tools/lib/libbpf/src/staticobjs/relo_core.o modules/xdp-tools/lib/libbpf/src/staticobjs/ringbuf.o modules/xdp-tools/lib/libbpf/src/staticobjs/str_error.o modules/xdp-tools/lib/libbpf/src/staticobjs/strset.o modules/xdp-tools/lib/libbpf/src/staticobjs/usdt.o modules/xdp-tools/lib/libxdp/sharedobjs/xsk.o modules/xdp-tools/lib/libxdp/sharedobjs/libxdp.o build/config.o build/cmdline.o src/xdpfw.c
/usr/bin/ld: modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf.o: in function `elf_find_func_offset_from_archive':
/home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libbpf/src/libbpf.c:10893: undefined reference to `zip_archive_open'
/usr/bin/ld: /home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libbpf/src/libbpf.c:10900: undefined reference to `zip_archive_find_entry'
/usr/bin/ld: /home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libbpf/src/libbpf.c:10934: undefined reference to `zip_archive_close'
/usr/bin/ld: /home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libbpf/src/libbpf.c:10934: undefined reference to `zip_archive_close'
/usr/bin/ld: /home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libbpf/src/libbpf.c:10934: undefined reference to `zip_archive_close'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:60: xdpfw] Error 1

@gamemann gamemann merged commit cc1e033 into gamemann:master Oct 11, 2023
1 of 3 checks passed
gamemann added a commit that referenced this pull request Oct 11, 2023
@gamemann
Copy link
Owner

Hey, thanks for the PR! What Linux distro did you have this issue on along with kernel version? It causes a linking error on runtime since libxdp.so can't be found. I'm going to need to dig into this further when I have the time. I'm installing libxdp as well and running into the same issue.

@pettai
Copy link
Contributor Author

pettai commented Oct 12, 2023

Vanilla Ubuntu 22.04 running the latest kernel:

root@bygg-u2204:/home/pettai/XDP-Firewall# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
root@bygg-u2204:/home/pettai/XDP-Firewall# uname -a
Linux bygg-u2204 5.15.0-86-generic #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

But after a git pull and doing a make libxdp; make the problem wasn't there anymore 👍

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