Description
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?