This is the mail archive of the
mailing list for the GCC project.
Re: [gofrontend-dev] GO tools for gccgo cross
- From: Ian Lance Taylor <iant at golang dot org>
- To: "Lynn A. Boger" <laboger at linux dot vnet dot ibm dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "gofrontend-dev at googlegroups dot com" <gofrontend-dev at googlegroups dot com>
- Date: Tue, 3 Feb 2015 12:18:38 -0800
- Subject: Re: [gofrontend-dev] GO tools for gccgo cross
- Authentication-results: sourceware.org; auth=none
- References: <54D1270A dot 9050607 at linux dot vnet dot ibm dot com>
On Tue, Feb 3, 2015 at 11:52 AM, Lynn A. Boger
> I've been experimenting with the go tools and how to make them work for
> cross gccgo builds.
> In golang I think there is just one 'go' tool and the cross build targets
> are specified by the setting of GOARCH and GOOS. So why couldn't the same
> be done with gccgo?
> That means, on any given system, I think we just need to build the native
> gccgo and the go tools that are built with it. No need to build different
> go tools for each cross target. If a cross build is needed, then set the
> GOARCH and GOOS values appropriately and invoke the native go (for gccgo)
> tool. Source changes are needed for the go tool source to determine the
> correct cross compiler name based on the GOARCH and GOOS settings, and then
> use that cross compiler where needed for building or linking instead of
> always using "gccgo". I was able to make these changes and get this to work
> -- I built gccgo programs targeted for ppc64le on an x86_64.
I agree that setting GOARCH and GOOS should change the default name of
the gccgo compiler that the go tool uses.