diff options
| author | Tommy Chiang <oToToT@users.noreply.github.com> | 2022-08-03 03:00:06 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-03 03:00:06 +0800 |
| commit | e1eab5379e8b0122e3426674a44813e5644a4ada (patch) | |
| tree | a9f97b037b2949bc1e5dfeda4e12db00a8bf902c | |
| parent | 06f4950cbdb5a0a59063156af6383283b1aae30e (diff) | |
| download | rust-e1eab5379e8b0122e3426674a44813e5644a4ada.tar.gz rust-e1eab5379e8b0122e3426674a44813e5644a4ada.zip | |
linker-plugin-lto.md: Correct the name of example c file
| -rw-r--r-- | src/doc/rustc/src/linker-plugin-lto.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/rustc/src/linker-plugin-lto.md b/src/doc/rustc/src/linker-plugin-lto.md index 9c644dd404d..b1854b22a7c 100644 --- a/src/doc/rustc/src/linker-plugin-lto.md +++ b/src/doc/rustc/src/linker-plugin-lto.md @@ -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 ``` |
