Hi fellow Gophers!
<https://stackoverflow.com/posts/73390578/timeline>

I am trying to follow what I believe to be the official instructions 
<https://go.dev/doc/install/source> for building Go from source. (I am not 
trying to build my own Go code, I am trying to build the Go project itself.)

The reason I want to do this is to build a Go 1.19 compiler for Solaris, 
since there are no prebuilt Go 1.19 binaries for Solaris available on the Go 
downloads page <https://go.dev/dl/>.

On the official instructions page, under the "Optional environment 
variables" section, it says "The Go compilation environment can be 
customized by environment variables."

Later in this same section, it then says that 
the GOOS and GOARCH environment variables can be used to set the target 
operating system and compilation architecture.

I tried building like this, after cloning the source code and checking out 
the go1.19 tag, but the build fails:
$ GOOS=solaris GOARCH=amd64 GOROOT_FINAL=../publish ./all.bash
Building Go cmd/dist using /usr/local/go. (go1.19 linux/amd64)
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for host, linux/amd64.
# runtime/cgo
linux_syscall.c: In function '_cgo_libc_setresgid':
linux_syscall.c:67:2: error: implicit declaration of function 'setresgid' 
[-Werror=implicit-function-declaration]
linux_syscall.c: In function '_cgo_libc_setresuid':
linux_syscall.c:73:2: error: implicit declaration of function 'setresuid' 
[-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
go tool dist: FAILED: 
/some/redacted/parent/dirs/go/goroot/pkg/tool/linux_amd64/go_bootstrap 
install std cmd: exit status 2

I am building on Linux. I have gcc and Go 1.19 installed on my Linux 
system, and both tools are on my PATH.

I am looking for help fixing these errors.

Best regards,
Shane

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e5905d1d-45cc-4019-827d-1675aa842e69n%40googlegroups.com.

Reply via email to