Skip to content

Commit a035a53

Browse files
doc: add missing flags to lind_compile usage (closes #1022) (#1045)
Document -s/--static, --compile-library, and --fpcast-emu in the usage() help text, and expand --compile-grate's description to note its backend compatibility. Add a backend section explaining the three compilation modes (dynamic, static, library) and their mode compatibility.
1 parent c380d8c commit a035a53

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/lind_compile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,34 @@ usage: $(basename "$0") [OPTIONS] <source> [-- <clang args>]
3636
--opt-only : .wasm -> .wasm (in-place optimization)
3737
--precompile-only : .wasm -> .cwasm (AOT compile via lind-boot)
3838
39+
Compilation backend (applies to full and --compile-only modes):
40+
(no backend flag) : dynamic build — PIE executable with dlopen support (default)
41+
-s, --static : static build — traditional WASM binary without dynamic linking
42+
--compile-library : library build — shared WASM library (.wasm) to be loaded via dlopen
43+
Note: --compile-library takes precedence over -s/--static if both are given.
44+
3945
Common options:
4046
-v, --print-cmd, --verbose print the underlying commands that are executed
4147
--print-args, --debug-args print parsed arguments after option handling
42-
--compile-grate add grate-specific clang flags automatically
48+
--compile-grate add grate-specific clang flags (exports pass_fptr_to_wt);
49+
compatible with dynamic and static backends
50+
--fpcast-emu enable function-pointer-cast emulation via wasm-opt
51+
(applies to full and --opt-only modes; for dynamic/library
52+
builds also passes --pass-arg=relocatable-fpcast)
4353
--no-default-clang-flags do not add lind_compile's optional clang flags
44-
-h, --help show this help
54+
-h, --help show this help
4555
4656
Additional clang args:
4757
Any extra arguments after the source file are passed through to clang.
4858
Use -- to separate lind_compile flags from clang flags if needed.
4959
5060
Examples:
51-
$(basename "$0") hello.c
61+
$(basename "$0") hello.c # dynamic build (default)
62+
$(basename "$0") -s hello.c # static build
63+
$(basename "$0") --compile-library mylib.c # shared library for dlopen
5264
$(basename "$0") --compile-only hello.c
5365
$(basename "$0") --compile-grate hello.c
66+
$(basename "$0") --fpcast-emu hello.c
5467
$(basename "$0") --opt-only build/hello.wasm
5568
$(basename "$0") --precompile-only build/hello.wasm
5669
$(basename "$0") --print-cmd hello.c

0 commit comments

Comments
 (0)