-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/race: Race Detector and GCC 10.3.0 Problem #47119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A similar error was reported in #43195 (comment). It seems it may be caused by certain gcc toolchains, on Windows. |
Closing as a dup of #43195. |
Sorry but I don't believe this should have been closed. First, it is not the same a #43195 - the problem is mentioned in #43195 but not resolved there either. Also I do not believe it is related to a particular toolchain as I have reproduced it using all suggested toolchains using various gcc versions from 5.1 to 12.1. My own experience is that I had been building using the |
Please try using the |
I was experiencing the same problem, but this time—while cross-compiling on So, external linking helps; thanks, Ian. In my particular case, using
produces a fully-working executable without any errors ( On a side note, I admit it's a bit interesting that cross-compiling using the same setup to |
Hi,
I have been having problems building Go projects with race detector switched on. I suspect it has something to do with GCC 10.3.0. I wonder whether everyone else is having the same problem.
What version of Go are you using (
go version
)?go1.16.5 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Henry\AppData\Local\go-build
set GOENV=C:\Users\Henry\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Henry\Documents\Projects\Go\pkg\mod
set GONOPROXY=github.com/henryas
set GONOSUMDB=github.com/henryas
set GOOS=windows
set GOPATH=C:\Users\Henry\Documents\Projects\Go
set GOPRIVATE=github.com/henryas
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\Users\Henry\Programs\go\goroot
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\Users\Henry\Programs\go\goroot\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16.5
set GCCGO=gccgo
set AR=ar
set CC=C:\TDM-GCC-64\bin\gcc.exe
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\Henry\Documents\Projects\Go Projects\toy\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Henry\AppData\Local\Temp\go-build2138289623=/tmp/go-build -gno-record-gcc-switches
What did you do?
Build any project (even a simple Hello World project) with race detector switched on.
What did you expect to see?
It should build successfully.
What did you see instead?
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/libmsvcrt.a(/2203): duplicate symbol reference: _unlock_file in both
libgcc(.text) and libgcc(.data)
libgcc(.text): relocation target ___chkstk_ms not defined
libgcc(.text): relocation target atexit not defined
Is this a bug on Go's end or gcc's end?
The text was updated successfully, but these errors were encountered: