Unable to compile on windows using Go 1.15 #5891

Closed
opened 2025-11-02 06:39:30 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @iamdoubz on GitHub (Aug 24, 2020).

  • Gitea version (or commit ref): 1.12.3+16-g4a548a033 AND 1.13.0+dev-464-g63f3c42be
  • Git version: 2.28.0.windows.1
  • Operating system: Windows 10 2004 Pro x64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When rebuilding Gitea v1.12 for Go v1.15.0, I get a make error.

...
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v  -tags 'bindata sqlite sqlite_unlock_notify' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.3" -X "main.Version=1.12.3+16-g4a548a033" -X "main.Tags=bindata sqlite sqlite_unlock_notify"' -o gitea.exe
...
code.gitea.io/gitea/routers/admin
code.gitea.io/gitea/routers/api/v1/repo
code.gitea.io/gitea/routers/api/v1/user
code.gitea.io/gitea/routers/api/v1/admin
code.gitea.io/gitea/routers/api/v1/org
code.gitea.io/gitea/routers/api/v1
code.gitea.io/gitea/routers/routes
code.gitea.io/gitea/cmd
code.gitea.io/gitea
# code.gitea.io/gitea
C:\Tools\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/Tools/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 79462
collect2.exe: error: ld returned 1 exit status

make: *** [Makefile:521: gitea.exe] Error 2

When rebuilding Gitea v1.13 for Go v1.15.0, I get a make error as well:

...
generating bindata for options
writing bindata.go
generating bindata for public
writing bindata.go
generating bindata for templates
writing bindata.go
CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v  -tags 'bindata sqlite sqlite_unlock_notify' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.3" -X "main.Version=1.13.0+dev-464-g63f3c42be" -X "main.Tags=bindata sqlite sqlite_unlock_notify"' -o gitea.exe
...
code.gitea.io/gitea/routers
code.gitea.io/gitea/routers/admin
code.gitea.io/gitea/routers/api/v1/repo
code.gitea.io/gitea/routers/api/v1/user
code.gitea.io/gitea/routers/api/v1/admin
code.gitea.io/gitea/routers/api/v1/org
code.gitea.io/gitea/routers/api/v1
code.gitea.io/gitea/routers/routes
code.gitea.io/gitea/cmd
code.gitea.io/gitea
# code.gitea.io/gitea
C:\Tools\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/Tools/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 96057
collect2.exe: error: ld returned 1 exit status

make: *** [Makefile:545: gitea.exe] Error 2

Screenshots

N/A

Originally created by @iamdoubz on GitHub (Aug 24, 2020). - Gitea version (or commit ref): 1.12.3+16-g4a548a033 AND 1.13.0+dev-464-g63f3c42be - Git version: 2.28.0.windows.1 - Operating system: Windows 10 2004 Pro x64 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description When rebuilding Gitea v1.12 for Go v1.15.0, I get a make error. ``` ... bindata for options already up-to-date bindata for public already up-to-date bindata for templates already up-to-date CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v -tags 'bindata sqlite sqlite_unlock_notify' -ldflags '-s -w -X "main.MakeVersion=GNU Make 4.3" -X "main.Version=1.12.3+16-g4a548a033" -X "main.Tags=bindata sqlite sqlite_unlock_notify"' -o gitea.exe ... code.gitea.io/gitea/routers/admin code.gitea.io/gitea/routers/api/v1/repo code.gitea.io/gitea/routers/api/v1/user code.gitea.io/gitea/routers/api/v1/admin code.gitea.io/gitea/routers/api/v1/org code.gitea.io/gitea/routers/api/v1 code.gitea.io/gitea/routers/routes code.gitea.io/gitea/cmd code.gitea.io/gitea # code.gitea.io/gitea C:\Tools\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 C:/Tools/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 79462 collect2.exe: error: ld returned 1 exit status make: *** [Makefile:521: gitea.exe] Error 2 ``` When rebuilding Gitea v1.13 for Go v1.15.0, I get a make error as well: ``` ... generating bindata for options writing bindata.go generating bindata for public writing bindata.go generating bindata for templates writing bindata.go CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v -tags 'bindata sqlite sqlite_unlock_notify' -ldflags '-s -w -X "main.MakeVersion=GNU Make 4.3" -X "main.Version=1.13.0+dev-464-g63f3c42be" -X "main.Tags=bindata sqlite sqlite_unlock_notify"' -o gitea.exe ... code.gitea.io/gitea/routers code.gitea.io/gitea/routers/admin code.gitea.io/gitea/routers/api/v1/repo code.gitea.io/gitea/routers/api/v1/user code.gitea.io/gitea/routers/api/v1/admin code.gitea.io/gitea/routers/api/v1/org code.gitea.io/gitea/routers/api/v1 code.gitea.io/gitea/routers/routes code.gitea.io/gitea/cmd code.gitea.io/gitea # code.gitea.io/gitea C:\Tools\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 C:/Tools/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 96057 collect2.exe: error: ld returned 1 exit status make: *** [Makefile:545: gitea.exe] Error 2 ``` ## Screenshots N/A
Author
Owner

@6543 commented on GitHub (Aug 24, 2020):

@iamdoubz it is because of the sqlite3 support - if you dont need sqlite3 you can compile it with go 1.15 on windows

it's a windows related issue only

@6543 commented on GitHub (Aug 24, 2020): @iamdoubz it is because of the sqlite3 support - if you dont need sqlite3 you can compile it with go 1.15 on windows it's a windows related issue only
Author
Owner

@iamdoubz commented on GitHub (Aug 24, 2020):

Is there a known workaround?

@iamdoubz commented on GitHub (Aug 24, 2020): Is there a known workaround?
Author
Owner

@6543 commented on GitHub (Aug 24, 2020):

:( no

@6543 commented on GitHub (Aug 24, 2020): :( no
Author
Owner

@techknowlogick commented on GitHub (Aug 24, 2020):

@iamdoubz thanks for reporting this :) Sadly we also have noticed this. I hope to report this upstream to golang itself. Could you assist me with some information that is needed for me to do so?

I require the output of the following two commands (my access to windows is limited and so I am unable to run these myself)

$ go version
$ go env
@techknowlogick commented on GitHub (Aug 24, 2020): @iamdoubz thanks for reporting this :) Sadly we also have noticed this. I hope to report this upstream to golang itself. Could you assist me with some information that is needed for me to do so? I require the output of the following two commands (my access to windows is limited and so I am unable to run these myself) ``` $ go version $ go env ```
Author
Owner

@iamdoubz commented on GitHub (Aug 24, 2020):

:( no

Sad day.

@iamdoubz thanks for reporting this :) Sadly we also have noticed this. I hope to report this upstream to golang itself. Could you assist me with some information that is needed for me to do so?

I require the output of the following two commands (my access to windows is limited and so I am unable to run these myself)

$ go version
$ go env

I would be more than happy to help.

You should be so lucky to not be so intertwined, rather hard coded, in the Windows environment :/

go version:

iamdoubz@computerMINGW64 ~/Gits/Gitea/12 (release/v1.12)
$ go version
go version go1.15 windows/amd64

go env:

iamdoubz@computer MINGW64 ~/Gits/Gitea/12 (release/v1.12)
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\iamdoubz\AppData\Local\go-build
set GOENV=C:\Users\iamdoubz\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\iamdoubz\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\iamdoubz\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Tools\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Tools\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\iamdoubz\Gits\Gitea\12\go.mod
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\iamdoubz\AppData\Local\Temp\go-build163858050=/tmp/go-build -gno-record-gcc-switches
@iamdoubz commented on GitHub (Aug 24, 2020): > :( no Sad day. > @iamdoubz thanks for reporting this :) Sadly we also have noticed this. I hope to report this upstream to golang itself. Could you assist me with some information that is needed for me to do so? > > I require the output of the following two commands (my access to windows is limited and so I am unable to run these myself) > > ``` > $ go version > $ go env > ``` I would be more than happy to help. You should be so lucky to not be so intertwined, rather hard coded, in the Windows environment :/ **go version**: ``` iamdoubz@computerMINGW64 ~/Gits/Gitea/12 (release/v1.12) $ go version go version go1.15 windows/amd64 ``` **go env**: ``` iamdoubz@computer MINGW64 ~/Gits/Gitea/12 (release/v1.12) $ go env set GO111MODULE= set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\iamdoubz\AppData\Local\go-build set GOENV=C:\Users\iamdoubz\AppData\Roaming\go\env set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\iamdoubz\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\iamdoubz\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=C:\Tools\Go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=C:\Tools\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=C:\Users\iamdoubz\Gits\Gitea\12\go.mod 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\iamdoubz\AppData\Local\Temp\go-build163858050=/tmp/go-build -gno-record-gcc-switches ```
Author
Owner

@techknowlogick commented on GitHub (Aug 24, 2020):

You should be so lucky to not be so intertwined, rather hard coded, in the Windows environment :/

I am thankful every day 😆

Thanks for this information :) Once I create the ticket I'll link it here.

@techknowlogick commented on GitHub (Aug 24, 2020): > You should be so lucky to not be so intertwined, rather hard coded, in the Windows environment :/ I am thankful every day 😆 Thanks for this information :) Once I create the ticket I'll link it here.
Author
Owner

@iamdoubz commented on GitHub (Aug 24, 2020):

Just let me know if you need anything else.

@iamdoubz commented on GitHub (Aug 24, 2020): Just let me know if you need anything else.
Author
Owner

@techknowlogick commented on GitHub (Aug 24, 2020):

I've just submitted: golang/go#41013

@techknowlogick commented on GitHub (Aug 24, 2020): I've just submitted: [golang/go#41013](https://togithub.com/golang/go/issues/41013)
Author
Owner

@iamdoubz commented on GitHub (Aug 24, 2020):

Patch works for 1.13. Any chance you can backport this to 1.12 as well?

@iamdoubz commented on GitHub (Aug 24, 2020): Patch works for 1.13. Any chance you can backport this to 1.12 as well?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5891