Go1.15 + SQLite Driver + Windows + Ld.exe results in ld error "unrecognized option --high-entropy-va"

1,759 views
Skip to first unread message

Corey Gilmore

unread,
Aug 13, 2020, 3:01:57 PM8/13/20
to golang-nuts
Setup:
- Go 1.15
- Windows 10 (2004)
- Ld.exe (via MingW via TDM-GCC), version 2.25

Prior to go1.15, running "go run main.go" or "go build" would work without issue.  With go1.15, the error "ld.exe: unrecognized option '--high-entropy-va'" occurs.  This seems to be due to go1.15 changing the default buildmode from exe to pie (https://golang.org/doc/go1.15#windows) as setting the buildmode (-buildmode=exe) when running "go run" or "go build" resolves the issue.

Looking into ld.exe, I do see that the "--high-entropy-va" flag is available although the error says it is unrecognized.  Odd...but this is also outside of my wheelhouse.

Running/building on WSL or Ubuntu using go1.15 works without issue.  This is strictly a Windows issue and specifically because of SQLite since it requires cgo.

Ian Lance Taylor

unread,
Aug 13, 2020, 3:13:51 PM8/13/20
to Corey Gilmore, golang-nuts
The --high-entropy-va option was added to the MingW linker in the GNU
binutils 2.26 release. You are using 2.25, which was released in
2014. The current version is 2.35. Is it possible for you to upgrade
to a newer version?

Ian

Corey Gilmore

unread,
Aug 13, 2020, 3:40:37 PM8/13/20
to golang-nuts
Updating ld (via binutils) to 2.33.1 in fixed the issue.  Looks like 2.33.1 is the newest available version via TDM-GCC.  Thanks for the help!

Sean O'Neil

unread,
Aug 14, 2020, 2:47:56 PM8/14/20
to golang-nuts
Never mind, I just noticed the original post answered it. Sorry, read it too quickly.


On Thursday, August 13, 2020 at 3:13:51 PM UTC-4 Ian Lance Taylor wrote:

Sean O'Neil

unread,
Aug 14, 2020, 2:47:56 PM8/14/20
to golang-nuts
Just upgraded from 1.12 to 1.15 and ran into this as well. What about those of us who can't so easily upgrade the version of MingW we're using?

Is there no way to disable that option when building cgo projects from the command-line? If not, does 1.14 use it, or do I have to go back even farther to get it working again?

Thanks,
Sean


On Thursday, August 13, 2020 at 3:13:51 PM UTC-4 Ian Lance Taylor wrote:
Reply all
Reply to author
Forward
0 new messages