wireguard-go-bridge: do not use getdirentries64 on macos
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
5f8843e247
commit
b21fdfed67
|
@ -26,7 +26,7 @@ export CGO_ENABLED := 1
|
||||||
build: $(DESTDIR)/libwg-go.a
|
build: $(DESTDIR)/libwg-go.a
|
||||||
version-header: $(DESTDIR)/wireguard-go-version.h
|
version-header: $(DESTDIR)/wireguard-go-version.h
|
||||||
|
|
||||||
GOBUILDVERSION_NEEDED := go version go1.12 darwin/amd64
|
GOBUILDVERSION_NEEDED := go version go1.12.1 darwin/amd64
|
||||||
GOBUILDVERSION_CURRENT := $(shell go version 2>/dev/null)
|
GOBUILDVERSION_CURRENT := $(shell go version 2>/dev/null)
|
||||||
export REAL_GOROOT := $(shell go env GOROOT 2>/dev/null)
|
export REAL_GOROOT := $(shell go env GOROOT 2>/dev/null)
|
||||||
export GOROOT := $(BUILDDIR)/goroot
|
export GOROOT := $(BUILDDIR)/goroot
|
||||||
|
@ -44,7 +44,10 @@ $(GOROOT)/.prepared:
|
||||||
[ -n "$(REAL_GOROOT)" ]
|
[ -n "$(REAL_GOROOT)" ]
|
||||||
mkdir -p "$(GOROOT)"
|
mkdir -p "$(GOROOT)"
|
||||||
rsync -a --delete --exclude=pkg/obj/go-build "$(REAL_GOROOT)/" "$(GOROOT)/"
|
rsync -a --delete --exclude=pkg/obj/go-build "$(REAL_GOROOT)/" "$(GOROOT)/"
|
||||||
patch -p1 -f -N -r- -d "$(GOROOT)" < goruntime-boottime-over-monotonic.diff
|
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
|
||||||
touch "$@"
|
touch "$@"
|
||||||
|
|
||||||
$(shell test "$$(cat "$(BUILDDIR)/.gobuildversion" 2>/dev/null)" = "$(GOBUILDVERSION_CURRENT)" || rm -f "$(DESTDIR)/libwg-go.a")
|
$(shell test "$$(cat "$(BUILDDIR)/.gobuildversion" 2>/dev/null)" = "$(GOBUILDVERSION_CURRENT)" || rm -f "$(DESTDIR)/libwg-go.a")
|
||||||
|
@ -63,7 +66,6 @@ endef
|
||||||
$(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH))))
|
$(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH))))
|
||||||
|
|
||||||
$(DESTDIR)/wireguard-go-version.h: go.mod $(GOROOT)/.prepared
|
$(DESTDIR)/wireguard-go-version.h: go.mod $(GOROOT)/.prepared
|
||||||
go get -d -tags ios; chmod -fR +w "$(GOPATH)/pkg/mod"
|
|
||||||
wggo="$(GOPATH)/pkg/mod/$$(sed -n 's/.*\(golang\.zx2c4\.com\/wireguard\) \(.*\)$$/\1@\2/p' go.mod)"; \
|
wggo="$(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" > "$@"
|
sed -n 's/.*WireGuardGoVersion = "\(.*\)"/#define WIREGUARD_GO_VERSION "\1"/p' "$$wggo/device/version.go" > "$@"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,279 @@
|
||||||
|
From bc77ad792117829909eeeca3aa492d6f292d004d Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
|
||||||
|
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
|
||||||
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
From 3efe4df9b66d4af86363e37768ea469abb8f7bdc Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue