On Mon, Oct 19, 2020 at 2:06 PM Gerrit Binnenmars
<gerritbinnenm...@gmail.com> wrote:
>
> I used crosstool-ng successfully to build a go compiler for ppc e500.
> Unfortunately go build does not support ppc therefore go needs to be
> build from source using the amd64 gccgo compiler that I also build
> with crosstool-ng.
>
> Compiling go from source fails:
> Problem: undefined name stdpkg in internal/goroot/gccgo.go
>
> I included the output of my build script below. Any help or tips are welcome.
>
> With kind regards,
>
> Gerrit Binnenmars
>
> Info:
> This is crosstool-NG version 1.24.0.191_364ed7a
> GO111MODULE=""
> GOARCH="amd64"
> GOBIN=""
> GOCACHE="/home/maintain/.cache/go-build"
> GOENV="/home/maintain/.config/go/env"
> GOEXE=""
> GOFLAGS=""
> GOHOSTARCH="amd64"
> GOHOSTOS="linux"
> GOINSECURE=""
> GOMODCACHE="/home/maintain/gonew/pkg/mod"
> GONOPROXY=""
> GONOSUMDB=""
> GOOS="linux"
> GOPATH="/home/maintain/gonew"
> GOPRIVATE=""
> GOPROXY="https://proxy.golang.org,direct";
> GOROOT="/home/maintain/x-tools/x86_64-e500-linux-gnu/x86_64-e500-linux-gnu/sysroot/lib"
> GOSUMDB="sum.golang.org"
> GOTMPDIR=""
> GOTOOLDIR="/home/maintain/x-tools/x86_64-e500-linux-gnu/x86_64-e500-linux-gnu/sysroot/lib/pkg/tool/linux_amd64"
> GCCGO="/home/maintain/x-tools/x86_64-e500-linux-gnu/bin/gccgo"
> AR="ar"
> CC="/home/maintain/x-tools/x86_64-e500-linux-gnu/bin/gcc"
> CXX="/home/maintain/x-tools/x86_64-e500-linux-gnu/bin/g++"
> CGO_ENABLED="1"
> GOMOD=""
> CGO_CFLAGS="--with-sysroot=/home/maintain/x-tools/x86_64-e500-linux-gnu/x86_64-e500-linux-gnu/sysroot"
> CGO_CPPFLAGS=""
> CGO_CXXFLAGS="-g -O2"
> CGO_FFLAGS="-g -O2"
> CGO_LDFLAGS="-g -O2"
> PKG_CONFIG="pkg-config"
> GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0
> -fdebug-prefix-map=/tmp/go-build355977706=/tmp/go-build
> -gno-record-gcc-switches"
> go version go1.15.2 linux/amd64
> gccgo (GCC) 10.2.0
> Copyright (C) 2020 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> WORK=/tmp/go-build273889551
> mkdir -p $WORK/b100/
> cd $WORK
> /home/maintain/x-tools/x86_64-e500-linux-gnu/bin/gccgo
> -fgo-importcfg=/dev/null -c -x c - -o /dev/null || true
> cd /home/maintain/gonew/src/internal/goroot
> /home/maintain/x-tools/x86_64-e500-linux-gnu/bin/gccgo -c -g -m64
> -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches
> -fgo-pkgpath=internal/goroot -o $WORK/b100/_go_.o -I
> $WORK/b100/_importcfgroot_ ./gccgo.go
> mkdir -p $WORK/b027/
> mkdir -p $WORK/b027/_importcfgroot_/cmd/go/internal
> ln -s 
> /home/maintain/.cache/go-build/ad/ade44815e7af8b7305b2db4099ec5b08aafcbd6e374a2c13d8e99c2986ca93c6-d
> $WORK/b027/_importcfgroot_/cmd/go/internal/libauth.a
> ln -s 
> /home/maintain/.cache/go-build/d2/d26f05f163d86aecfadfbb952dfef9a314aa1c84c23fddd39bce127ccc85d101-d
> $WORK/b027/_importcfgroot_/cmd/go/internal/libcfg.a
> mkdir -p $WORK/b027/_importcfgroot_/cmd/internal
> ln -s 
> /home/maintain/.cache/go-build/2f/2f6811b0804c481edbfd9952d1aac22414f84ee1aec229218b03956bf3f9aa7a-d
> $WORK/b027/_importcfgroot_/cmd/internal/libbrowser.a
> cd /home/maintain/gonew/src/cmd/go/internal/web
> /home/maintain/x-tools/x86_64-e500-linux-gnu/bin/gccgo -c -g -m64
> -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches
> -fgo-pkgpath=cmd/go/internal/web -o $WORK/b027/_go_.o -I
> $WORK/b027/_importcfgroot_ ./api.go ./http.go ./url.go ./url_other.go
> # internal/goroot
> src/internal/goroot/gccgo.go:24:10: error: reference to undefined name 
> 'stdpkg'
>    24 |   return stdpkg[path]
>       |          ^
> # cmd/go/internal/web
> src/cmd/go/internal/web/api.go:92:45: error: reference to undefined
> field or method 'Redacted'
>    92 |   return nil, fmt.Errorf("reading %s: %v", u.Redacted(), err)

It looks like you are using the "go" program to build the gccgo
standard library.  That doesn't work.  The gccgo standard library must
be built as part of GCC, using the usual configure/make commands used
to build GCC itself.  When configuring GCC, use --enable-languages=go.

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWDf5AAGRgsreZYK14y6bTa7swdn1HjjM4RDGWeb8tH8w%40mail.gmail.com.

Reply via email to