]> git.lizzy.rs Git - rust.git/commitdiff
linker-plugin-lto.md: Correct the name of example c file
authorTommy Chiang <oToToT@users.noreply.github.com>
Tue, 2 Aug 2022 19:00:06 +0000 (03:00 +0800)
committerGitHub <noreply@github.com>
Tue, 2 Aug 2022 19:00:06 +0000 (03:00 +0800)
src/doc/rustc/src/linker-plugin-lto.md

index 9c644dd404dc428d57b7a62a68d740041c9a0111..b1854b22a7cd694b92476d87ff9854dd547d7b96 100644 (file)
@@ -30,7 +30,7 @@ Using `rustc` directly:
 # Compile the Rust staticlib
 rustc --crate-type=staticlib -Clinker-plugin-lto -Copt-level=2 ./lib.rs
 # Compile the C code with `-flto=thin`
-clang -c -O2 -flto=thin -o main.o ./main.c
+clang -c -O2 -flto=thin -o cmain.o ./cmain.c
 # Link everything, making sure that we use an appropriate linker
 clang -flto=thin -fuse-ld=lld -L . -l"name-of-your-rust-lib" -o main -O2 ./cmain.o
 ```
@@ -41,7 +41,7 @@ Using `cargo`:
 # Compile the Rust staticlib
 RUSTFLAGS="-Clinker-plugin-lto" cargo build --release
 # Compile the C code with `-flto=thin`
-clang -c -O2 -flto=thin -o main.o ./main.c
+clang -c -O2 -flto=thin -o cmain.o ./cmain.c
 # Link everything, making sure that we use an appropriate linker
 clang -flto=thin -fuse-ld=lld -L . -l"name-of-your-rust-lib" -o main -O2 ./cmain.o
 ```