Skip to content

//go:linkname usage of runtime.gcController breaks with Go 1.23+ linkname checker #4

@rahulduvedi

Description

@rahulduvedi

The library uses //go:linkname to access runtime.gcController (rtml.go#L16-L29), which is an internal runtime symbol not in Go's linkname allowlist.

Since Go 1.23, the linker enforces -checklinkname=1 by default, which blocks access to unapproved internal symbols. This causes a build failure for any downstream consumers

The only workaround is -ldflags=-checklinkname=0, which disables the safety check for all dependencies not ideal for consumers concerned about runtime stability.
Could the library be updated to use a supported API (e.g., runtime/metrics or debug.ReadGCStats) instead of directly accessing runtime internals?

Thanks for all your work for the community on this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions