Well, i was trying to compile this code to WASM:
export fn add(a: i32, b: i32) i32 {
return a + b;
}
Let's name the file math.zig.
When i use the command: zig build-lib math.zig -target wasm32-freestanding -dynamic
The ouput code ( in wat format ) looks like this:
(module
(memory $0 16)
(global $__stack_pointer (mut i32) (i32.const 1048576))
(export "memory" (memory $0))
;; custom section ".debug_info", size 1410
;; custom section ".debug_pubtypes", size 469
;; custom section ".debug_loc", size 29
;; custom section ".debug_ranges", size 24
;; custom section ".debug_abbrev", size 292
;; custom section ".debug_line", size 241
;; custom section ".debug_str", size 1434
;; custom section ".debug_pubnames", size 381
;; custom section "producers", size 16
)