David Crawshaw
unread,Sep 20, 2016, 2:17:24 PM9/20/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ian Lance Taylor, Michael Hudson-Doyle, golan...@googlegroups.com, Michael Matloob
On Tue, Sep 20, 2016 at 12:42 PM, Ian Lance Taylor <
ia...@golang.org> wrote:
> On Tue, Sep 20, 2016 at 7:05 AM, David Crawshaw <
craw...@golang.org> wrote:
>> We also have cmd/internal/obj.GOARCH, a global variable that contains the
>> same information as SysArch and is widely used.
>>
>> I would rather eliminate both SysArch globals in the linker and use it.
>> Tests that want to try different architectures can set it and defer setting
>> it back.
>>
>> One part I don't know how to reconcile is that obj.GOARCH is a string, not a
>> *sys.Arch.
>
> I think that replacing *sys.Arch with obj.GOARCH would be a step
> backward. Just look at how SysArch is used.
I agree, that's why I don't know how to reconcile obj.GOARCH and
ld.SysArch. I suppose one way would be to make obj.GOARCH a *sys.Arch.
Another would be to get rid of obj.GOARCH.
> More importantly, I don't understand the principle that says that the
> SysArch global is good and the Ctxt global is bad.
Removing the Ctxt global means data that was global is no longer
global. That has tradeoffs, but it definitely has a principle behind
it.
Removing the SysArch global in favor of a parameter still leaves
obj.GOARCH, a global variable to get to the same information. That's
not the same as getting rid of Ctxt. I think favoring a SysArch
parameter should mean getting rid of obj.GOARCH.