Hi All

As part of porting to powerpc440 effort, we are using gccgo to port Docker.

I am confused about the -X flag. What is the gccgo equivalent of using -X 
importpath.name=value to set string variables in some go files.

The following command

GO111MODULE=off GOARCH=ppc 
GOCACHE="/workspace/output/cr/host/usr/share/go-cache" GOROOT="""" 
CC="/workspace/output/cr/host/bin/powerpc-buildroot-linux-gnu-gcc" 
CXX="/workspace/output/cr/host/bin/powerpc-buildroot-linux-gnu-g++" 
GOTOOLDIR="""/pkg/tool/linux_ppc" 
GCCGO="/workspace/output/cr/host/bin/powerpc-buildroot-linux-gnu-gccgo" 
PATH="/workspace/output/cr/host/bin:/workspace/output/cr/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
 
GOBIN= CGO_ENABLED=1 
GOPATH="/workspace/output/cr/build/docker-cli-19.03.5/gopath" CGO_ENABLED=0 
""/workspace/buildroot/../toolchains/powerpc-buildroot-linux-gnu_sdk-buildroot"/bin/go"
 
build  -v -compiler gccgo -gccgoflags='-static 
-Lvendor/golang.org/x/sys/unix -lgccgo_c -X 
github.com/docker/cli/cli.Version=19.03.5' -tags "autogen" -p 17 -o 
/workspace/output/cr/build/docker-cli-19.03.5/bin/docker ./cmd/docker

fails with

powerpc-buildroot-linux-gnu-gccgo: error: 
github.com/docker/cli/cli.Version=19.03.5: No such file or directory
powerpc-buildroot-linux-gnu-gccgo: error: unrecognized command line option 
'-X'

as if we tried to pass the options to gcc or ld.

The same command is supposed to work with gc, as the original flag was 
there in buildroot, but failed to build when we switched to gccgo.

Happy hacking
Atilla

-- 
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/243c83a9-ecc3-48bb-a1e5-1350c841e2fao%40googlegroups.com.

Reply via email to