File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Using `rustc` directly:
30
30
# Compile the Rust staticlib
31
31
rustc --crate-type=staticlib -Clinker-plugin-lto -Copt-level=2 ./lib.rs
32
32
# 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
34
34
# Link everything, making sure that we use an appropriate linker
35
35
clang -flto=thin -fuse-ld=lld -L . -l" name-of-your-rust-lib" -o main -O2 ./cmain.o
36
36
```
@@ -41,7 +41,7 @@ Using `cargo`:
41
41
# Compile the Rust staticlib
42
42
RUSTFLAGS=" -Clinker-plugin-lto" cargo build --release
43
43
# 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
45
45
# Link everything, making sure that we use an appropriate linker
46
46
clang -flto=thin -fuse-ld=lld -L . -l" name-of-your-rust-lib" -o main -O2 ./cmain.o
47
47
```
You can’t perform that action at this time.
0 commit comments