8000 Windows 10 build failed: running gcc failed: exit status 1 · Issue #78 · DataDog/zstd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Windows 10 build failed: running gcc failed: exit status 1 #78

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

Closed
flerka opened this issue Jan 27, 2020 · 2 comments
Closed

Windows 10 build failed: running gcc failed: exit status 1 #78

flerka opened this issue Jan 27, 2020 · 2 comments

Comments

@flerka
Copy link
flerka commented Jan 27, 2020

What version of Go are you using (go version)?

go version go1.13.6 windows/amd64

What operating system and processor architecture are you using (go env)?

Windows 10

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\homepc\AppData\Local\go-build
set GOENV=C:\Users\homepc\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\homepc\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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\homepc\AppData\Local\Temp\go-build692364802=/tmp/go-build -gno-record-gcc-switches

What did you do?

Build in windows 10 failed

C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000004.o: In function `COVER_buildDictionary':
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:678: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:678: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:714: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:714: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:710: undefined reference to `__getreent'
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000004.o:/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:710: more undefined references to `__getreent' follow
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000006.o: In function `ss_mintrosort':
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:495: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:494: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:509: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:499: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:498: undefined reference to `__assert_func'
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000006.o:/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:513: more undefined references to `__assert_func' follow
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000009.o: In function `FASTCOVER_ctx_init':
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:311: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:311: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:318: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:318: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:324: undefined reference to `__getreent'
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000009.o:/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:324: more undefined references to `__getreent' follow
collect2.exe: error: ld returned 1 exit status

What did you expect to see?

Should build successfully

What did you see instead?

I initially got gcc not found error, so I installed TDM-GCC-64 and add path C:\TDM-GCC-64\bin, then, I got above error

I think it's related to this issue #63

Basic example from cgo (https://golang.org/cmd/cgo/, where C code may call function pointers received ...) compiles and runs successfully, so I don't think there are some problems with my local installation.

@Viq111
Copy link
Collaborator
Viq111 commented Jan 27, 2020

Hi @flerka
Thanks for reporting!
I don't have a windows env on hand but it looks like you might not be able to correctly link the standard library (i.e: __assert_func should be given by assert package)

From looking around, it looks like most of the time it's trying to link against the 32bits library, would you have a way to check that ?

The basic example from cgo works because it doesn't link any external code, just compile everything in the same file

@flerka
Copy link
Author
flerka commented Jan 28, 2020

Hi @Viq111.
Thank you for your answer

From looking around, it looks like most of the time it's trying to link against the 32bits library, would you have a way to check that ?

You were totally right about that. Before installing 64 version of go, 32 version was installed accidently. And even after it (32bit go) was uninstalled and 64bit go installed - some folders were not deleted from 32bit env. Some packages etc.

So after reading your message I uninstalled go and manually removed all go-related files from all go env folders. I again installed 64bit Go and problem was fixed.

@flerka flerka closed this as completed Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0