Skip to content

Commit 8f20ff6

Browse files
authored
Rollup merge of rust-lang#83013 - hyd-dev:cfg-unix-windows, r=bjorn3
Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account This makes compilation to such targets (e.g. `wasm32-wasi`) easier. cc rust-lang/miri#722 rust-lang@bb6d1d0#r48100619
2 parents 766c875 + 00c0872 commit 8f20ff6

File tree

1 file changed

+7
-2
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+7
-2
lines changed

Diff for: compiler/rustc_codegen_ssa/src/back/link.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
711711
status.signal() == Some(libc::SIGILL)
712712
}
713713

714-
#[cfg(windows)]
714+
#[cfg(not(unix))]
715715
fn is_illegal_instruction(_status: &ExitStatus) -> bool {
716716
false
717717
}
@@ -1198,7 +1198,7 @@ fn exec_linker(
11981198
flush_linked_file(&output, out_filename)?;
11991199
return output;
12001200

1201-
#[cfg(unix)]
1201+
#[cfg(not(windows))]
12021202
fn flush_linked_file(_: &io::Result<Output>, _: &Path) -> io::Result<()> {
12031203
Ok(())
12041204
}
@@ -1238,6 +1238,11 @@ fn exec_linker(
12381238
err.raw_os_error() == Some(ERROR_FILENAME_EXCED_RANGE)
12391239
}
12401240

1241+
#[cfg(not(any(unix, windows)))]
1242+
fn command_line_too_big(_: &io::Error) -> bool {
1243+
false
1244+
}
1245+
12411246
struct Escape<'a> {
12421247
arg: &'a str,
12431248
is_like_msvc: bool,

0 commit comments

Comments
 (0)