Compiling with the boostrap.bash script also fails: $ GOOS=solaris GOARCH=amd64 ./bootstrap.bash #### Copying to ../../go-solaris-amd64-bootstrap
#### Cleaning ../../go-solaris-amd64-bootstrap Removing src@tmp/ #### Building ../../go-solaris-amd64-bootstrap 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: /builds/workspace/developer/Prime/Bishop/go/go-solaris-amd64-bootstrap/pkg/tool/linux_amd64/go_bootstrap install std cmd: exit status 2 I have multiple libc* files on my build machine. Of the ones that are not symlinks, I have /lib/x86_64-linux-gnu/libc-2.28.so, /sysroot/lib/amd64/libc.so.1, and /sysroot/lib/libc.so.1. So I think I have glibc 2.28 based on the first file, but I am not certain. My gcc is gcc 4.7.4. I have multiple unistd.h files on my build machine, but none of them have setresgid (I checked by running find as root to find all the unistd.h files, and then I grepped each of them for setresgid). Is there a minimum libc version that is needed to compile the boostrap? On Thursday, August 18, 2022 at 10:52:47 PM UTC-4 Ian Lance Taylor wrote: > On Thu, Aug 18, 2022 at 5:05 PM Shane <skull...@gmail.com> wrote: > > > > I'm not sure what you mean when you ask which C library version I am > using. Are you asking the version of my libc? > > > > I am cross-compiling on Debian 10 using Go 1.19 and gcc 4.7.4 (but my > understanding is that a C compiler is only used for the cgo parts of the Go > source tree, and that most of the Go source tree is compiled by Go). My > target is Solaris 11. > > I'm wondering why it appears that setresgid is not declared on your > system. So I am asking which libc you are using, and what version it > is. For example, on my system setresgid is declared in <unistd.h>; I > am running glibc 2.33. > > But that is likely a side issue. To build a Go distribution for > Solaris, use the bootstrap.bash script that I mentioned. > > Ian > > > > On Wednesday, August 17, 2022 at 10:16:10 PM UTC-4 Ian Lance Taylor > wrote: > >> > >> On Wed, Aug 17, 2022 at 4:28 PM Shane <skull...@gmail.com> wrote: > >> > > >> > I am trying to follow what I believe to be the official instructions > 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. > >> > > >> > 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. > >> > >> See src/bootstrap.bash for a script that can build a toolchain for a > >> different target. > >> > >> That said, that's a strange error. What C library version are you using? > >> > >> Ian > > > > -- > > 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...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/84132b4b-64ef-4250-a162-1783cfd559bcn%40googlegroups.com > . > -- 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/747fa62f-bba0-476d-9b48-6054311eb8f9n%40googlegroups.com.