Skip to content

Commit f1e5f22

Browse files
author
Kalle Fagerberg
committed
Add way to print allocations
1 parent 35d098d commit f1e5f22

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

mise.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ description = "Build the game using firefly CLI"
3737
run = "ff build"
3838
depends = ['build:generate']
3939

40+
[tasks."build:print-allocs"]
41+
description = "Build with tinygo and print allocations"
42+
run = """
43+
tinygo build -print-allocs "$(basename "$PWD")" -buildmode c-shared -target target.json -o /dev/null \
44+
2>&1 | sed "s|^$PWD/|./|"
45+
"""
46+
4047
[tasks.start]
4148
description = "Run the game using firefly emulator"
4249
run = "firefly-emulator --id applejag.ewfg"

target.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"llvm-target": "wasm32-unknown-unknown",
3+
"cpu": "generic",
4+
"features": "+mutable-globals,+nontrapping-fptoint,+sign-ext,+bulk-memory",
5+
"build-tags": [
6+
"tinygo.wasm",
7+
"wasm_unknown",
8+
"firefly",
9+
"fireflyzero",
10+
"firefly_zero"
11+
],
12+
"goos": "linux",
13+
"goarch": "arm",
14+
"linker": "wasm-ld",
15+
"rtlib": "compiler-rt",
16+
"scheduler": "none",
17+
"gc": "conservative",
18+
"cflags": ["-mno-bulk-memory", "-mnontrapping-fptoint", "-msign-ext"],
19+
"ldflags": [
20+
"--allow-undefined",
21+
"--no-demangle",
22+
"--stack-first",
23+
"--no-entry",
24+
"-zstack-size=14752"
25+
],
26+
"extra-files": ["src/runtime/asm_tinygowasm.S"],
27+
"print-allocs": true
28+
}

0 commit comments

Comments
 (0)