cmd/link: crash on custom scenario #56685
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.19.2 linux/amd64
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?
I tried to create a c-archive that links to Go symbols used by it in runtime, instead of including the whole runtime/go stdlib.
This happens even on the simple program:
Then compile steps:
go tool compile -shared -dynlink main.go
^^ This creates a file that seems correct.
go tool link -buildmode=c-archive -extld clang -extldflags='-undefined dynamic_lookup' -w -installsuffix /tmp -o main.a main.o
What did you expect to see?
Output fail
main.a
includes only wanted functions, which I can further link later on to a binary.What did you see instead?
The text was updated successfully, but these errors were encountered: