sdk: preserve pthread compiler semantics - #938
Closed
brandonpayton wants to merge 2 commits into
Closed
Conversation
Keep parser classifications for SDK mode and thread inference, but forward non-SDK arguments in their original sequence so objects, -l libraries, archives, and linker group controls retain normal static-link semantics. Add unit and real wasm-ld coverage for mixed input ordering and linker controls.
Forward -pthread to Clang so configure probes receive the standard _REENTRANT definition while keeping -lpthread as the existing musl compatibility no-op. Keep the source and in-guest SDK drivers aligned and cover the Autoconf compile-and-link shape.
This was referenced Jul 14, 2026
Contributor
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| icu | wasm32 | built | f2e695e4 |
| libcurl | wasm32 | built | 2d9fc0e9 |
| libcxx | wasm32 | built | aca0859f |
| libcxx | wasm64 | built | d3353c8b |
| libiconv | wasm32 | built | c8ee6514 |
| libpng | wasm32 | built | d23eb9a8 |
| libxml2 | wasm32 | built | a2c268e1 |
| libzip | wasm32 | built | a8a2053d |
| openssl | wasm32 | built | 7ec09ece |
| openssl | wasm64 | built | 5138eb1d |
| sqlite | wasm32 | built | 9964d42c |
| sqlite | wasm64 | built | 3f6d4e53 |
| zlib | wasm32 | built | 6e32642b |
| zlib | wasm64 | built | 7cb3e2c3 |
| bc | wasm32 | built | b5e1e72e |
| bzip2 | wasm32 | built | 8360bb15 |
| coreutils | wasm32 | built | 9736f5c1 |
| curl | wasm32 | built | 08f31048 |
| dash | wasm32 | built | 0dda8fe7 |
| diffutils | wasm32 | built | a65dc325 |
| dinit | wasm32 | built | 021a7147 |
| fbdoom | wasm32 | built | da6efb4e |
| file | wasm32 | built | d26064da |
| findutils | wasm32 | built | 2b10b7a8 |
| gawk | wasm32 | built | eaf1ee46 |
| git | wasm32 | built | 46e089de |
| grep | wasm32 | built | 89d985ed |
| gzip | wasm32 | built | b473d3cb |
| hello | wasm32 | built | 1b5808b4 |
| kandelo-sdk | wasm32 | built | 9d7c338f |
| kernel | wasm32 | built | 1cd93cb0 |
| less | wasm32 | built | ecc93e5f |
| lsof | wasm32 | built | 3d9ef32f |
| m4 | wasm32 | built | d0f4764c |
| make | wasm32 | built | c14f3ec3 |
| mariadb | wasm32 | built | af817f57 |
| mariadb | wasm64 | built | 2ce5a72e |
| modeset | wasm32 | built | 1b6f3166 |
| msmtpd | wasm32 | built | c299471b |
| nano | wasm32 | built | 59e63305 |
| ncurses | wasm32 | built | 2666604b |
| netcat | wasm32 | built | edaa94f1 |
| nginx | wasm32 | built | 5b281460 |
| php | wasm32 | built | e33d9621 |
| posix-utils-lite | wasm32 | built | 124efa0c |
| ruby | wasm32 | built | b70c442b |
| sed | wasm32 | built | e30232c4 |
| spidermonkey | wasm32 | built | 5439f082 |
| tar | wasm32 | built | 0db63c2b |
| tcl | wasm32 | built | fef4bbf1 |
| unzip | wasm32 | built | 71efacd8 |
| userspace | wasm32 | built | 6dead609 |
| vim | wasm32 | built | 8227dba0 |
| wget | wasm32 | built | bc3dfdbd |
| xz | wasm32 | built | 6375c5a6 |
| zip | wasm32 | built | 0f9d71ae |
| zstd | wasm32 | built | b233bb34 |
| bash | wasm32 | built | d06904ca |
| mariadb-test | wasm32 | built | e1d1bc49 |
| mariadb-vfs | wasm32 | built | 36e04d39 |
| mariadb-vfs | wasm64 | built | c6ae7efa |
| nethack | wasm32 | built | 286f0ea1 |
| node | wasm32 | built | 092ac57a |
| spidermonkey-node | wasm32 | built | 113b2b34 |
| vim-browser-bundle | wasm32 | built | 1c521853 |
| nethack-browser-bundle | wasm32 | built | 73ba24a7 |
| rootfs | wasm32 | built | f90ec0a3 |
| shell | wasm32 | built | 0e21ee6d |
| lamp | wasm32 | built | eb5bbda0 |
| node-vfs | wasm32 | built | 73f29b3c |
| wordpress | wasm32 | built | 39952083 |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
Member
Author
|
Absorbed by rebase-merged #967. Main is now 6efb411 with the sealed tree b133bfa018f7e2bc84c4845edf2f945b2f844954, and ABI 41 activation completed successfully in run 29550069085. The absorption audit confirmed this PR\x27s behavior and tests are present in that merged tree, so this source PR is closed and its branch is deleted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
AX_PTHREAD is a standard Autoconf configure check that discovers how a compiler enables POSIX threads. The SDK is Kandelo's software development kit, which drives Clang for package builds.
XZ's standard AX_PTHREAD configure probe compiles with
-pthreadand requires Clang's_REENTRANTdefinition. Kandelo's SDK silently removed-pthread, so the probe failed even though Kandelo provides working pthread APIs. That leftPTHREAD_CFLAGSandPTHREAD_LIBSempty and produced incompleteliblzma.pcmetadata.This is an SDK compiler-driver defect exposed by the Homebrew XZ build. The fix belongs in the platform, not in an XZ Formula cache override.
What changed
-pthreadto Clang in the TypeScript SDK driver;-lpthreadas the existing compatibility no-op because pthread symbols come from musl'slibc.a;_REENTRANTand real pthread symbols.The change preserves #913's exact linker-input ordering:
-pthreadenters the single ordered forwarding stream at the position supplied by the caller.Ordering
This PR is stacked on #913 (
sdk: preserve static linker argument order) because both changes touch the SDK argument-forwarding path. Merge #913 first, then retarget this PR tomain.ABI
No ABI bump is required. This changes how the compiler driver treats an existing source/build flag; it does not change syscalls, marshalling, channel or memory layouts, exported runtime interfaces, libc signatures, fork frames, or ABI metadata. The canonical ABI snapshot/version check is unchanged and passes.
Consumer proof
A disposable future-platform integration combined exact #936 + #913 + #874 + #883 with this fix (synthetic tree
f1614ed97525db9d9f80bac987645787ecdecad5). The supported XZ Homebrew build then reported:PTHREAD_CFLAGS=-pthreadandPTHREAD_LIBS=-lpthread;liblzma.pcrecordedLibs.private: -pthread -lpthread;This evidence is local and unpublished; no XZ-specific source or Formula workaround is part of this PR.
Validation
Exact head:
a27676e3b397996417397c0428a46ea12bf54eccExact tree:
ce3ea9b1b287919eb46216bd735fa49b6f3a66ac#define _REENTRANT 1for-pthread;./scripts/dev-shell.sh bash scripts/check-abi-version.sh: passed;git diff --check: passed.All validation ran through
scripts/dev-shell.sh. No XZ-specific patch is included.