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

Commitf2de5fb

Browse files
committed
rewrite issue-14500 to rmake
1 parent3349155 commitf2de5fb

File tree

4 files changed

+45
-16
lines changed

4 files changed

+45
-16
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ 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);
157+
self
158+
}
159+
160+
/// Add a directory to the library search path.
161+
pubfnlibrary_search_path<P:AsRef<Path>>(&mutself,path:P) ->&mutSelf{
162+
self.cmd.arg("-L");
163+
self.cmd.arg(path.as_ref());
164+
self
165+
}
166+
153167
/// Specify the edition year.
154168
pubfnedition(&mutself,edition:&str) ->&mutSelf{
155169
self.cmd.arg("--edition");

‎src/tools/tidy/src/allowed_run_make_makefiles.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ run-make/issue-107094/Makefile
9999
run-make/issue-10971-temps-dir/Makefile
100100
run-make/issue-109934-lto-debuginfo/Makefile
101101
run-make/issue-11908/Makefile
102-
run-make/issue-14500/Makefile
103102
run-make/issue-14698/Makefile
104103
run-make/issue-15460/Makefile
105104
run-make/issue-18943/Makefile

‎tests/run-make/issue-14500/Makefile‎

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Test to make sure that reachable extern fns are always available in final
2+
// productcs, including when LTO is used.
3+
4+
// In this test, the `foo` crate has a reahable symbol,
5+
// and is a dependency of the `bar` crate. When the `bar` crate
6+
// is compiled with LTO, it shouldn't strip the symbol from `foo`, and that's the
7+
// only way that `foo.c` will successfully compile.
8+
// See https://github.com/rust-lang/rust/issues/14500
9+
10+
//@ ignore-cross-compile
11+
12+
use run_make_support::{cc, extra_c_flags, run, rustc};
13+
14+
fnmain(){
15+
let libbar_path =tmp_dir().join("libbar.a");
16+
rustc().input("foo.rs")
17+
.crate_type("rlib")
18+
.run();
19+
rustc().input("bar.rs")
20+
.static_lib("staticlib")
21+
.codegen_option("lto")
22+
.library_search_path(".")
23+
.output(&libbar_path)
24+
.run();
25+
cc().input("foo.c")
26+
.input(libbar_path)
27+
.args(&extra_c_flags())
28+
.out_exe("foo")
29+
.run();
30+
run("foo");
31+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp