cmd/compile: '_rt0_amd64_windows_lib' is not called when linking with VS2015 #30347
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
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
)?Does this issue reproduce with the latest release?
Yes (go1.11.5)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Compile any package with -buildmode=c-archive on Windows using Go1.11.5 and TDM-GCC-64 (mingw64). Link the library with a small application using VisualStudio 2015 and call any C exported Go function in the library.
What did you expect to see?
Function should be executed just like when the application was built with Mingw.
What did you see instead?
The application deadlocks when calling the function because runtime waits for the 'runtime_init_wait' object in src\runtime\cgo\gcc_libinit_windows.c:77. It looks like _rt0_amd64_windows_lib is never called if you link with VisualStudio 2015 (I suspect later versions have the same problem)
I also noted a warning during build "main.a(go.o) : warning LNK4078: multiple '.text' sections found with different attributes (60600060)" I'm not sure if this is the cause of the issue...?
Go_minimal_c-archive.zip
The text was updated successfully, but these errors were encountered: