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

Building static libbpfgo fails in Makefile running in v0.2.5: /usr/bin/ld cannot found lXX #240

Open
zbh255 opened this issue Sep 9, 2022 · 4 comments

Comments

@zbh255
Copy link

zbh255 commented Sep 9, 2022

Run command make -C selftest/perfbuffers or make selftest-static-run

Out Error

/usr/lib/golang/pkg/tool/linux_amd64/link: running clang failed: exit status 1
/usr/bin/ld: cannot found -lelf
/usr/bin/ld: cannot found -lz
/usr/bin/ld: cannot found -lelf
/usr/bin/ld: cannot found -lz
/usr/bin/ld: cannot found -lelf
/usr/bin/ld: cannot found -lz
/usr/bin/ld: cannot found -lc
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

Linux Version

Fedora release 36 (Thirty Six)
Linux fedora 5.17.5 #2 SMP PREEMPT Sun Sep 4 19:24:15 CST 2022 x86_64 x86_64 x86_64 GNU/Linux

Libbpf Version

Name         : libbpf
Epoch        : 2
Version      : 0.7.0
Release      : 3.fc36
Architecture : x86_64
Size         : 356 k
Source       : libbpf-0.7.0-3.fc36.src.rpm
@rafaeldtinoco
Copy link
Contributor

Possible example on how to "solve" issues like this in Makefile: https://github.com/aquasecurity/tracee/blob/main/Makefile#L50

@sunhaotian0122
Copy link

I have the same problem, have you solved it?
Architecture:ARM64
clang version:clang-12

@geyslan
Copy link
Member

geyslan commented Sep 19, 2022

@geyslan
Copy link
Member

geyslan commented May 24, 2024

@zbh255 Would you mind trying against main? We've merged related fixes: #431

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

No branches or pull requests

4 participants