Closed SamuelVeloce closed 10 months ago
@golang/windows
I think according to https://github.com/golang/go/wiki/cgo#windows linking with MSVC is not supported, though if it's easy to fix I don't think we'd be opposed to fixing it or accepting a change that fixes it. If you could bisect to the change that broke this, that would be helpful. Thanks.
CC @golang/compiler
As @mknyszek mentioned, linking with MSVC is not supported, not to mention that incremental linking adds another layer of complexity. Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, but it does NOT reproduce in
go1.20.6 windows/amd64
What operating system and processor architecture are you using (
go env
)?go env
OutputGo compiled from source using
GOOS=windows GOARCH=amd64
. Library compiled withGOOS=windows GOARCH=amd64
Running on windows 64bitWhat did you do?
Upgraded an existing (functional) go library from go1.20.6 to go1.21.4, compiled with
-buildmode=c-archive
. The runtime is initialised using_rt0_amd64_windows_lib
, as described in #42190 . This part works. In MSVC's linker settings,Enable Incremental Linking
is enabled. DisabledRandomized Base Address
to make the dump more readable.Disabling incremental linking solves the issue.
What did you expect to see?
Library is usable, no panic on startup.
What did you see instead?
Panic on launch (full message further below).
I've dumped the disassembly of the program (using
dumpbin /disasm
) to look at these addresses.0x140028277 is part of the incremental link table that gets generated for "Enable Incremental Linking". It jumps to go:buildid
0x140046e60 is the address of the first instruction of go:buildid
Full panic message