Uh oh!
There was an error while loading. Please reload this page.
Use platform dependent mcount function - #59506
Conversation
| // The function name varies on platforms. | ||
| // See test/CodeGen/mcount.c in clang. | ||
| let mcount_name = if cfg!(target_os = "netbsd") { |
There was a problem hiding this comment.
cfg is wrong here, because it will be checking for the host (the computer running the compiler) rather than for the target (whatever is intended to run the final executable).
You should be checking for stuff in sess().target or, even better, make this name a part of target definitions and use that value directly.
There was a problem hiding this comment.
make this name a part of target definitions and use that value directly.
The targets are defined in src/librustc_target/spec/(e.g. like this)? If so, I should add target_mcount or something in Ok(Target {..}), right?
https://github.com/rust-lang/rust/blob/master/src/librustc_target/spec/aarch64_unknown_netbsd.rs
There was a problem hiding this comment.
If so, I should add target_mcount or something in Ok(Target {..}), right?
Yeah.
| use std::ffi::CStr; | ||
| let target_mcount = format!("{}{}", | ||
| &cx.sess().target.target.options.target_mcount, "\0"); | ||
| let mcount_name = CStr::from_bytes_with_nul(target_mcount.as_bytes()).unwrap(); |
There was a problem hiding this comment.
@nagisa I couldn't deal with concat!, so didn't use const_cstr!. Could you give me advice?
There was a problem hiding this comment.
I think you just need to use a CString here.
Uh oh!
There was an error while loading. Please reload this page.
nagisa
commented
Mar 30, 2019
r=me on the imeplementation. I think the test is likely to fail if sent to bors now, but I’m fine with sending it if proven otherwise. |
nagisa
commented
Mar 30, 2019
@bors r+ |
bors
commented
Mar 30, 2019
📌 Commit aec518a has been approved by |
Use platform dependent mcount function closerust-lang#59097 This pull-request is based on rust-lang#57244 and [here](https://github.com/llvm-mirror/clang/search?q=MCountName&unscoped_MCountName). r? @nagisa
bors
commented
Mar 31, 2019
Use platform dependent mcount function close#59097 This pull-request is based on #57244 and [here](https://github.com/llvm-mirror/clang/search?q=MCountName&unscoped_MCountName). r? @nagisa
bors
commented
Mar 31, 2019
💔 Test failed - checks-travis |
rust-highfive
commented
Mar 31, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Uh oh!
There was an error while loading. Please reload this page.
nagisa
commented
Mar 31, 2019
via email
@bors r+ …On Sun, Mar 31, 2019, 17:18 Yuki OKUSHI ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/librustc_target/spec/x86_64_apple_darwin.rs
<#59506 (comment)>:
> @@ -19,6 +19,9 @@ pub fn target() -> TargetResult {
target_env: String::new(),
target_vendor: "apple".to_string(),
linker_flavor: LinkerFlavor::Gcc,
- options: base,
+ options: TargetOptions {
+ target_mcount: "\01mcount".to_string(),
Okay, I fixed them.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#59506 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AApc0jIPR5Ruc5XqNnyBoVRgnvb_-7K4ks5vcMPMgaJpZM4cRNbz>
.
|
bors
commented
Mar 31, 2019
📌 Commit 7b26a43 has been approved by |
Use platform dependent mcount function closerust-lang#59097 This pull-request is based on rust-lang#57244 and [here](https://github.com/llvm-mirror/clang/search?q=MCountName&unscoped_MCountName). r? @nagisa
Rollup of 7 pull requests Successful merges: - #58805 (Lint for redundant imports) - #59506 (Use platform dependent mcount function) - #59519 (rustc_target: factor out common fields of non-Single Variants.) - #59580 (Allow closure to unsafe fn coercion) - #59581 (Stabilize refcell_replace_swap feature) - #59583 (match match match match match) - #59587 (Remove #[doc(hidden)] from Error::type_id) Failed merges: r? @ghost
close#59097
This pull-request is based on #57244 and here.
r? @nagisa