Rollup merge of #59506 - JohnTitor:improve-mcount, r=nagisa
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
This commit is contained in:
commit
245a0afb52
@ -77,9 +77,15 @@ pub fn set_instrument_function(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
|
||||
if cx.sess().instrument_mcount() {
|
||||
// Similar to `clang -pg` behavior. Handled by the
|
||||
// `post-inline-ee-instrument` LLVM pass.
|
||||
|
||||
// The function name varies on platforms.
|
||||
// See test/CodeGen/mcount.c in clang.
|
||||
let mcount_name = CString::new(
|
||||
cx.sess().target.target.options.target_mcount.as_str().as_bytes()).unwrap();
|
||||
|
||||
llvm::AddFunctionAttrStringValue(
|
||||
llfn, llvm::AttributePlace::Function,
|
||||
const_cstr!("instrument-function-entry-inlined"), const_cstr!("mcount"));
|
||||
const_cstr!("instrument-function-entry-inlined"), &mcount_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ pub fn target() -> TargetResult {
|
||||
options: TargetOptions {
|
||||
features: "+strict-align,+v6".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
|
@ -18,6 +18,7 @@ pub fn target() -> TargetResult {
|
||||
options: TargetOptions {
|
||||
features: "+strict-align,+v6,+vfp2".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
|
@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
|
@ -19,6 +19,7 @@ pub fn target() -> TargetResult {
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -19,6 +19,7 @@ pub fn target() -> TargetResult {
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -22,6 +22,7 @@ pub fn target() -> TargetResult {
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -18,6 +18,7 @@ pub fn target() -> TargetResult {
|
||||
features: "+v6,+vfp2".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -18,6 +18,7 @@ pub fn target() -> TargetResult {
|
||||
options: TargetOptions {
|
||||
features: "+v6,+vfp2".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::cloudabi_base::opts();
|
||||
@ -19,6 +19,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ pub fn target() -> TargetResult {
|
||||
features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -26,6 +26,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -19,6 +19,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
}
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::apple_base::opts();
|
||||
@ -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: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
@ -18,6 +18,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips64r2".to_string(),
|
||||
features: "+mips64r2".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips64r2".to_string(),
|
||||
features: "+mips64r2".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -16,6 +16,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips32r2".to_string(),
|
||||
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "musl".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips32r2".to_string(),
|
||||
features: "+mips32r2,+soft-float".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips32r2".to_string(),
|
||||
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "musl".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips32r2".to_string(),
|
||||
features: "+mips32r2,+soft-float".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -16,6 +16,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips32r6".to_string(),
|
||||
features: "+mips32r6".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips32r6".to_string(),
|
||||
features: "+mips32r6".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips64r6".to_string(),
|
||||
features: "+mips64r6".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ pub fn target() -> TargetResult {
|
||||
cpu: "mips64r6".to_string(),
|
||||
features: "+mips64r6".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
target_mcount: "_mcount".to_string(),
|
||||
|
||||
..super::linux_base::opts()
|
||||
},
|
||||
|
@ -761,7 +761,10 @@ pub struct TargetOptions {
|
||||
/// to opt out. The default is "aliases".
|
||||
///
|
||||
/// Workaround for: https://github.com/rust-lang/rust/issues/57356
|
||||
pub merge_functions: MergeFunctions
|
||||
pub merge_functions: MergeFunctions,
|
||||
|
||||
/// Use platform dependent mcount function
|
||||
pub target_mcount: String
|
||||
}
|
||||
|
||||
impl Default for TargetOptions {
|
||||
@ -845,6 +848,7 @@ impl Default for TargetOptions {
|
||||
simd_types_indirect: true,
|
||||
override_export_symbols: None,
|
||||
merge_functions: MergeFunctions::Aliases,
|
||||
target_mcount: "mcount".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1150,6 +1154,7 @@ impl Target {
|
||||
key!(simd_types_indirect, bool);
|
||||
key!(override_export_symbols, opt_list);
|
||||
key!(merge_functions, MergeFunctions)?;
|
||||
key!(target_mcount);
|
||||
|
||||
if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
|
||||
for name in array.iter().filter_map(|abi| abi.as_string()) {
|
||||
@ -1364,6 +1369,7 @@ impl ToJson for Target {
|
||||
target_option_val!(simd_types_indirect);
|
||||
target_option_val!(override_export_symbols);
|
||||
target_option_val!(merge_functions);
|
||||
target_option_val!(target_mcount);
|
||||
|
||||
if default.abi_blacklist != self.options.abi_blacklist {
|
||||
d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter()
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::freebsd_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult, RelroLevel};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult, RelroLevel};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_base::opts();
|
||||
@ -21,6 +21,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "gnu".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "musl".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "gnu".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "musl".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_base::opts();
|
||||
@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "gnu".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_base::opts();
|
||||
@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "gnu".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: "musl".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "_mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
@ -17,6 +17,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::apple_base::opts();
|
||||
@ -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: "\u{1}mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
@ -24,6 +24,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "rumprun".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::spec::{LinkerFlavor, Target, TargetResult};
|
||||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
@ -18,6 +18,9 @@ pub fn target() -> TargetResult {
|
||||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: base,
|
||||
options: TargetOptions {
|
||||
target_mcount: "__mcount".to_string(),
|
||||
.. base
|
||||
},
|
||||
})
|
||||
}
|
||||
|
7
src/test/codegen/instrument-mcount.rs
Normal file
7
src/test/codegen/instrument-mcount.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// ignore-tidy-linelength
|
||||
// compile-flags: -Z instrument-mcount
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: attributes #{{.*}} "instrument-function-entry-inlined"="{{.*}}mcount{{.*}}" "no-frame-pointer-elim"="true"
|
||||
pub fn foo() {}
|
Loading…
x
Reference in New Issue
Block a user