Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tweak build rules for WebAssembly #377

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

ChinYikMing
Copy link
Collaborator

The "emcc --version" command displays information about the version of emcc, which contains the "gcc" or "clang" string. As a result, the build rule should only match one compiler and stop checking anymore. If not, the build could be failed by a mix of different compiler's CFLAGS. For example, -flto from clang and -flto=thin from emcc.

After refactoring the riscv.[ch] public APIs in commit 820cd9b, it is now possible to adjust the memory size to accommodate varying runtime requirements. The memory size must align to a 4KB page size for the WASM runtime and I set 1GB as default memory size for WASM runtime.

The LTO is not supported to build emscripten-port SDL library, so disable it when both ENABLE_LTO=1 and ENABLE_SDL=1 are set.

Related to: #75
Close #375

Makefile Outdated Show resolved Hide resolved
@jserv jserv changed the title Tweak build rule and enable run rv32emu using Node Tweak build rules for WebAssembly Mar 11, 2024
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@ChinYikMing ChinYikMing force-pushed the emcc branch 2 times, most recently from 54f1669 to 67176ce Compare March 11, 2024 07:03
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
The "emcc --version" command displays information about the version of
emcc, which contains the "gcc" or "clang" string. As a result, the build
rule should only match one compiler and stop checking anymore.  If not,
the build could be failed by a mix of different compiler's CFLAGS. For
example, -flto from clang and -flto=thin from emcc.

After refactoring the riscv.[ch] public APIs in commit 820cd9b, it is
now possible to adjust the memory size to accommodate varying runtime
requirements. The memory size must align to a 4KB page size for the
WASM runtime and I set 1GB as default memory size for WASM runtime.

The LTO is not supported to build emscripten-port SDL library,
so disable it when both ENABLE_LTO=1 and ENABLE_SDL=1 are set.

Related to: sysprog21#75
Close sysprog21#375
@jserv jserv merged commit 2671ffd into sysprog21:master Mar 11, 2024
8 checks passed
@jserv
Copy link
Contributor

jserv commented Mar 11, 2024

Thank @ChinYikMing for contributing!

@ChinYikMing ChinYikMing deleted the emcc branch March 11, 2024 11:00
vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
Tweak build rules for WebAssembly
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build using emcc failed
2 participants