On Fri, May 3, 2019 at 11:38 AM <ivan.medoe...@gmail.com> wrote:
>
> I read the following from one of the contributors:
>
> > On Solaris (and Windows), and more recently in macOS as well we link with 
> > libc (or equivalent).
> > Go used to do raw system calls on macOS, and binaries were occasionally 
> > broken by kernel updates. Now Go uses libc on macOS.
>
> I just checked syscall/zsyscall_darwin_amd64.go, and indeed in Go 1.10 we had
>
>         Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
>
> now we have
>
>         syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), 
> uintptr(len(p)))
>
> But when I run otool -L on the binary to see if /usr/lib/libSystem.B.dylib is 
> linked, I get nothing.
>
> Is it because Go uses its own linker that's not supported by macOS tools?

Seems like it should work.  Are you sure you are using Go 1.12?


> P.S. Are there plans to do the same transition for Linux for consistency and 
> stability?

No.  The Linux kernel, fortunately, supports static linking and
provides a stable syscall API.  There is no reason to make this change
on GNU/Linux.

Ian

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to