-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate run-make/issue-14500
to new rmake.rs
format
#125047
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please take the opportunity to rename this test to something that's not as opaque as |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Test to make sure that reachable extern fns are always available in final | ||
// productcs, including when LTO is used. | ||
|
||
// In this test, the `foo` crate has a reahable symbol, | ||
// and is a dependency of the `bar` crate. When the `bar` crate | ||
// is compiled with LTO, it shouldn't strip the symbol from `foo`, and that's the | ||
// only way that `foo.c` will successfully compile. | ||
// See https://github.com/rust-lang/rust/issues/14500 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{cc, extra_c_flags, run, rustc, tmp_dir}; | ||
|
||
fn main() { | ||
let libbar_path = tmp_dir().join("libbar.a"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't recall exactly, do we have a static library name helper? If not, can you add one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already one! I should use it. |
||
rustc().input("foo.rs").crate_type("rlib").run(); | ||
rustc() | ||
.input("bar.rs") | ||
.crate_type("staticlib") | ||
.codegen_option("lto") | ||
.library_search_path(".") | ||
.output(&libbar_path) | ||
.run(); | ||
cc().input("foo.c").input(libbar_path).args(&extra_c_flags()).out_exe("foo").run(); | ||
run("foo"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think specific helpers for specific codegen options are better, i.e.
.lto()
over.codegen_options("lto")
or something.