Busybox (for example) wants to be able to merge together multiple object files into another object file with $CC -r. But wasixcc doesn't support it:
tavianator@lima-default$ cat foo.c
void foo(void) {}
tavianator@lima-default$ cat bar.c
void bar(void) {}
tavianator@lima-default$ wasixcc -c foo.c
tavianator@lima-default$ wasixcc -c bar.c
tavianator@lima-default$ wasixcc -r foo.o bar.o -o baz.o
wasm-ld: error: /home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib/wasm32-wasi/libc.a(__main_void.o): undefined symbol: main
Error: Command failed with status: exit status: 1; the command was: "/home/tavianator.linux/.wasixcc/llvm/bin/wasm-ld" "--extra-features=atomics" "--extra-features=bulk-memory" "--extra-features=mutable-globals" "--shared-memory" "--max-memory=4294967296" "--import-memory" "--export-dynamic" "--export=__wasm_call_ctors" "-mllvm" "--wasm-enable-eh" "-mllvm" "--wasm-enable-sjlj" "-mllvm" "--wasm-use-legacy-eh=false" "-mllvm" "--exception-model=wasm" "--export=__wasm_init_tls" "--export=__wasm_signal" "--export=__tls_size" "--export=__tls_align" "--export=__tls_base" "--export-if-defined=__indirect_function_table" "--export-if-defined=__stack_pointer" "--export-if-defined=__heap_base" "--export-if-defined=__data_end" "-L/home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib" "-L/home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib/wasm32-wasi" "-lwasi-emulated-getpid" "-lwasi-emulated-mman" "-lwasi-emulated-process-clocks" "-lc" "-lresolv" "-lrt" "-lm" "-lpthread" "-lutil" "-lclang_rt.builtins-wasm32" "-z" "stack-size=8388608" "foo.o" "bar.o" "/home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib/wasm32-wasi/crt1.o" "-o" "baz.o"
tavianator@lima-default$ wasixcc -Wl,-r foo.o bar.o -o baz.o
wasm-ld: error: -r and --shared-memory may not be used together
Error: Command failed with status: exit status: 1; the command was: "/home/tavianator.linux/.wasixcc/llvm/bin/wasm-ld" "-r" "--extra-features=atomics" "--extra-features=bulk-memory" "--extra-features=mutable-globals" "--shared-memory" "--max-memory=4294967296" "--import-memory" "--export-dynamic" "--export=__wasm_call_ctors" "-mllvm" "--wasm-enable-eh" "-mllvm" "--wasm-enable-sjlj" "-mllvm" "--wasm-use-legacy-eh=false" "-mllvm" "--exception-model=wasm" "--export=__wasm_init_tls" "--export=__wasm_signal" "--export=__tls_size" "--export=__tls_align" "--export=__tls_base" "--export-if-defined=__indirect_function_table" "--export-if-defined=__stack_pointer" "--export-if-defined=__heap_base" "--export-if-defined=__data_end" "-L/home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib" "-L/home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib/wasm32-wasi" "-lwasi-emulated-getpid" "-lwasi-emulated-mman" "-lwasi-emulated-process-clocks" "-lc" "-lresolv" "-lrt" "-lm" "-lpthread" "-lutil" "-lclang_rt.builtins-wasm32" "-z" "stack-size=8388608" "foo.o" "bar.o" "/home/tavianator.linux/.wasixcc/sysroot/sysroot-exnref-eh/lib/wasm32-wasi/crt1.o" "-o" "baz.o"
Busybox (for example) wants to be able to merge together multiple object files into another object file with
$CC -r. But wasixcc doesn't support it: