fix: regression segfault on linux 3.4 on mipsle

This commit is contained in:
wwqgtxx
2026-03-05 08:51:17 +08:00
parent 4399d88ebe
commit df1a244de7
2 changed files with 43 additions and 0 deletions

36
.github/patch/cl747663.patch vendored Normal file
View File

@@ -0,0 +1,36 @@
From b8f897a9da7a82ad8584a22284ceac61262fcb7e Mon Sep 17 00:00:00 2001
From: Jorropo <jorropo.pgm@gmail.com>
Date: Sun, 22 Feb 2026 01:47:45 +0100
Subject: [PATCH] runtime: fix value of ENOSYS on mips from 38 to 89
Fixes #77731
Change-Id: Iaca444e2d5f9e19fd2de38414b357b41471a668c
---
diff --git a/src/runtime/defs_linux_mips64x.go b/src/runtime/defs_linux_mips64x.go
index 7449d2c..4d0f103 100644
--- a/src/runtime/defs_linux_mips64x.go
+++ b/src/runtime/defs_linux_mips64x.go
@@ -12,7 +12,7 @@
_EINTR = 0x4
_EAGAIN = 0xb
_ENOMEM = 0xc
- _ENOSYS = 0x26
+ _ENOSYS = 0x59
_PROT_NONE = 0x0
_PROT_READ = 0x1
diff --git a/src/runtime/defs_linux_mipsx.go b/src/runtime/defs_linux_mipsx.go
index 5a446e0..b8da4d0 100644
--- a/src/runtime/defs_linux_mipsx.go
+++ b/src/runtime/defs_linux_mipsx.go
@@ -12,7 +12,7 @@
_EINTR = 0x4
_EAGAIN = 0xb
_ENOMEM = 0xc
- _ENOSYS = 0x26
+ _ENOSYS = 0x59
_PROT_NONE = 0x0
_PROT_READ = 0x1

View File

@@ -179,6 +179,13 @@ jobs:
tar zxf go1.26.0.linux-amd64-abi1.tar.gz -C $HOME/usr/local
echo "$HOME/usr/local/go/bin" >> $GITHUB_PATH
# TODO: remove after CL747663 merged, see: https://github.com/golang/go/issues/77731
- name: Apply CL747663 for Golang1.26
if: ${{ matrix.jobs.goversion == '' }}
run: |
cd $(go env GOROOT)
patch --verbose -p 1 < $GITHUB_WORKSPACE/.github/patch/cl747663.patch
# this patch file only works on golang1.26.x
# that means after golang1.27 release it must be changed
# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.26/