Skip to content
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

cmd/go: compatibility problems on Windows #28697

Closed
ChrainWang opened this issue Nov 9, 2018 · 7 comments
Closed

cmd/go: compatibility problems on Windows #28697

ChrainWang opened this issue Nov 9, 2018 · 7 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ChrainWang
Copy link

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

$ go version 1.11

Does this issue reproduce with the latest release?

Yes

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

Windows10 x64

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Chrain\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Chrain\go
set GORACE=
set GOROOT=c:\go
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
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\Chrain\AppData\Local\Temp\go-build839330466=/tmp/go-build -gno-record-gcc-switches

I have upgraded to version 1.11 several days ago, but it doesn't work well on Windows with MinGW tools. I have met two issues so far:

  1. Can not be debugged with gdb. The compiled file can not be recognized as an executable file, but it can be run directly out of gdb. (I've solved this problem by changing to delve, but as a result I can't use eclipse for coding golang anymore)
  2. Failed to build go-ethereum project on Windows (Following Ethereum's official guide of course). Keep getting error about undefined C functions

The old versions work well with out neither of the issues above. I think there are some problems in compatibility to Windows.

@ChrainWang ChrainWang reopened this Nov 9, 2018
@ChrainWang
Copy link
Author

I setup my environment in exactly the same way as I did with the old versions. Did I miss something?
If there is some problems with the Ver 1.11 on Windows, do u have a plan to make it better? Or shall I just let it go

@ALTree ALTree added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 9, 2018
@ALTree ALTree changed the title Compatibility problems on Windows cmd/go: compatibility problems on Windows Nov 9, 2018
@agnivade
Copy link
Contributor

@ChrainWang - We would need a little more details to move ahead with our investigation.

Specifically, we need to know exactly what you did (the steps to reproduce the issue), what did you see, and what did you expect to see.

Thank you.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 10, 2018
@AlexRouSg
Copy link
Contributor

Just to give another data point, I am unable to reproduce this on Windows 10 x64 with 1.11.2

  1. I see nothing similar to The compiled file can not be recognized as an executable file, however I did run into cmd/compile: gdb 8 on windows crashes reading Go binary #21380 which is a completely different issue.

  2. Compiling github.com/ethereum/go-ethereum/cmd/geth works just fine. From the description it sounds like a bad configuration/environment.

@ChrainWang
Copy link
Author

ChrainWang commented Nov 10, 2018

I confirmed my version is 1.11.1 and here is my go env:

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Chrain\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Chrain\go
set GOPROXY=
set GORACE=
set GOROOT=C:\go
set GOTMPDIR=
set GOTOOLDIR=C:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
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\Chrain\AppData\Local\Temp\go-build958967102=/tmp/go-build -gno-record-gcc-switches

My go file is like:

package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello World")
}

I built the file with go build -v -gcflags "-N -l", and got a main.exe. Then I ran the exe file in cmd, it worked well and printed "Hello World" as expected. But when I tried to run gdb main.exe, I got:

GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
BFD: D:\Users\Chrain\Documents\GoProjects\Test\src\main\main.exe: unable to initialize decompress status for section .zdebug_abbrev
"D:\Users\Chrain\Documents\GoProjects\Test\src\main/main.exe": not in executable format: Invalid operation

@ChrainWang
Copy link
Author

ChrainWang commented Nov 10, 2018

I add my Ethereum project path to gopath, so my go env would be:

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Chrain\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\Users\Chrain\Documents\GoProjects\Ethereum;C:\Users\Chrain\go
set GOPROXY=
set GORACE=
set GOROOT=C:\go
set GOTMPDIR=
set GOTOOLDIR=C:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
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\Chrain\AppData\Local\Temp\go-build246448442=/tmp/go-build -gno-record-gcc-switches

Then I followed the guide and went into go-ethereum directory and ran "go install -v ./cmd/..."
Below is what I got:

# github.com/ethereum/go-ethereum/cmd/abigen
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-118089567\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-118089567\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/p2psim
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-154323959\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-154323959\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/puppeth
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-691786155\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-691786155\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/bootnode
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-101380599\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/evm
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-208899555\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/faucet
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000008.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000008.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000015.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000015.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-236604651\000015.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/ethkey
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-195649495\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/clef
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-284512155\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/geth
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-242461227\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/swarm/swarm-smoke
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-318007971\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-318007971\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/wnode
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-030457663\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

# github.com/ethereum/go-ethereum/cmd/swarm
C:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000003.o: In function `default_error_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:39: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000003.o: In function `default_illegal_callback_fn':
D:\Users\Chrain\Documents\GoProjects\Ethereum\src\github.com\ethereum\go-ethereum\crypto\secp256k1/./libsecp256k1/src/secp256k1.c:29: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000018.o: In function `duk__console_log_helper':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: undefined reference to `__getreent'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:62: undefined reference to `__getreent'
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000018.o:/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c:64: more undefined references to `__getreent' follow
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000025.o: In function `duk_err_longjmp':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_error_longjmp.c:102: undefined reference to `_longjmp'
C:\Users\Chrain\AppData\Local\Temp\go-link-586068759\000025.o: In function `duk_bi_date_get_local_tzoffset_gmtime':
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:138: undefined reference to `gmtime_r'
/cygdrive/d/Users/Chrain/Documents/GoProjects/Ethereum/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3/duk_bi_date_unix.c:139: undefined reference to `localtime_r'
collect2.exe: error: ld returned 1 exit status

@AlexRouSg
Copy link
Contributor

I am still unable to reproduce your gdb message.

Please list the exact steps you took to update Go. And how did you install mingw and from where.
Also please try completely removing Go and all installations of mingw, and do a fresh install. Your build issues with ethereum are strongly indicating a issue with your setup.

A known good source of mingw is (at least tested on my end) https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download

@ChrainWang
Copy link
Author

ChrainWang commented Nov 10, 2018

What's really confusing is that everything works well with the old Go version.
I have both go1.11.1 and go1.10.5 in my system. All I do to switch the version is to rename the installation folders and the user space folders( as the gopath )
Thanks all the same. And I'll try re-setup my whole environment.

@golang golang locked and limited conversation to collaborators Nov 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants