Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45b50d3

Browse files
committed
lto function, static_library call, rename
1 parent71fd2cf commit45b50d3

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

‎src/tools/run-make-support/src/rustc.rs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,9 @@ impl Rustc {
150150
self
151151
}
152152

153-
/// Pass a codegen option.
154-
pubfncodegen_option(&mutself,option:&str) ->&mutSelf{
155-
self.cmd.arg("-C");
156-
self.cmd.arg(option);
153+
/// Enables link time optimizations in rustc. Equivalent to `-Clto``.
154+
pubfnlto(&mutself) ->&mutSelf{
155+
self.cmd.arg("-Clto");
157156
self
158157
}
159158

‎tests/run-make/issue-14500/rmake.rs‎renamed to ‎tests/run-make/reachable-extern-fn-available-lto/rmake.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Test to make sure that reachable extern fns are always available in final
2-
// productcs, including when LTO is used.
2+
// productcs, including whenlink time optimizations (LTO) are used.
33

44
// In this test, the `foo` crate has a reahable symbol,
55
// and is a dependency of the `bar` crate. When the `bar` crate
@@ -9,15 +9,15 @@
99

1010
//@ ignore-cross-compile
1111

12-
use run_make_support::{cc, extra_c_flags, run, rustc, tmp_dir};
12+
use run_make_support::{cc, extra_c_flags, run, rustc,static_lib,tmp_dir};
1313

1414
fnmain(){
15-
let libbar_path =tmp_dir().join("libbar.a");
15+
let libbar_path =static_lib("bar");
1616
rustc().input("foo.rs").crate_type("rlib").run();
1717
rustc()
1818
.input("bar.rs")
1919
.crate_type("staticlib")
20-
.codegen_option("lto")
20+
.lto()
2121
.library_search_path(".")
2222
.output(&libbar_path)
2323
.run();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp