summaryrefslogtreecommitdiff
path: root/user/gitlab-runner/fix-multiple-redef-seek.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2023-01-04 02:32:30 +0000
committerZach van Rijn <me@zv.io>2023-01-04 02:35:23 +0000
commitb75332c999508e359ef1e031380dd80d81b396ae (patch)
tree1567d297f7357a771e33c41591b8a486e24a5fda /user/gitlab-runner/fix-multiple-redef-seek.patch
parente16b285c8e8c54bed0ec0eba419c2959e7e22b07 (diff)
downloadpackages-b75332c999508e359ef1e031380dd80d81b396ae.tar.gz
packages-b75332c999508e359ef1e031380dd80d81b396ae.tar.bz2
packages-b75332c999508e359ef1e031380dd80d81b396ae.tar.xz
packages-b75332c999508e359ef1e031380dd80d81b396ae.zip
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
Diffstat (limited to 'user/gitlab-runner/fix-multiple-redef-seek.patch')
-rw-r--r--user/gitlab-runner/fix-multiple-redef-seek.patch38
1 files changed, 38 insertions, 0 deletions
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)