-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/cgo: unknown ptrSize for $GOARCH mips when using gccgo #7398
Comments
Ignore that last comment. This issue is still valid, again tested today with the most recent versions: $ go version go version devel +32c32aef2a41 Thu Mar 20 07:28:24 2014 +0100 linux/amd64 $ gccgo -v Using built-in specs. COLLECT_GCC=gccgo COLLECT_LTO_WRAPPER=/home/erikw/bin/gccgo/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/home/erikw/bin/gccgo --enable-languages=c,c++,go Thread model: posix gcc version 4.9.0 20140307 (experimental) (GCC) |
That's unfortunate. However can we clarify the issue a bit? In the thread "[golang-nuts] Simplification of MIPS cross-compilation?" Dave Cheney revealed that you have to build the go-tool using gccgo to get a version that supports the same target architectures that (a cross-compiling) gccgo supports. The problem with current versions of the packages (tested today with tip of the repos) (versions attached below!) is that some code has to be out-commented to pass the compilation (as mentioned in the golang-nuts thread) and that compilation with the produced xgo-binary ends with the 'unknown ptrSize for $GOARCH "mips"' error. What is unclear though about the problem is if the go/src/cmd/cgo tool also has to be compiled with gccgo producing a xcgo in the same manner like xgo? I assumed so when posting this issue based on the output from $(xgo build -compiler -x ...) showing that the command complaining about the pointer size is cgo. Whether or not cgo also should be compiled with gccgo this issue is still valid as of today, since xgo can not be compiled without commenting out code. But it would be nice to know if cgo has to be compiled using gccgo libraries too. Anyone know? ping {iant, cheney} Versions I used today (tip of repos): $ go version go version devel +e426bfa69c19 Fri Apr 04 08:42:35 2014 +0200 + linux/amd64 $ gccgo -v Using built-in specs. COLLECT_GCC=gccgo COLLECT_LTO_WRAPPER=/home/erikwp/bin/gccgo/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/home/erikwp/bin/gccgo --enable-languages=c,c++,go Thread model: posix gcc version 4.9.0 20140307 (experimental) (GCC) $ mipsel-unknown-linux-gnu-gccgo -v Using built-in specs. COLLECT_GCC=./mipsel-unknown-linux-gnu-gccgo COLLECT_LTO_WRAPPER=/home/erikwp/src/mipsel-unknown-linux-gnu_gcc_build_newest/tools/libexec/gcc/mipsel-unknown-linux-gnu/4.9.0/lto-wrapper Target: mipsel-unknown-linux-gnu Configured with: /home/erikwp/src/mipsel-unknown-linux-gnu_gcc_build_newest/src/gccgo/configure --prefix=/home/erikwp/src/mipsel-unknown-linux-gnu_gcc_build_newest/tools --target=mipsel-unknown-linux-gnu --build=amd64-linux-gnu --host=amd64-linux-gnu --with-sysroot=/home/erikwp/src/mipsel-unknown-linux-gnu_gcc_build_newest/sysroot --enable-languages=c,c++,go --disable-libssp --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libquadmath-support --with-pkgversion='erikwp'\''s mipsel-unknown-linux-gnu GCC phase3 crosscompiler' --with-ppl=no --with-isl=no --with-cloog=no --with-libelf=no Thread model: posix gcc version 4.9.0 20140307 (experimental) (erikwp's mipsel-unknown-linux-gnu GCC phase3 crosscompiler) |
I had the similar problem when I was trying to compiler docker using gccgo on Tilera CPU architecture. it reports like |
This is actually fixed (for MIPS, not for tliegx). |
@rsc Is there such a thing as "gccgo cgo"? @ianlancetaylor Do you mean it's fixed for |
gccgo has its own version of cgo. This issue is fixed in gccgo's version. |
The gc version explicitly supports gccgo, shouldn't it support gccgo architectures (or not support gccgo at all)? |
To follow up on that... The main issue is that there seems to be no way to invoke alternative cgo when compiling using the go tool (which gccgo does not have). It will always pick the executable from GOROOT. |
@a13xb There isn't a great solution here. Yes, ideally, the gc cgo tool should support the targets that gccgo supports, but that depends on your version of gccgo and it can not realistically be kept up to date. In any case, I think you should open a new issue for this, as this one is closed. |
by erik.westrup:
The text was updated successfully, but these errors were encountered: