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

Examples cannot be built on main without linker flag '-checklinkname=0' #15

Closed
paskozdilar opened this issue Jan 31, 2025 · 0 comments · Fixed by #16
Closed

Examples cannot be built on main without linker flag '-checklinkname=0' #15

paskozdilar opened this issue Jan 31, 2025 · 0 comments · Fixed by #16

Comments

@paskozdilar
Copy link
Contributor

paskozdilar commented Jan 31, 2025

I've cloned the repository, and tried to build examples. The following error appeared:

paskozdilar@workstation:~/stuff/go/packet/examples/arpspoofer$ go build
# github.com/irai/packet/examples/arpspoofer
link: golang.org/x/net/internal/socket: invalid reference to syscall.recvmsg
paskozdilar@workstation:~/stuff/go/packet/examples/arpspoofer$

Researching a bit, I've discovered that Go 1.23 is disallowing some //go:linkname directives that are used in some of the dependencies. Building with the linker flag -checklinkname=0 still works:

paskozdilar@workstation:~/stuff/go/packet/examples/arpspoofer$ go build -ldflags '-checklinkname=0'
paskozdilar@workstation:~/stuff/go/packet/examples/arpspoofer$

After some investigation, the issues seem related to the upgrade of the golang.org/x/net and golang.org/x/sys libraries.
Downgrading them to the version used in [email protected] makes builds work again.

I've created a PR that fixes this: #16

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 a pull request may close this issue.

1 participant