From df1a244de7adb2d79019ef2a4359e4bf4c34a7aa Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Thu, 5 Mar 2026 08:51:17 +0800 Subject: [PATCH] fix: regression segfault on linux 3.4 on mipsle --- .github/patch/cl747663.patch | 36 ++++++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 7 +++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/patch/cl747663.patch diff --git a/.github/patch/cl747663.patch b/.github/patch/cl747663.patch new file mode 100644 index 00000000..9f9139bf --- /dev/null +++ b/.github/patch/cl747663.patch @@ -0,0 +1,36 @@ +From b8f897a9da7a82ad8584a22284ceac61262fcb7e Mon Sep 17 00:00:00 2001 +From: Jorropo +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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 140cac48..d5b55fd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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/