File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+ set -x
5+
6+ # CC=/Volumes/PortableSSD/llvm/build/bin/clang
7+ # CC=/Volumes/PortableSSD/git/wasi-sdk/build/toolchain/install/bin/clang
8+ CC=${CC:-/ opt/ wasi-sdk-24.0/ bin/ clang}
9+
10+ ${CC} -Os -ffreestanding -nostdlib -fPIC -shared -fvisibility=default -Xlinker --no-entry -o lib.so lib.c
11+
12+ ${CC} -Os -ffreestanding -nostdlib -fPIC \
13+ -Xlinker -Bdynamic \
14+ -Xlinker --unresolved-symbols=import-dynamic \
15+ -Xlinker --export-table \
16+ -Xlinker --growable-table \
17+ -Xlinker --export-memory \
18+ -Xlinker --export=__stack_pointer \
19+ -Xlinker --export=__heap_base \
20+ -Xlinker --export=__heap_end \
21+ -Xlinker --entry=_start -o main main.c lib.so
Original file line number Diff line number Diff line change 1+ void
2+ f (void )
3+ {
4+ }
Original file line number Diff line number Diff line change 1+ void f (void );
2+ void (* f_p )(void ) = f ;
3+
4+ void
5+ _start (void )
6+ {
7+ f_p ();
8+ }
You can’t perform that action at this time.
0 commit comments