File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Using `rustc` directly:
3030# Compile the Rust staticlib
3131rustc --crate-type=staticlib -Clinker-plugin-lto -Copt-level=2 ./lib.rs
3232# Compile the C code with `-flto=thin`
33- clang -c -O2 -flto=thin -o main .o ./main .c
33+ clang -c -O2 -flto=thin -o cmain .o ./cmain .c
3434# Link everything, making sure that we use an appropriate linker
3535clang -flto=thin -fuse-ld=lld -L . -l" name-of-your-rust-lib" -o main -O2 ./cmain.o
3636```
@@ -41,7 +41,7 @@ Using `cargo`:
4141# Compile the Rust staticlib
4242RUSTFLAGS=" -Clinker-plugin-lto" cargo build --release
4343# Compile the C code with `-flto=thin`
44- clang -c -O2 -flto=thin -o main .o ./main .c
44+ clang -c -O2 -flto=thin -o cmain .o ./cmain .c
4545# Link everything, making sure that we use an appropriate linker
4646clang -flto=thin -fuse-ld=lld -L . -l" name-of-your-rust-lib" -o main -O2 ./cmain.o
4747```
You can’t perform that action at this time.
0 commit comments