go build -o cli -trimpath -ldflags "-s -w" -gcflags "all=-C -l -B"
This is run inside goreleaser for all the major platforms.
$ GOOS=windows GOARCH=arm64 go build -o cli -trimpath -ldflags "-s -w" -gcflags "all=-C -l -B"
syscall.Syscall15: nosplit stack over 792 byte limit
syscall.Syscall15<1>
grows 288 bytes, calls syscall.SyscallN<1>
grows 48 bytes, calls runtime.cgocall<1>
grows 112 bytes, calls runtime.entersyscall<1>
grows 48 bytes, calls runtime.reentersyscall<1>
grows 112 bytes, calls runtime.save<1>
grows 32 bytes, calls runtime.badctxt<1>
grows 32 bytes, calls runtime.throw<1>
grows 48 bytes, calls runtime.fatalthrow<1>
grows 64 bytes, calls runtime.systemstack<0>
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls gosave_systemstack_switch<79>
grows 0 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 112 bytes, calls runtime.save<1>
grows 32 bytes, calls runtime.badctxt<1>
grows 32 bytes, calls runtime.throw<1>
grows 48 bytes, calls runtime.fatalthrow<1>
grows 64 bytes, calls runtime.systemstack<0>
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls gosave_systemstack_switch<79>
grows 0 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 112 bytes, calls runtime.save<1>
grows 32 bytes, calls runtime.badctxt<1>
grows 32 bytes, calls runtime.throw<1>
grows 48 bytes, calls runtime.fatalthrow<1>
grows 64 bytes, calls runtime.systemstack<0>
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls gosave_systemstack_switch<79>
grows 0 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 112 bytes, calls runtime.save<1>
grows 32 bytes, calls runtime.badctxt<1>
grows 32 bytes, calls runtime.throw<1>
grows 48 bytes, calls runtime.fatalthrow<1>
grows 64 bytes, calls runtime.systemstack<0>
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls gosave_systemstack_switch<79>
grows 0 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 112 bytes, calls runtime.save<1>
grows 32 bytes, calls runtime.badctxt<1>
grows 32 bytes, calls runtime.throw<1>
grows 48 bytes, calls runtime.fatalthrow<1>
grows 64 bytes, calls runtime.systemstack<0>
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls gosave_systemstack_switch<79>
grows 0 bytes, calls runtime.abort<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
grows 16 bytes, calls indirect
grows 0 bytes, calls runtime.morestack<0>
8 bytes over limit
grows 16 bytes, calls runtime.save_g<0>
8 bytes over limit
I expect no error, this was working fine before upgrading to Go 1.23.
Noticed that removing the -l flag from -gcflags does the trick and makes the program to compile no issues:
GOOS=windows GOARCH=arm64 go build -o cli -trimpath -ldflags "-s -w" -gcflags "all=-C -B"
Go version
go version go1.23.2 darwin/arm64
Output of
go envin your module/workspace:What did you do?
Run the following command to compile our program:
This is run inside goreleaser for all the major platforms.
What did you see happen?
Got the following message when building for
windows/arm64(GOOS=windows GOARCH=arm64).What did you expect to see?
I expect no error, this was working fine before upgrading to Go 1.23.
Noticed that removing the
-lflag from-gcflagsdoes the trick and makes the program to compile no issues: