a-game

2D platformer written from scratch.
git clone git://git.amin.space/a-game.git
Log | Files | Refs | README | LICENSE

commit 6144fc128f846a2e59e7cbe1b6846ce5d546a73f
parent c6a3372510766e75429e8597486209d6f8fd0a71
Author: amin <dev@aminmesbah.com>
Date:   Sun,  3 Nov 2019 02:06:05 +0000

Fix broken wasm build

Note that it doesn't appear to be sufficient to use -Xclang as suggested
in [1] to pass args to the compiler. The problem is that the driver has
by then already added its own problematic arguments such as
--target=x86_64, and we don't appear to be able to remove those.

[1]: https://clang.llvm.org/docs/FAQ.html#i-run-clang-cc1-and-get-weird-errors-about-missing-headers

FossilOrigin-Name: b564a687c3495db92c2485e26960a58c7815e6344f433876dc8a91b254c95225
Diffstat:
Mbuild_wasm.sh | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/build_wasm.sh b/build_wasm.sh @@ -22,6 +22,8 @@ clang \ -ffreestanding \ -fno-builtin \ -std=c11 \ + -internal-isystem /usr/lib/clang/9.0.0/include \ + -internal-externc-isystem /usr/include \ -DGAME_WEBGL \ -o $wasm_dir/wasm.bc \ src/platform_wasm.c @@ -30,6 +32,8 @@ llvm-link -o $wasm_dir/wasm.bc $wasm_dir/wasm.bc opt -O3 -disable-simplify-libcalls $wasm_dir/wasm.bc -o $wasm_dir/wasm.bc llc -O3 -disable-simplify-libcalls -filetype=obj $wasm_dir/wasm.bc -o $wasm_dir/wasm.o +# TODO: remove __heap_base export when LLVM bug fix is released: +# https://reviews.llvm.org/D65920 wasm-ld \ --no-entry $wasm_dir/wasm.o \ -o $wasm_dir/binary.wasm \ @@ -38,6 +42,7 @@ wasm-ld \ --export=render \ --export=window_resize \ --export=key_callback \ + --export=__heap_base \ --import-memory rm $wasm_dir/*.o