> Yes, crosscompiling to mips with gccgo has worked for a while.
I'm having trouble getting this to work. I got gccgo-mips-linux-gnu to
produce binaries, but the target machine doesn't have the right shared
libraries to run them; I get *"can't load library 'libm.so.6'"* when trying
to execute the built binary (here's that thread
<https://github.com/golang/go/issues/18942>).
In another thread I saw Dave Cheney tell people to cp -r $GOROOT to another
place (call it ~/xgo), touch all the files in ~/xgo/src, make sure GOROOT
isn't set, then run the following:
$ go build -o xgo -compiler gccgo -x cmd/go
This isn't producing a *xgo* binary at all. Also, running
$ GOOS=linux GOARCH=mips go build -o xgo -compiler gccgo -x cmd/go
also generates no *xgo *binary.
Third attempt: https://github.com/golang/go/wiki/GccgoCrossCompilation
makes it sounds like I should use crosstool-ng to build a version of GCC
for my target architecture (mips), but can't I just use gccgo-mips-linux-gnu
somehow?
Some of these instructions are from 2 years ago, so at this point I don't
know what will work now, in 2017.
Any help would be great! Thanks.
--Steve
On Thursday, May 21, 2015 at 12:53:38 AM UTC-7, [email protected] wrote:
>
> Yes, crosscompiling to mips with gccgo has worked for a while. There are
> issues with cross compiling and the bundled go tool. If you know how, you
> can work around it.
>
> On Thursday, May 21, 2015 at 7:43:22 PM UTC+12, Ganbold Tsagaankhuu wrote:
>>
>>
>>
>> On Thu, May 21, 2015 at 12:03 PM, <[email protected]> wrote:
>>
>>> Ok, Just confirming this, I will work on a patch that makes cross
>>> compiling work, and make the GOARCH default to whatever gcc was built for.
>>>
>>
>> Nice. So if gcc 5.x can be cross compiled for mips then for now maybe it
>> is better for me just to try to cross compile gcc on Linux and then try to
>> compile Go program for mips platform.
>>
>> Ganbold
>>
>>
>>
>>>
>>>
>>> On Thursday, May 21, 2015 at 2:21:57 PM UTC+12, [email protected]
>>> wrote:
>>>>
>>>> Ok, I think I found a bug in the build scripts.
>>>>
>>>> This check is wrong imo.
>>>>
>>>> https://github.com/gcc-mirror/gcc/blob/gcc-5_1_0-release/gotools/configure.ac#L49
>>>>
>>>> This doesn't currently make sense, NATIVE is always true. We aren't
>>>> cross compiling the compiler itself.
>>>>
>>>> https://github.com/gcc-mirror/gcc/blob/gcc-5_1_0-release/gotools/Makefile.am#L31
>>>>
>>>>
>>>> And I think we should implement this:
>>>>
>>>> https://github.com/gcc-mirror/gcc/blob/gcc-5_1_0-release/gotools/Makefile.am#L128
>>>>
>>>> Should I make a thread on golang-dev for this? I think we could make
>>>> cross compiling using gccgo pretty nice which means people will use gccgo
>>>> for most embedded things.
>>>> With this I can get gccgo added to crosstool-ng, openwrt and buildroot
>>>> I think.
>>>>
>>> --
>>> 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 [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.