Delete use stub from asm.s, leaving only a dummy file.
Deleting the file causes Windows build to fail.
Fixes #16607
Change-Id: Ic5a55e042e588f1e1bc6605a3d309d1eabdeb288
Reviewed-on: https://go-review.googlesource.com/36716
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "textflag.h"
-
-TEXT ·use(SB),NOSPLIT,$0
- RET
+// Dummy asm file to keep Windows building.
+// TODO(sameer): delete this after updating go tool
+// per Ian's comment in golang.org/cl/36716
return nil, err
}
a, e := getprocaddress(uintptr(d.Handle), namep)
- use(unsafe.Pointer(namep))
if e != 0 {
return nil, &DLLError{
Err: e,
//
package syscall
-import "unsafe"
-
//go:generate go run mksyscall_windows.go -systemdll -output zsyscall_windows.go syscall_windows.go security_windows.go
// StringByteSlice converts a string to a NUL-terminated []byte,
// Getpagesize is provided by the runtime.
func Getpagesize() int
-
-// use is a no-op, but the compiler cannot see that it is.
-// Calling use(p) ensures that p is kept live until that point.
-// This was needed until Go 1.6 to call syscall.Syscall correctly.
-// As of Go 1.6 the compiler handles that case automatically.
-// The uses and definition of use can be removed early in the Go 1.7 cycle.
-//go:noescape
-func use(p unsafe.Pointer)
uintptr(options),
0,
)
- use(unsafe.Pointer(_p0))
if e1 != 0 {
return nil, e1
}
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))
- use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
- use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
- use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
return err
}
err = futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
- use(unsafe.Pointer(pathp))
return err
}
return err
}
err = mount(source, target, fstype, flags, datap)
- use(unsafe.Pointer(datap))
return err
}
return err
}
_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- use(unsafe.Pointer(pathp))
if e != 0 {
err = e
}
return err
}
_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- use(unsafe.Pointer(pathp))
if e != 0 {
err = e
}
func Fstatfs(fd int, buf *Statfs_t) (err error) {
_, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- use(unsafe.Pointer(buf))
if e != 0 {
err = errnoErr(e)
}
return err
}
_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(p)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- use(unsafe.Pointer(p))
if e != 0 {
err = errnoErr(e)
}
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)}
r0, _, e1 := Syscall(SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0)
- use(unsafe.Pointer(&mmap_args[0]))
xaddr = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
return err
}
r0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(namep)), oldptr, 0)
- use(unsafe.Pointer(namep))
}
- use(unsafe.Pointer(oldp))
if int32(r0) == -1 {
err = e