Skip to content

Deferred consolidation: 5-arch setjmp asm + thread core (residual)#48

Merged
cataggar merged 1 commit into
libc17-704from
libc17-704-deferred-thread-setjmp3
Jun 13, 2026
Merged

Deferred consolidation: 5-arch setjmp asm + thread core (residual)#48
cataggar merged 1 commit into
libc17-704from
libc17-704-deferred-thread-setjmp3

Conversation

@cataggar

Copy link
Copy Markdown
Owner

Refs #17

MIGRATED:

  • setjmp/longjmp/sigsetjmp global asm in lib/c/setjmp.zig for arm/thumb (arm/armeb/thumb/thumbeb), riscv32/riscv64, powerpc/powerpc64 (powerpc/powerpcle/powerpc64/powerpc64le), and s390x.
  • Commented the matching musl setjmp/sigsetjmp asm entries in src/libs/musl.zig.

NOT LANDED / RESIDUAL:

  • Cancellation core stays musl C/asm: pthread_cancel.c, __syscall_cp.c, per-arch syscall_cp.s, and SIGCANCEL wiring. This remains the gate for nanosleep/wait*/system/sigsuspend/sigwait*/pause cancellation-point Zig re-ports.
  • pthread_create/join/key_create/atfork/cleanup_push/getattr_np and arch clone/tls/unmap/thread-area pieces stay musl C/asm.
  • Futex mutex/cond/rwlock cluster stays musl C: pthread_mutex_{lock,timedlock,trylock,unlock}, pthread_cond_{broadcast,destroy,init,signal,timedwait,wait}, __lock.c, lock_ptc.c, __wait/vmlock. This cluster previously broke multithreaded stage4 with mutex/condition_variable aborts, so it was intentionally not touched in this safe increment.

VERIFICATION:

  • python3 scripts/check_musl_migration.py: OK.
  • 21 non-loongarch target compile-checks passed in Debug, ReleaseFast, ReleaseSmall.
  • Built stage4 from this branch.
  • stage4 cross-asm build-exe C smoke passed for all touched setjmp families/variants.
  • stage4 threaded x86_64 test-libc-nsz -j8 repeated 3x: success, no mutex/thread aborts.
  • Full test-libc-nsz -Dtest-filter=all passed for x86_64 plus qemu spot checks: arm, thumb, riscv, powerpc, s390x.

Port arm/thumb, riscv32/riscv64, powerpc/powerpc64, and s390x setjmp/longjmp/sigsetjmp assembly into lib/c/setjmp.zig global asm. Leave the cancellation and pthread futex core on musl C for a later, stage4-critical pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cataggar cataggar merged commit 4506f00 into libc17-704 Jun 13, 2026
12 checks passed
@cataggar cataggar deleted the libc17-704-deferred-thread-setjmp3 branch June 13, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant