There is another related problem: cross compiling gccgo will compile ago tool for the target, but not for the host. You can compile a gccgofor the host, but the go tool only knows how to compile for the host,and does not know anything about the cross toolchains you have.
gofmt and other go tools are not depend on go. they can be in seperate package (not depend on go,gccgo) and both gcc-go and go can depend on that one.
I‘m not that sure it's a bug.
If we fix the "bug", then to compile a cross gccgo, the host version also needs
to be compiled.
I‘m not that sure it's a bug.Off topic, but this is definitely a problem for a few reasons.
On Tue, May 26, 2015 at 1:30 AM, <andrewc...@gmail.com> wrote:If we fix the "bug", then to compile a cross gccgo, the host version also needsto be compiled.Not true, autotools should check for a working go tool or gccgo and error if one isn't specified.are you suggesting that to cross compile gccgo, one must first have gccgo for thehost version? Just to build the host go tool? Why? I don't like this solution.
Another related problem is having a go tool that can only cross compile for a specifictarget?
What if I want to have to build Go for multiple architectures? Then I will have to haveone go tool for each gccgo target? The gc go tool doesn't have this restriction, asingle Go tool can build for all support platforms.
On Tuesday, May 26, 2015 at 6:06:31 PM UTC+12, minux wrote:On Tue, May 26, 2015 at 1:30 AM, <andrewc...@gmail.com> wrote:If we fix the "bug", then to compile a cross gccgo, the host version also needsto be compiled.Not true, autotools should check for a working go tool or gccgo and error if one isn't specified.are you suggesting that to cross compile gccgo, one must first have gccgo for thehost version? Just to build the host go tool? Why? I don't like this solution.
You already have a tarball with the source code, so you can build and install a host gccgo first no problem.
The alternative is doing two gcc builds which is less flexible, horrible, and would require reworking all of gcc's build scripts.
Another related problem is having a go tool that can only cross compile for a specifictarget?What if I want to have to build Go for multiple architectures? Then I will have to haveone go tool for each gccgo target? The gc go tool doesn't have this restriction, asingle Go tool can build for all support platforms.
This is a real issue that affects packaging and go in general. I think one go tool per toolchain would actually be fine. I think this is especially true because the gccgo version of the go tool is probably going to diverge from the gc tool over time to the point where they will become incompatible. I think the gccgo version is already behind the gc version, and they can't sync up unless the release schedule of gc and gcc synchronize.
On Tue, May 26, 2015 at 2:20 AM, <andrewc...@gmail.com> wrote:On Tuesday, May 26, 2015 at 6:06:31 PM UTC+12, minux wrote:On Tue, May 26, 2015 at 1:30 AM, <andrewc...@gmail.com> wrote:If we fix the "bug", then to compile a cross gccgo, the host version also needsto be compiled.Not true, autotools should check for a working go tool or gccgo and error if one isn't specified.are you suggesting that to cross compile gccgo, one must first have gccgo for thehost version? Just to build the host go tool? Why? I don't like this solution.
You already have a tarball with the source code, so you can build and install a host gccgo first no problem.
The alternative is doing two gcc builds which is less flexible, horrible, and would require reworking all of gcc's build scripts.No, that's not the only alternative. I've proposed another alternative solution: decoupledthe toolchain configuration from the go tool binary. Install the toolchain configuration forthe cross compile toolchain, then the user can use any go tool on the host.
No, that's not the only alternative. I've proposed another alternative solution: decoupledthe toolchain configuration from the go tool binary. Install the toolchain configuration forthe cross compile toolchain, then the user can use any go tool on the host.