[cfe-dev] a clang-8 compile argument question

张济昭 via cfe-dev cfe-dev at lists.llvm.org
Mon May 20 00:21:46 PDT 2019


Hi,


I'm trying to use clang toolchain to compile a c program to a wasm file.
I could type the following command step by step to get a correct wasm file:

1.clang-8 main.c -S -emit-llvm --target=wasm32 -o main.ll

2.llvm-link-8 -o main.bc main.ll

3.opt-8 -O3 main.bc -o main.bc

4.llc-8 -mtriple=wasm32-unknown-unknown -O3 -filetype=obj main.bc -o main.o
5.wasm-ld-8 main.o -o test.wasm--no-entry --export-dynamic -allow-undefined --strip-all --lto-O3 --initial-memory=131072  --export=main
My question is:
I don't want to compile any libc functions with my wasm app together, and I want to squeeze above command into
one clang-8 command line. Are there any parameter for me to avoid using a "--sysroot" parameter? If so, can someone
give me a sample command line?


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190520/007490c2/attachment.html>


More information about the cfe-dev mailing list