From b75332c999508e359ef1e031380dd80d81b396ae Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 4 Jan 2023 02:32:30 +0000 Subject: user/gitlab-runner: patch armv7 for multiple redefinition 'seek'. the file: sys/unix/syscall_linux_arm.go seems to declare 'seek()' as a prototype, the implementation being: sys/unix/syscall_linux_gccgo_arm.go however it isn't immediately clear why the conflict occurs, unless it has to do with our Makefile patches, which CGO_ENABLED=1? fixes #956 --- user/gitlab-runner/fix-multiple-redef-seek.patch | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 user/gitlab-runner/fix-multiple-redef-seek.patch (limited to 'user/gitlab-runner/fix-multiple-redef-seek.patch') diff --git a/user/gitlab-runner/fix-multiple-redef-seek.patch b/user/gitlab-runner/fix-multiple-redef-seek.patch new file mode 100644 index 000000000..5a9d1ef10 --- /dev/null +++ b/user/gitlab-runner/fix-multiple-redef-seek.patch @@ -0,0 +1,38 @@ +diff -ur a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go 2023-01-04 02:17:18.689781320 +0000 ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go 2023-01-04 02:19:46.688219811 +0000 +@@ -45,7 +45,13 @@ + + // Underlying system call writes to newoffset via pointer. + // Implemented in assembly to avoid allocation. +-func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) ++func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { ++ var newoffset int64 ++ offsetLow := uint32(offset & 0xffffffff) ++ offsetHigh := uint32((offset >> 32) & 0xffffffff) ++ _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) ++ return newoffset, err ++} + + func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + newoffset, errno := seek(fd, offset, whence) +diff -ur a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +--- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go 2023-01-04 02:17:18.689781320 +0000 ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go 2023-01-04 02:20:04.283558738 +0000 +@@ -2,7 +2,7 @@ + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + +-// +build linux,gccgo,arm ++// +build linux,!gccgo,arm + + package unix + +@@ -11,6 +11,7 @@ + "unsafe" + ) + ++// this file should not be built + func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { + var newoffset int64 + offsetLow := uint32(offset & 0xffffffff) -- cgit v1.2.3-70-g09d2