Skip to content
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

Increase Emscripten stack size (+options update) #792

Merged
merged 4 commits into from
Feb 9, 2023

Conversation

Daft-Freak
Copy link
Collaborator

Default stack was decreased in emscripten-core/emscripten@157fcd4. 64k results in screen corruption in even the most minimal example, 256k is enough to fix this but increase to 1MB to be safe. (Old default was 5MB)

Also clean up to use the preferred -sTHING= syntax and remove the EXTRA_ from EXPORTED_RUNTIME_METHODS.

Move from -s THING to -sTHING
Default was decreased in emscripten-core/emscripten@157fcd4. 64k results in screen corruption in even the most minimal example, 256k is enough to fix this but increase to 1MB to be safe. (Old default was 5MB)
STACK_SIZE requires 3.1.25
Just use EXPORTED_RUNTIME_METHODS instead
@Gadgetoid
Copy link
Contributor

Thank you!

I went to grab a zip of build artifacts to try- force of habit from Pico- but there are none 😢 I don't think there's a reason for this? I'll raise a PR to add them when I get a moment.

Built it locally- taking an opportunity to test the guide- and it all looks good!

@Gadgetoid Gadgetoid merged commit 3c6de84 into master Feb 9, 2023
@Daft-Freak Daft-Freak deleted the patch-emscripten-stack branch February 9, 2023 14:16
@Daft-Freak
Copy link
Collaborator Author

Yeah, I don't think there's a reason for not having artifacts either... other than nobody thought of adding them (and maybe that the CI was travis at one point)

Artifacts for the emscripten build will be slightly harder as you can't just install to get all the files. (cmake doesn't understand that the "executable" is three files...)

@ahnlak
Copy link
Contributor

ahnlak commented Feb 9, 2023

You can just add install(FILES ... instructions to CMake to get it to add in the extra bits though (I think I've done this in Another Project and it seemed to work)

@Daft-Freak
Copy link
Collaborator Author

You can do that... and I forgot that we already are:

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.js ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.wasm
DESTINATION bin
)

So uh, ignore that comment.

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.

3 participants