go: cmd/link: "x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large" after upgrading to Go 1.15

I have a Travis build that fails on Windows after upgrading to Go 1.15, see:

See: https://travis-ci.org/github/gohugoio/hugo/builds/717877247

Or more specific: https://travis-ci.org/github/gohugoio/hugo/jobs/717877253

x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 77173

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 23 (6 by maintainers)

Commits related to this issue

Most upvoted comments

This looks like a case of needing the flag -buildmode=exe when building Go programs for Windows that use CGo. Seems linking Windows ASLR executables is what is not working.

It met this problem also, can you tell me how to pass -buildmode=exe into CC, thanks!

buildmode is go command flag. See https://golang.org/cmd/go for details.

Alex

@gopherbot please backport to 1.15

buildmode=pie became the default in 1.15, so folks have to manually set buildmode=exe to work around this bug.