Skip to content

Avoid shipping internal musl headers as part of the sysroot#26658

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:musl_internal_headers
Apr 9, 2026
Merged

Avoid shipping internal musl headers as part of the sysroot#26658
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:musl_internal_headers

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Apr 9, 2026

It turns out that the files in musl/arch/generic/ and musl/arch/emscripten/ are supposed to me internal headers even though the bits/ subdirectories are public.

This change means that syscall_arch.h is not longer visible outside of the musl build (e.g. when building wasmfs) so I moved the public function declarations to emscripten/syscalls.h.

@sbc100 sbc100 requested review from kleisauke and kripken April 9, 2026 07:01
@sbc100 sbc100 force-pushed the musl_internal_headers branch 4 times, most recently from b77b9aa to 30cab7e Compare April 9, 2026 17:03
@kleisauke
Copy link
Copy Markdown
Collaborator

The other.test_standalone_system_headers_st test failure looks real, although the complaint about intptr_t being unknown may also be resolved PR #19559 (I plan to split that PR later today).

BTW, are API-incompatible changes in the emscripten/syscalls.h header permitted? In other words, is this public header intended for use outside of Emscripten?

It turns out that the files in `musl/arch/generic/` and
`musl/arch/emscripten/` are internal headers even though the `bits/`
subdirectories are public.

This change did mean that `syscall_arch.h` is not longer visible to
the wasmfs build so I moved the public function declarations to
`emscripten/syscalls.h`.
@sbc100 sbc100 force-pushed the musl_internal_headers branch from 30cab7e to bba540c Compare April 9, 2026 17:06
@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Apr 9, 2026

The other.test_standalone_system_headers_st test failure looks real, although the complaint about intptr_t being unknown may also be resolved PR #19559 (I plan to split that PR later today).

Fixed.

BTW, are API-incompatible changes in the emscripten/syscalls.h header permitted? In other words, is this public header intended for use outside of Emscripten?

I mean.. we can always make ABI-incompatible changes if we deem it worth it (i.e. the impact is low and the benefit is high).

Hopefully the number of users of syscalls.h will always be low (at least I would hope that is the case).

@kleisauke
Copy link
Copy Markdown
Collaborator

Great!

Hopefully the number of users of syscalls.h will always be low (at least I would hope that is the case).

Indeed. AFAIK, after PR #24655 only libsyscall.js, WasmFS and the weak stub override implementations (i.e. emscripten_syscall_stubs.c and standalone.c) rely on it outside of musl itself.

Copy link
Copy Markdown
Collaborator

@kleisauke kleisauke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sbc100 sbc100 merged commit dc413f8 into emscripten-core:main Apr 9, 2026
38 checks passed
@sbc100 sbc100 deleted the musl_internal_headers branch April 9, 2026 22:51
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.

2 participants