On Tue, Jan 9, 2018 at 2:36 AM, <
Wei....@arm.com> wrote:
> Fast building speed is important for Golang and we can incrementally improve
> internal link for it.
> I just have two basic questions:
> 1. Why CGO requires external link? Is there any technical issues or
> considerations to require it or just due to a lot of coding work?
It's coding work, and maintenance, and bug fixes for unusual use cases
that will rarely arise. The most complex issue I can think of is that
system linkers have a lot of code just for C++ global
constructors/destructors and C++ exception handling information. If
we don't use external linking, we need to write our own versions of
that code, and keep it up to date.
> 2. PIE was once supported by internal link for linux/amd64 but switch to
> external link last year. Is any plan to switch it back to internal link for
> linux/amd64 in the future?
It's certainly desirable, but I'm not aware of anybody actively working on it.
Ian
> On Tuesday, January 9, 2018 at 3:55:03 AM UTC+8, Michael Hudson-Doyle wrote:
>>
>> On 8 January 2018 at 19:35, <
Wei....@arm.com> wrote:
>>>
>>> I'm investigating Golang internal link for potential improvement on arm64
>>> port.
>>> But I find that internal link is only enabled for very few cases such as:
>>> (!iscgo && buildmode==exe && GOOS==linux).
>>
>>
>> What you're seeing here is that the people who worked on the arm64 support
>> mostly came from a Linux background where having a host linker installed
>> doesn't seem like a big deal.
>>
>>>
>>> Even for amd64 port, internal link doesn't support PIE now (It seems to
>>> support PIE before).
>>>
>>> So my question is: what's the future development direction and plan of
>>> Golang internal link?
>>> More dependence on external linker (such as gcc) or less dependence on
>>> external one (even on dependence at last)?
>>
>>
>> I'm not aware of any real plans here. I've had this silly idea for a while
>> to implement ELF/PE/MachO linkers in Go, convert cmd/link to always operate
>> in what is now external link mode and invoke the bundled host linker if the
>> cgo usage is simple enough. I think this would lead to cleaner code, but it
>> would probably be slower, unfortunately.
>>
>> Cheers,
>> mwh
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-dev+...@googlegroups.com.