Repository navigation
[cmake] Use STATIC_LIBRARY in CheckTypeSize.cmake - #27934
Merged
sbc100 merged 2 commits intoOct 9, 2026
Merged
Conversation
sbc100
force-pushed
the
fix-checktypesize-shared-memory
branch
from
October 9, 2026 05:24
30651d7 to
c4845a9
Compare
sbc100
marked this pull request as ready for review
October 9, 2026 05:31
kripken
reviewed
Oct 9, 2026
Supersedes emscripten-core#22304. Instead of linking an executable with `--oformat=wasm` or `--oformat=bare`, set `CMAKE_TRY_COMPILE_TARGET_TYPE` to `STATIC_LIBRARY` so `try_compile` only compiles and archives the object file without running the linker. Pass `-fno-lto` so that even when `-flto` is present in `CFLAGS`, a standard Wasm object file (containing the plain ASCII `INFO:size[...]` string) is emitted rather than LLVM bitcode. Also add `-sWASM_WORKERS`, `-sEXIT_RUNTIME`, and `-flto` coverage to `test_cmake_check_type_size`. Fixes: emscripten-core#27932
Collaborator
Author
|
Ok, I re-worked to avoid |
sbc100
force-pushed
the
fix-checktypesize-shared-memory
branch
from
October 9, 2026 21:08
c4845a9 to
c0b8fa3
Compare
STATIC_LIBRARY in CheckTypeSize.cmake
sbc100
enabled auto-merge (squash)
October 9, 2026 21:50
kripken
approved these changes
Oct 9, 2026
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.
Supersedes #22304.
Instead of linking an executable with
--oformat=wasmor--oformat=bare, setCMAKE_TRY_COMPILE_TARGET_TYPEtoSTATIC_LIBRARYsotry_compileonly compiles and archives the objectfile without running the linker.
Pass
-fno-ltoso that even when-fltois present inCFLAGS, astandard Wasm object file (containing the plain ASCII
INFO:size[...]string) is emitted rather than LLVM bitcode.
Also add
-sWASM_WORKERS,-sEXIT_RUNTIME, and-fltocoverage totest_cmake_check_type_size.Fixes: #27932