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

deprecation of directive //go:linkname #1471

Open
florianl opened this issue May 23, 2024 · 3 comments
Open

deprecation of directive //go:linkname #1471

florianl opened this issue May 23, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@florianl
Copy link
Contributor

florianl commented May 23, 2024

Describe the bug

This package makes use of the directive //go:linkname:

ebpf/internal/auxv.go

Lines 20 to 21 in 79b6759

//go:linkname runtime_getAuxv runtime.getAuxv
func runtime_getAuxv() []uintptr

With go.dev/issue/67401 an initiative was started to limited this directive. cilium/ebpf is already named as user of the runtime.getAuxv.

I'm not sure if there will be an exception for the use of runtime.getAuxv. Therefore an alternative approach should be investigated.

How to reproduce

The use of //go:linkname was introduced with fbff7db.

@florianl florianl added the bug Something isn't working label May 23, 2024
@lmb
Copy link
Collaborator

lmb commented May 23, 2024

I think it's really funny that x/sys/cpu gets to poke into the runtime just fine but we get put into the hall of shame xD Matter of fact is that auxv is useful on unix platforms, and the Go runtime doesn't give us access to it. Using the linkname is a lot better than the cruft we had before.

I'd be happy to migrate to some exported function if one existed (maybe via x/sys/unix?)

@lmb lmb added enhancement New feature or request and removed bug Something isn't working labels May 23, 2024
@lmb
Copy link
Collaborator

lmb commented May 23, 2024

@florianl are you interested in opening an upstream proposal for this?

@florianl
Copy link
Contributor Author

florianl commented Jun 20, 2024

Proposal was created with golang/go#68089. Follow up in golang/go#67839.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants