From 0d8108d8daebac7f414c2243c1755061338d4855 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 18 Sep 2019 23:26:57 -0600 Subject: [PATCH] wireguard-go-bridge: update for 1.13 Signed-off-by: Jason A. Donenfeld --- wireguard-go-bridge/Makefile | 13 +- wireguard-go-bridge/go.mod | 6 +- wireguard-go-bridge/go.sum | 32 +- .../goruntime-boottime-over-monotonic.diff | 24 +- ...oruntime-syscall-remove-getdirentries.diff | 279 ------------------ .../sys-unix-remove-getdirentries.diff | 143 --------- 6 files changed, 34 insertions(+), 463 deletions(-) delete mode 100644 wireguard-go-bridge/goruntime-syscall-remove-getdirentries.diff delete mode 100644 wireguard-go-bridge/sys-unix-remove-getdirentries.diff diff --git a/wireguard-go-bridge/Makefile b/wireguard-go-bridge/Makefile index 4b07394..d0ec767 100644 --- a/wireguard-go-bridge/Makefile +++ b/wireguard-go-bridge/Makefile @@ -26,12 +26,10 @@ export CGO_ENABLED := 1 build: $(DESTDIR)/libwg-go.a version-header: $(DESTDIR)/wireguard-go-version.h -GOBUILDVERSION_NEEDED := go version go1.12.5 darwin/amd64 +GOBUILDVERSION_NEEDED := go version go1.13.1 darwin/amd64 GOBUILDVERSION_CURRENT := $(shell go version 2>/dev/null) export REAL_GOROOT := $(shell go env GOROOT 2>/dev/null) export GOROOT := $(BUILDDIR)/goroot -export GOPATH := $(BUILDDIR)/gopath -export PATH := $(GOPATH)/bin:$(PATH) GOBUILDVERSION_FAKE := $(shell $(GOROOT)/bin/go version 2>/dev/null) ifneq ($(GOBUILDVERSION_NEEDED),$(GOBUILDVERSION_CURRENT)) $(error This requires $(GOBUILDVERSION_NEEDED)) @@ -44,10 +42,7 @@ $(GOROOT)/.prepared: [ -n "$(REAL_GOROOT)" ] mkdir -p "$(GOROOT)" rsync -a --delete --exclude=pkg/obj/go-build "$(REAL_GOROOT)/" "$(GOROOT)/" - cat goruntime-*.diff | patch -p1 -f -N -r- -d "$(GOROOT)" - rm -rf "$(GOPATH)/pkg/mod" - go get -d -tags ios; chmod -fR +w "$(GOPATH)/pkg/mod" - for sys in "$(GOPATH)/pkg/mod/golang.org/x/sys@"*; do cat sys-unix-*.diff | patch -p1 -f -N -r- -d "$$sys"; done + patch -p1 -f -N -r- -d "$(GOROOT)" < goruntime-boottime-over-monotonic.diff touch "$@" $(shell test "$$(cat "$(BUILDDIR)/.gobuildversion" 2>/dev/null)" = "$(GOBUILDVERSION_CURRENT)" || rm -f "$(DESTDIR)/libwg-go.a") @@ -58,7 +53,6 @@ $(BUILDDIR)/libwg-go-$(1).a: $(GOROOT)/.prepared CGO_LDFLAGS="$(CFLAGS_PREFIX) $(ARCH)" \ GOARCH="$(GOARCH_$(1))" \ go build -tags ios -ldflags=-w -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive && go version > "$(BUILDDIR)/.gobuildversion"; \ - chmod -fR +w "$(GOPATH)/pkg/mod"; \ ret=$$$$?; \ rm -f "$(BUILDDIR)/libwg-go-$(1).h"; \ exit $$$$ret @@ -66,7 +60,8 @@ endef $(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH)))) $(DESTDIR)/wireguard-go-version.h: go.mod $(GOROOT)/.prepared - wggo="$(GOPATH)/pkg/mod/$$(sed -n 's/.*\(golang\.zx2c4\.com\/wireguard\) \(.*\)$$/\1@\2/p' go.mod)"; \ + go get -d -tags ios + wggo="$$(go env GOPATH)/pkg/mod/$$(sed -n 's/.*\(golang\.zx2c4\.com\/wireguard\) \(.*\)$$/\1@\2/p' go.mod)"; \ sed -n 's/.*WireGuardGoVersion = "\(.*\)"/#define WIREGUARD_GO_VERSION "\1"/p' "$$wggo/device/version.go" > "$@" $(DESTDIR)/libwg-go.a: $(foreach ARCH,$(ARCHS),$(BUILDDIR)/libwg-go-$(ARCH).a) diff --git a/wireguard-go-bridge/go.mod b/wireguard-go-bridge/go.mod index 124bddf..7f4e33f 100644 --- a/wireguard-go-bridge/go.mod +++ b/wireguard-go-bridge/go.mod @@ -3,6 +3,8 @@ module golang.zx2c4.com/wireguard/ios go 1.12 require ( - golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5 - golang.zx2c4.com/wireguard v0.0.20190518-0.20190530131616-d9f995209c3c + golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc // indirect + golang.org/x/net v0.0.0-20191003171128-d98b1b443823 // indirect + golang.org/x/sys v0.0.0-20191003212358-c178f38b412c + golang.zx2c4.com/wireguard v0.0.20190908 ) diff --git a/wireguard-go-bridge/go.sum b/wireguard-go-bridge/go.sum index a0ccbea..0a5e374 100644 --- a/wireguard-go-bridge/go.sum +++ b/wireguard-go-bridge/go.sum @@ -1,23 +1,19 @@ -github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576 h1:aUX/1G2gFSs4AsJJg2cL3HuoRhCSCz733FE5GUSuaT4= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53 h1:kcXqo9vE6fsZY5X5Rd7R1l7fTgnWaDCVmln65REefiE= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc h1:c0o/qxkaO2LF5t6fQrT4b5hzyggAkLLlCUjqfRxd8Q4= +golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191003171128-d98b1b443823 h1:Ypyv6BNJh07T1pUSrehkLemqPKXhus2MkfktJ91kRh4= +golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67 h1:1Fzlr8kkDLQwqMP8GxrhptBLqZG/EDpiATneiZHY998= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5 h1:f005F/Jl5JLP036x7QIvUVhNTqxvSYwFIiyOh2q12iU= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190830023255-19e00faab6ad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191003212358-c178f38b412c h1:6Zx7DRlKXf79yfxuQ/7GqV3w2y7aDsk6bGg0MzF5RVU= +golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.zx2c4.com/wireguard v0.0.0-20190409083948-18fa27047265 h1:ujM5BaP4MD/2MJZ1n7pmw6IIsyyS7SyPl0fDefnx/2o= -golang.zx2c4.com/wireguard v0.0.0-20190409083948-18fa27047265/go.mod h1:u0Cl3X+pyWdXaax3S583DQrnGDuTASO0QdlKFrs8r/8= -golang.zx2c4.com/wireguard v0.0.20190518-0.20190530131616-d9f995209c3c h1:nUKiRKxUjK8Zghs+JBZZYXo0g51BlXVqkr6mDfm22ow= -golang.zx2c4.com/wireguard v0.0.20190518-0.20190530131616-d9f995209c3c/go.mod h1:8X7vp4RrsvM83bde6vQ94DsL4ZpjUViVUym8aa8zGhs= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.zx2c4.com/wireguard v0.0.20190908 h1:SUoXDdwSMtomLdvke+zz83/u9tNvl4hHmcTIWp38tow= +golang.zx2c4.com/wireguard v0.0.20190908/go.mod h1:LhfXh5z6bLC2lW2ve6BzYZFwnnsXK3OQjySR0Yh2dO8= diff --git a/wireguard-go-bridge/goruntime-boottime-over-monotonic.diff b/wireguard-go-bridge/goruntime-boottime-over-monotonic.diff index e449ac4..71b4ebf 100644 --- a/wireguard-go-bridge/goruntime-boottime-over-monotonic.diff +++ b/wireguard-go-bridge/goruntime-boottime-over-monotonic.diff @@ -1,4 +1,4 @@ -From 74523c5a12d37fa792e77a252bcc569484c3d41a Mon Sep 17 00:00:00 2001 +From 04f5695b83cd221e99e9fa6171b57e45177d5ad3 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 27 Feb 2019 05:33:01 +0100 Subject: [PATCH] runtime: use libc_mach_continuous_time in nanotime on Darwin @@ -18,10 +18,10 @@ Fixes #24595 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runtime/sys_darwin.go b/src/runtime/sys_darwin.go -index f34ac88352..416fcb673f 100644 +index 376f76dbc5..a0677a83f6 100644 --- a/src/runtime/sys_darwin.go +++ b/src/runtime/sys_darwin.go -@@ -403,7 +403,7 @@ func closeonexec(fd int32) { +@@ -431,7 +431,7 @@ func setNonblock(fd int32) { //go:cgo_import_dynamic libc_usleep usleep "/usr/lib/libSystem.B.dylib" //go:cgo_import_dynamic libc_mach_timebase_info mach_timebase_info "/usr/lib/libSystem.B.dylib" @@ -31,10 +31,10 @@ index f34ac88352..416fcb673f 100644 //go:cgo_import_dynamic libc_sigaction sigaction "/usr/lib/libSystem.B.dylib" //go:cgo_import_dynamic libc_pthread_sigmask pthread_sigmask "/usr/lib/libSystem.B.dylib" diff --git a/src/runtime/sys_darwin_386.s b/src/runtime/sys_darwin_386.s -index 1bc1a63c28..34a3561350 100644 +index e653c54f61..5a43fcbdc1 100644 --- a/src/runtime/sys_darwin_386.s +++ b/src/runtime/sys_darwin_386.s -@@ -184,7 +184,7 @@ TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0 +@@ -199,7 +199,7 @@ TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0 PUSHL BP MOVL SP, BP SUBL $8+(machTimebaseInfo__size+15)/16*16, SP @@ -44,10 +44,10 @@ index 1bc1a63c28..34a3561350 100644 MOVL AX, 0(CX) MOVL DX, 4(CX) diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s -index f99cb00ab8..8b99316983 100644 +index 87c8db8c82..f962f24339 100644 --- a/src/runtime/sys_darwin_amd64.s +++ b/src/runtime/sys_darwin_amd64.s -@@ -86,7 +86,7 @@ TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0 +@@ -97,7 +97,7 @@ TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0 PUSHQ BP MOVQ SP, BP MOVQ DI, BX @@ -57,10 +57,10 @@ index f99cb00ab8..8b99316983 100644 MOVL timebase<>+machTimebaseInfo_numer(SB), SI MOVL timebase<>+machTimebaseInfo_denom(SB), DI // atomic read diff --git a/src/runtime/sys_darwin_arm.s b/src/runtime/sys_darwin_arm.s -index 54c7afbf34..a4f06fdb85 100644 +index 996f8028a3..5bd34b51be 100644 --- a/src/runtime/sys_darwin_arm.s +++ b/src/runtime/sys_darwin_arm.s -@@ -118,7 +118,7 @@ GLOBL timebase<>(SB),NOPTR,$(machTimebaseInfo__size) +@@ -126,7 +126,7 @@ GLOBL timebase<>(SB),NOPTR,$(machTimebaseInfo__size) TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$0 MOVW R0, R8 @@ -70,10 +70,10 @@ index 54c7afbf34..a4f06fdb85 100644 MOVW R1, 4(R8) MOVW timebase<>+machTimebaseInfo_numer(SB), R6 diff --git a/src/runtime/sys_darwin_arm64.s b/src/runtime/sys_darwin_arm64.s -index 29951d8ad7..cdaf0a630e 100644 +index ac3ca74f63..5e91540f94 100644 --- a/src/runtime/sys_darwin_arm64.s +++ b/src/runtime/sys_darwin_arm64.s -@@ -113,7 +113,7 @@ GLOBL timebase<>(SB),NOPTR,$(machTimebaseInfo__size) +@@ -121,7 +121,7 @@ GLOBL timebase<>(SB),NOPTR,$(machTimebaseInfo__size) TEXT runtime·nanotime_trampoline(SB),NOSPLIT,$40 MOVD R0, R19 @@ -83,5 +83,5 @@ index 29951d8ad7..cdaf0a630e 100644 MOVW timebase<>+machTimebaseInfo_numer(SB), R20 MOVD $timebase<>+machTimebaseInfo_denom(SB), R21 -- -2.20.1 +2.23.0 diff --git a/wireguard-go-bridge/goruntime-syscall-remove-getdirentries.diff b/wireguard-go-bridge/goruntime-syscall-remove-getdirentries.diff deleted file mode 100644 index a502fbb..0000000 --- a/wireguard-go-bridge/goruntime-syscall-remove-getdirentries.diff +++ /dev/null @@ -1,279 +0,0 @@ -From bc77ad792117829909eeeca3aa492d6f292d004d Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" -Date: Tue, 19 Mar 2019 13:55:44 -0600 -Subject: [PATCH] syscall: do not link against ___getdirentries64 - ---- - .../x/sys/unix/syscall_darwin_386.go | 5 ++++- - .../x/sys/unix/syscall_darwin_amd64.go | 5 ++++- - .../x/sys/unix/zsyscall_darwin_386.go | 22 ------------------- - .../x/sys/unix/zsyscall_darwin_386.s | 2 -- - .../x/sys/unix/zsyscall_darwin_amd64.go | 22 ------------------- - .../x/sys/unix/zsyscall_darwin_amd64.s | 2 -- - src/syscall/syscall_darwin_386.go | 5 ++++- - src/syscall/syscall_darwin_amd64.go | 5 ++++- - src/syscall/zsyscall_darwin_386.go | 20 ----------------- - src/syscall/zsyscall_darwin_386.s | 2 -- - src/syscall/zsyscall_darwin_amd64.go | 20 ----------------- - src/syscall/zsyscall_darwin_amd64.s | 2 -- - 12 files changed, 16 insertions(+), 96 deletions(-) - -diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go -index 489726fa9b..900dd7c91f 100644 ---- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go -+++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go -@@ -56,8 +56,11 @@ const SYS___SYSCTL = SYS_SYSCTL - //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 - //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 - //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 --//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 - //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 - //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 - //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 - //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 -+ -+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -+ return 0, ENOSYS -+} -diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go -index 914b89bde5..95e245fff7 100644 ---- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go -+++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go -@@ -56,8 +56,11 @@ const SYS___SYSCTL = SYS_SYSCTL - //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 - //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 - //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 --//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 - //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 - //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 - //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 - //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 -+ -+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -+ return 0, ENOSYS -+} -diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go -index 23346dc68f..db4f1eaf1c 100644 ---- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go -+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go -@@ -2408,28 +2408,6 @@ func libc_fstatfs64_trampoline() - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return --} -- --func libc___getdirentries64_trampoline() -- --//go:linkname libc___getdirentries64 libc___getdirentries64 --//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -- --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- - func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) - n = int(r0) -diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s -index 37b85b4f61..6165f70e33 100644 ---- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s -+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s -@@ -272,8 +272,6 @@ TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) - TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) --TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 -- JMP libc___getdirentries64(SB) - TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_getfsstat64(SB) - TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 -diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go -index b50178d679..dea5dee75e 100644 ---- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go -+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go -@@ -2408,28 +2408,6 @@ func libc_fstatfs64_trampoline() - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return --} -- --func libc___getdirentries64_trampoline() -- --//go:linkname libc___getdirentries64 libc___getdirentries64 --//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -- --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- - func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) - n = int(r0) -diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s -index da9b900a8c..f1e2d7e9a4 100644 ---- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s -+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s -@@ -272,8 +272,6 @@ TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) - TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) --TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 -- JMP libc___getdirentries64(SB) - TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_getfsstat64(SB) - TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 -diff --git a/src/syscall/syscall_darwin_386.go b/src/syscall/syscall_darwin_386.go -index 045ebc726b..826d76f569 100644 ---- a/src/syscall/syscall_darwin_386.go -+++ b/src/syscall/syscall_darwin_386.go -@@ -16,7 +16,6 @@ func setTimeval(sec, usec int64) Timeval { - - //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 - //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 --//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64 - //sysnb Gettimeofday(tp *Timeval) (err error) - //sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 - //sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 -@@ -63,3 +62,7 @@ func libc_sendfile_trampoline() - func syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) - - func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic -+ -+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -+ return 0, ENOSYS -+} -diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go -index 7b6493bf9f..3868790049 100644 ---- a/src/syscall/syscall_darwin_amd64.go -+++ b/src/syscall/syscall_darwin_amd64.go -@@ -16,7 +16,6 @@ func setTimeval(sec, usec int64) Timeval { - - //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 - //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 --//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64 - //sysnb Gettimeofday(tp *Timeval) (err error) - //sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 - //sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 -@@ -63,3 +62,7 @@ func libc_sendfile_trampoline() - func syscallX(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) - - func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) -+ -+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -+ return 0, ENOSYS -+} -diff --git a/src/syscall/zsyscall_darwin_386.go b/src/syscall/zsyscall_darwin_386.go -index 758ff7b129..a666a1f65e 100644 ---- a/src/syscall/zsyscall_darwin_386.go -+++ b/src/syscall/zsyscall_darwin_386.go -@@ -1845,27 +1845,7 @@ func libc_fstatfs64_trampoline() - - //go:linkname libc_fstatfs64 libc_fstatfs64 - //go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- --func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return --} -- --func libc___getdirentries64_trampoline() - --//go:linkname libc___getdirentries64 libc___getdirentries64 --//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - - func Gettimeofday(tp *Timeval) (err error) { -diff --git a/src/syscall/zsyscall_darwin_386.s b/src/syscall/zsyscall_darwin_386.s -index a688192501..a5af9b64b9 100644 ---- a/src/syscall/zsyscall_darwin_386.s -+++ b/src/syscall/zsyscall_darwin_386.s -@@ -235,8 +235,6 @@ TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstat64(SB) - TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) --TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 -- JMP libc___getdirentries64(SB) - TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 - JMP libc_gettimeofday(SB) - TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 -diff --git a/src/syscall/zsyscall_darwin_amd64.go b/src/syscall/zsyscall_darwin_amd64.go -index afc3d72d8d..bb87aef1f9 100644 ---- a/src/syscall/zsyscall_darwin_amd64.go -+++ b/src/syscall/zsyscall_darwin_amd64.go -@@ -1845,27 +1845,7 @@ func libc_fstatfs64_trampoline() - - //go:linkname libc_fstatfs64 libc_fstatfs64 - //go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- --func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return --} -- --func libc___getdirentries64_trampoline() - --//go:linkname libc___getdirentries64 libc___getdirentries64 --//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - - func Gettimeofday(tp *Timeval) (err error) { -diff --git a/src/syscall/zsyscall_darwin_amd64.s b/src/syscall/zsyscall_darwin_amd64.s -index 21ab38e3ee..409320dea5 100644 ---- a/src/syscall/zsyscall_darwin_amd64.s -+++ b/src/syscall/zsyscall_darwin_amd64.s -@@ -235,8 +235,6 @@ TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstat64(SB) - TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) --TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 -- JMP libc___getdirentries64(SB) - TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 - JMP libc_gettimeofday(SB) - TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 --- -2.21.0 - diff --git a/wireguard-go-bridge/sys-unix-remove-getdirentries.diff b/wireguard-go-bridge/sys-unix-remove-getdirentries.diff deleted file mode 100644 index 2df5a94..0000000 --- a/wireguard-go-bridge/sys-unix-remove-getdirentries.diff +++ /dev/null @@ -1,143 +0,0 @@ -From 3efe4df9b66d4af86363e37768ea469abb8f7bdc Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" -Date: Tue, 19 Mar 2019 14:01:21 -0600 -Subject: [PATCH] unix: do not link against ___getdirentries64 - ---- - unix/syscall_darwin_386.go | 5 ++++- - unix/syscall_darwin_amd64.go | 5 ++++- - unix/zsyscall_darwin_386.go | 22 ---------------------- - unix/zsyscall_darwin_386.s | 2 -- - unix/zsyscall_darwin_amd64.go | 22 ---------------------- - unix/zsyscall_darwin_amd64.s | 2 -- - 6 files changed, 8 insertions(+), 50 deletions(-) - -diff --git a/unix/syscall_darwin_386.go b/unix/syscall_darwin_386.go -index 489726f..900dd7c 100644 ---- a/unix/syscall_darwin_386.go -+++ b/unix/syscall_darwin_386.go -@@ -56,8 +56,11 @@ const SYS___SYSCTL = SYS_SYSCTL - //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 - //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 - //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 --//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 - //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 - //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 - //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 - //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 -+ -+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -+ return 0, ENOSYS -+} -diff --git a/unix/syscall_darwin_amd64.go b/unix/syscall_darwin_amd64.go -index 914b89b..95e245f 100644 ---- a/unix/syscall_darwin_amd64.go -+++ b/unix/syscall_darwin_amd64.go -@@ -56,8 +56,11 @@ const SYS___SYSCTL = SYS_SYSCTL - //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 - //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 - //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 --//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 - //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 - //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 - //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 - //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 -+ -+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -+ return 0, ENOSYS -+} -diff --git a/unix/zsyscall_darwin_386.go b/unix/zsyscall_darwin_386.go -index 23346dc..db4f1ea 100644 ---- a/unix/zsyscall_darwin_386.go -+++ b/unix/zsyscall_darwin_386.go -@@ -2408,28 +2408,6 @@ func libc_fstatfs64_trampoline() - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return --} -- --func libc___getdirentries64_trampoline() -- --//go:linkname libc___getdirentries64 libc___getdirentries64 --//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -- --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- - func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) - n = int(r0) -diff --git a/unix/zsyscall_darwin_386.s b/unix/zsyscall_darwin_386.s -index 37b85b4..6165f70 100644 ---- a/unix/zsyscall_darwin_386.s -+++ b/unix/zsyscall_darwin_386.s -@@ -272,8 +272,6 @@ TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) - TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) --TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 -- JMP libc___getdirentries64(SB) - TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_getfsstat64(SB) - TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 -diff --git a/unix/zsyscall_darwin_amd64.go b/unix/zsyscall_darwin_amd64.go -index c142e33..126f993 100644 ---- a/unix/zsyscall_darwin_amd64.go -+++ b/unix/zsyscall_darwin_amd64.go -@@ -2423,28 +2423,6 @@ func libc_fstatfs64_trampoline() - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return --} -- --func libc___getdirentries64_trampoline() -- --//go:linkname libc___getdirentries64 libc___getdirentries64 --//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -- --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- - func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) - n = int(r0) -diff --git a/unix/zsyscall_darwin_amd64.s b/unix/zsyscall_darwin_amd64.s -index 1a39151..a19c4f5 100644 ---- a/unix/zsyscall_darwin_amd64.s -+++ b/unix/zsyscall_darwin_amd64.s -@@ -274,8 +274,6 @@ TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) - TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) --TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 -- JMP libc___getdirentries64(SB) - TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_getfsstat64(SB) - TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 --- -2.21.0 -