-
Notifications
You must be signed in to change notification settings - Fork 30
Reduce CppInterOp Emscripten shared library size #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
028503c
22421d2
b7aa806
48d8d7d
5b9b98e
a6246f1
e748750
71a7da1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,10 +127,16 @@ if(EMSCRIPTEN) | |
set_target_properties(clangCppInterOp | ||
PROPERTIES NO_SONAME 1 | ||
) | ||
target_compile_options(clangCppInterOp | ||
PRIVATE "SHELL: -Oz" | ||
PRIVATE "SHELL: -flto" | ||
Comment on lines
+131
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't these become part of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will give it a go and find out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried this out and couldn't get it to work. For some reason if I do it via cmake options then Ubuntu both x86 and arm cannot pass xeus-cpps Emscripten tests for llvm 20. I have reverted back to the original solution now, and waiting to see the ci pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How's that even possible... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its not supposed to he possible according to the WebAssembly/Emscripten standard. The result should be independent of the platform you cross compile from, but I have come accross a few examples where this is found not to be true in reality (and shows exactly why we should be cross compiling from multiple platforms in the ci to tests these assumptions). In the process of trying to get the cmake approach to work I found out that the symbols you need to export on each platform manually to get the CppInterOps tests to pass are not the same (e.g. you can not export _ZN4llvm15SmallVectorBaseIjE8set_sizeEm , and the Emscripten tests will build and pass on Ubuntu, but wont build on MacOS or Windows) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vgvassilev Here is a workflow run where Ubuntu arm and x86 fail for llvm 20 Emscripten builds using cmake options https://github.com/compiler-research/CppInterOp/actions/runs/16596946952 despite the other platforms passing |
||
) | ||
target_link_options(clangCppInterOp | ||
PRIVATE "SHELL: -s WASM_BIGINT" | ||
PRIVATE "SHELL: -s SIDE_MODULE=1" | ||
PRIVATE "SHELL: ${SYMBOLS_LIST}" | ||
PRIVATE "SHELL: -Oz" | ||
PRIVATE "SHELL: -flto" | ||
mcbarton marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
else() | ||
target_link_options(clangCppInterOp | ||
|
Uh oh!
There was an error while loading. Please reload this page.