Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0206312

Browse files
committedNov 16, 2021
Auto merge of #90934 - JohnTitor:rollup-5soqo0j, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #85766 (Stabilize File::options()) - #88601 (Implement `Termination` for `Result<Infallible, E>`) - #90058 (Stabilize -Z strip as -C strip) - #90790 (Fix standard library test with read_link) - #90834 (Android is not GNU) - #90835 (Rename WASI's `is_character_device` to `is_char_device`.) - #90837 (Move some tests to more reasonable directories - 9) - #90848 (Remove bigint_helper_methods for *signed* types) - #90892 (fix ICE on Miri/CTFE copy of half a pointer) - #90909 (disable portable SIMD tests in Miri) Failed merges: - #90128 (Stabilize -Z symbol-mangling-version=v0 as -C symbol-mangling-version=v0) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b053550 + 35dd1f6 commit 0206312

File tree

205 files changed

+121
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+121
-355
lines changed
 

‎compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,15 +1034,25 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
10341034
SplitDebuginfo::Packed => link_dwarf_object(sess, &out_filename),
10351035
}
10361036

1037+
let strip = strip_value(sess);
1038+
10371039
if sess.target.is_like_osx {
1038-
match sess.opts.debugging_opts.strip {
1040+
match strip {
10391041
Strip::Debuginfo => strip_symbols_in_osx(sess, &out_filename, Some("-S")),
10401042
Strip::Symbols => strip_symbols_in_osx(sess, &out_filename, None),
10411043
Strip::None => {}
10421044
}
10431045
}
10441046
}
10451047

1048+
// Temporarily support both -Z strip and -C strip
1049+
fn strip_value(sess: &Session) -> Strip {
1050+
match (sess.opts.debugging_opts.strip, sess.opts.cg.strip) {
1051+
(s, Strip::None) => s,
1052+
(_, s) => s,
1053+
}
1054+
}
1055+
10461056
fn strip_symbols_in_osx<'a>(sess: &'a Session, out_filename: &Path, option: Option<&str>) {
10471057
let mut cmd = Command::new("strip");
10481058
if let Some(option) = option {
@@ -2014,7 +2024,7 @@ fn add_order_independent_options(
20142024
cmd.optimize();
20152025

20162026
// Pass debuginfo and strip flags down to the linker.
2017-
cmd.debuginfo(sess.opts.debugging_opts.strip);
2027+
cmd.debuginfo(strip_value(sess));
20182028

20192029
// We want to prevent the compiler from accidentally leaking in any system libraries,
20202030
// so by default we tell linkers not to link to any default libraries.

‎compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,20 +1057,19 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
10571057
Some(dest_ptr) => dest_ptr,
10581058
};
10591059

1060+
// This checks relocation edges on the src, which needs to happen before
1061+
// `prepare_relocation_copy`.
1062+
let src_bytes = src_alloc
1063+
.get_bytes_with_uninit_and_ptr(&tcx, src_range)
1064+
.map_err(|e| e.to_interp_error(src_alloc_id))?
1065+
.as_ptr(); // raw ptr, so we can also get a ptr to the destination allocation
10601066
// first copy the relocations to a temporary buffer, because
10611067
// `get_bytes_mut` will clear the relocations, which is correct,
10621068
// since we don't want to keep any relocations at the target.
1063-
// (`get_bytes_with_uninit_and_ptr` below checks that there are no
1064-
// relocations overlapping the edges; those would not be handled correctly).
10651069
let relocations =
10661070
src_alloc.prepare_relocation_copy(self, src_range, dest_offset, num_copies);
10671071
// Prepare a copy of the initialization mask.
10681072
let compressed = src_alloc.compress_uninit_range(src_range);
1069-
// This checks relocation edges on the src.
1070-
let src_bytes = src_alloc
1071-
.get_bytes_with_uninit_and_ptr(&tcx, src_range)
1072-
.map_err(|e| e.to_interp_error(src_alloc_id))?
1073-
.as_ptr(); // raw ptr, so we can also get a ptr to the destination allocation
10741073

10751074
// Destination alloc preparations and access hooks.
10761075
let (dest_alloc, extra) = self.get_raw_mut(dest_alloc_id)?;

0 commit comments

Comments
 (0)
Please sign in to comment.