gollvm: multiple definition of 'runtime.nanotime..f' #53807
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
As shown in the sample code, since Nanotime is declared in both package main and packagea(using: //go:linkname Nanotime runtime.nanotime), and package packagea is imported to package main.
gofrontend creates the function descriptor with the same name "runtime.nanotime..f" for Nanotime in both packages main and packagea, resulting in a multiple definition error during the link phase.
What version of Go are you using (
go version
)?gollvm master
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The issue may be reproduced with the following sample:
go build linkname.go
File linkname.go
File packagea/a.go
What did you expect to see?
No error, successful build.
What did you see instead?
The text was updated successfully, but these errors were encountered: