Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ff697c6
On macOS, make strip="symbols" not pass any options to strip
joshtriplett Aug 18, 2021
142f6c0
Implement #[link_ordinal] attribute in the context of #[link(kind = "…
ricobbe Sep 11, 2021
fa23d4f
Implement #85440
smoelius Sep 18, 2021
a6738c7
Add tests
smoelius Sep 19, 2021
4be574e
Add 'core::array::from_fn' and 'core::array::try_from_fn'
c410-f3r Sep 30, 2021
fdccc7d
Use reference instead of raw pointer
c410-f3r Sep 30, 2021
325025e
Improve previous commit
steffahn Sep 30, 2021
13bfcb7
Merge pull request #2 from steffahn/collect_into_array_fix_ub
c410-f3r Sep 30, 2021
355c7e9
Remove an unnecessary use of unwrap_unchecked
steffahn Sep 30, 2021
32b6ac5
Check `allow_unstable` before checking environment variables
smoelius Sep 30, 2021
91ad91e
Skip platforms without unwinding support
c410-f3r Oct 3, 2021
e16e15f
Add documentation
smoelius Oct 4, 2021
ecf4741
Add tracking issue
smoelius Oct 6, 2021
c3dfda0
Rebase Result::map_or_else doc wording on top of #89400.
orlp Sep 9, 2021
ce21756
Access Session while decoding expn_id.
cjgillot Oct 2, 2021
daf8903
Do not re-hash foreign spans.
cjgillot Oct 2, 2021
4028b09
Do not ICE if some foreign expansions were not encoded.
cjgillot Oct 2, 2021
a17193d
Enable AutoFDO.
May 7, 2021
afe5335
Use correct edition for panic in [debug_]assert!() etc.
m-ou-se Oct 7, 2021
fcd9fa9
Add tests for panic and [debug_]assert in Rust 2021.
m-ou-se Oct 7, 2021
6162fc0
Add wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor
hkratz Sep 25, 2021
01073dc
Rollup merge of #75644 - c410-f3r:array, r=yaahc
Manishearth Oct 8, 2021
6e14116
Rollup merge of #87918 - mikebenfield:pr-afdo, r=nikic
Manishearth Oct 8, 2021
ed501a9
Rollup merge of #88137 - joshtriplett:osx-strip-symbols-no-option, r=…
Manishearth Oct 8, 2021
837a032
Rollup merge of #88772 - orlp:result-map-or-else-docfix, r=yaahc
Manishearth Oct 8, 2021
c478bc0
Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoe…
Manishearth Oct 8, 2021
8f254a7
Rollup merge of #89082 - smoelius:master, r=kennytm
Manishearth Oct 8, 2021
30fa4ad
Rollup merge of #89288 - rusticstuff:lld_wrapper, r=Mark-Simulacrum
Manishearth Oct 8, 2021
8437cef
Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkov
Manishearth Oct 8, 2021
414ca04
Rollup merge of #89622 - m-ou-se:debug-assert-2021, r=estebank
Manishearth Oct 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,14 +1024,20 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
}

if sess.target.is_like_osx {
if let Some(option) = osx_strip_opt(sess.opts.debugging_opts.strip) {
strip_symbols_in_osx(sess, &out_filename, option);
match sess.opts.debugging_opts.strip {
Strip::Debuginfo => strip_symbols_in_osx(sess, &out_filename, Some("-S")),
Strip::Symbols => strip_symbols_in_osx(sess, &out_filename, None),
Strip::None => {}
}
}
}

fn strip_symbols_in_osx<'a>(sess: &'a Session, out_filename: &Path, option: &str) {
let prog = Command::new("strip").arg(option).arg(out_filename).output();
fn strip_symbols_in_osx<'a>(sess: &'a Session, out_filename: &Path, option: Option<&str>) {
let mut cmd = Command::new("strip");
if let Some(option) = option {
cmd.arg(option);
}
let prog = cmd.arg(out_filename).output();
match prog {
Ok(prog) => {
if !prog.status.success() {
Expand All @@ -1049,14 +1055,6 @@ fn strip_symbols_in_osx<'a>(sess: &'a Session, out_filename: &Path, option: &str
}
}

fn osx_strip_opt<'a>(strip: Strip) -> Option<&'a str> {
match strip {
Strip::Debuginfo => Some("-S"),
Strip::Symbols => Some("-x"),
Strip::None => None,
}
}

fn escape_string(s: &[u8]) -> String {
str::from_utf8(s).map(|s| s.to_owned()).unwrap_or_else(|_| {
let mut x = "Non-UTF-8 output: ".to_string();
Expand Down