Build error with cmount on Windows: "export ordinal too large"

Building rclone with cmount has stopped working in my Windows dev environment. I get an error from ld.exe: "export ordinal too large". May have started after an upgrade of go and/or gcc, but not sure (its been a while, and a few updates since last - then successful - attempt). Anyone else experiencing this? Or know of a solution? If not, then perhaps can tip me of a working combination of versions.

Versions:

go version go1.15.7 windows/amd64
gcc.exe (Rev6, Built by MSYS2 project) 10.2.0

Command:

go build -x -ldflags -s -tags cmount

Output (partial with edits):

Go\\Root\\pkg\\tool\\windows_amd64\\link.exe" -o "$WORK\\b001\\exe\\a.out.exe" -importcfg "$WORK\\b001\\importcfg.link" -buildmode=pie -buildid=(removed) -s -extld=gcc "$WORK\\b001\\_pkg_.a"
Go\Root\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: error: export ordinal too large: 67773
collect2.exe: error: ld returned 1 exit status

We fixed that in the production builds by adding -buildmode exe to the build command.

This is a temporary workaround - it will get fixed in go sooner or later

1 Like

Just upgraded to Go 1.16, now it builds fine without the additional -buildmode exe option (on windows/amd64).

1 Like

Thanks for that report @albertony :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.