Repository navigation
Commit 698cb7f
committed
K2GO-411 fix(proot): translate aarch32 futex_time64 to host futex for 32-bit Go on pre-5.1 kernels
32-bit Go binaries (e.g. Forgejo arm-6) crash under the K2Go proot on devices
whose real kernel is older than Linux 5.1: Go's linux/arm runtime issues
futex_time64 (arm #422), which the kernel lacks and proot did not translate, so
it returned ENOSYS and Go aborted with "futexwakeup returned -38".
Patch the bundled termux-packages proot at build time, in the proot
termux_step_pre_configure block (same mechanism as the fchmodat2 patch), to remap
the aarch32 futex_time64 to the host futex. Four idempotent, guarded edits:
- sysnums.list: declare the abstract PR_futex_time64.
- enter.c: set_sysnum(tracee, PR_futex) at sysenter.
- sysnums-*.h: map raw 422 in the 32-bit ABI tables; the "[ 240 ] = PR_futex"
anchor auto-scopes to arm/i386, so arm64/x86_64 skip.
- seccomp.c: trace it so the rewrite runs in the default seccomp-accelerated mode.
__kernel_timespec is 64-bit and byte-compatible with the host timespec, so this
is a syscall-number remap, not an argument rewrite. Builds still cover both
arm64-v8a and armeabi-v7a; the patch is inert in the 64-bit table.
Device-verified: the futex_time64(422) C probe returns 0 (was ENOSYS) and
forgejo --version runs with no crash. Not a seccomp issue; PROOT_NO_SECCOMP=1
does not help.1 parent 1619008 commit 698cb7f
1 file changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
140 | 173 | | |
141 | 174 | | |
142 | 175 | | |
| |||
0 commit comments