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

Incompatible with Go 1.23, which doesn't allow //go:linkname to internal symbols, including to net package #247

Open
stefanb opened this issue Jun 25, 2024 · 5 comments

Comments

@stefanb
Copy link

stefanb commented Jun 25, 2024

While testing Go 1.23 rc1 in

there was an error:

  go: downloading github.com/tsosunchia/powclient v0.1.5
  # github.com/nxtrace/NTrace-core
  link: github.com/nxtrace/NTrace-core/trace/internal: invalid reference to net.internetSocket

Go 1.23 no longer allows //go:linkname * net.* link instructioins, see

It is used several times in this module, see:

//go:linkname internetSocket net.internetSocket
func internetSocket(ctx context.Context, net string, laddr, raddr any, sotype, proto int, mode string, ctrlCtxFn func(context.Context, string, string, syscall.RawConn) error) (fd unsafe.Pointer, err error)
//go:linkname newIPConn net.newIPConn
func newIPConn(fd unsafe.Pointer) *net.IPConn

@fakeboboliu
Copy link
Contributor

internetSocket is required to make a root-less ping on macOS, consider add -checklinkname=0 to build flags.

@tsosunchia
Copy link
Member

69588b0
This project has updated the Golang version to v1.23

@tsosunchia tsosunchia reopened this Jan 17, 2025
@stefanb
Copy link
Author

stefanb commented Jan 17, 2025

Legit, but interesting to see that -ldflags=-checklinkname=0 workaround was chosen.

@tsosunchia
Copy link
Member

Legit, but interesting to see that -ldflags=-checklinkname=0 workaround was chosen.

After weighing the options, this seems like the best choice.

@stefanb
Copy link
Author

stefanb commented Jan 17, 2025

FYI, go 1.24 is around the corner (1.24rc2 already released) so you might want to give it a quick test.

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

3 participants