Skip to content

Commit

Permalink
chore: adapt rust build to SU15 (#8627)
Browse files Browse the repository at this point in the history
* chore: update rust and adapt to SU15

* revert rust update as it is contained in another PR

* update linker flags

* remove --stack-guard-page

Does not work with standard llvm, seems to be a custom option by asobo that only works with the wasm-ld.exe from the msfs-sdk

* enable bulk memory for rust

* add missing flags in fbw builds

---------

Co-authored-by: 2hwk <15316958+2hwk@users.noreply.github.com>
  • Loading branch information
Saschl and 2hwk committed Jun 4, 2024
1 parent c8778be commit 2882c22
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ git-fetch-with-cli = true

[target.wasm32-wasi]
rustflags = [
"-Ctarget-feature=-crt-static,+bulk-memory",
"-Clink-self-contained=no",
"-Clink-arg=-l","-Clink-arg=c", "-Clink-arg=/workdir/MSFS_SDK/WASM/wasi-sysroot/lib/wasm32-wasi/libclang_rt.builtins-wasm32.a",
"-Clink-arg=-L", "-Clink-arg=/workdir/MSFS_SDK/WASM/wasi-sysroot/lib/wasm32-wasi",
"-Clink-arg=--export-table",
"-Clink-arg=--allow-undefined",
"-Clink-arg=--export-dynamic",
"-Clink-arg=--export=__wasm_call_ctors",
"-Clink-arg=--export=malloc",
"-Clink-arg=--export=free",
"-Clink-arg=--export=mark_decommit_pages",
"-Clink-arg=--export=mallinfo",
"-Clink-arg=--export=mchunkit_begin",
"-Clink-arg=--export=mchunkit_next",
"-Clink-arg=--export=get_pages_state"
]
5 changes: 5 additions & 0 deletions fbw-a32nx/src/wasm/fbw_a320/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ clang \
-fno-exceptions \
-fms-extensions \
-fvisibility=hidden \
-fdata-sections \
-fno-stack-protector \
-fstack-size-section \
-mbulk-memory \
-Werror=return-type \
-I "${MSFS_SDK}/WASM/include" \
-I "${COMMON_DIR}/src/zlib" \
"${COMMON_DIR}/src/zlib/adler32.c" \
Expand Down
5 changes: 5 additions & 0 deletions fbw-a380x/src/wasm/fbw_a380/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ clang++ \
-fno-exceptions \
-fms-extensions \
-fvisibility=hidden \
-fdata-sections \
-fno-stack-protector \
-fstack-size-section \
-mbulk-memory \
-Werror=return-type \
-I "${MSFS_SDK}/WASM/include" \
-I "${MSFS_SDK}/SimConnect SDK/include" \
-I "${COMMON_DIR}/fbw_common/src" \
Expand Down

0 comments on commit 2882c22

Please sign in to comment.