Skip to content

Commit b2f67c8

Browse files
committed
Auto merge of #45041 - est31:master, r=alexcrichton
Remove support for the PNaCl target (le32-unknown-nacl) This removes support for the `le32-unknown-nacl` target which is currently supported by rustc on tier 3. Despite the "nacl" in the name, the target doesn't output native code (x86, ARM, MIPS), instead it outputs binaries in the PNaCl format. There are two reasons for the removal: * Google [has announced](https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html) deprecation of the PNaCl format. The suggestion is to migrate to wasm. Happens we already have a wasm backend! * Our PNaCl LLVM backend is provided by the fastcomp patch set that the LLVM fork used by rustc contains in addition to vanilla LLVM (`src/llvm/lib/Target/JSBackend/NaCl`). Upstream LLVM doesn't have PNaCl support. Removing PNaCl support will enable us to move away from fastcomp (#44006) and have a lighter set of patches on top of upstream LLVM inside our LLVM fork. This will help distribution packagers of Rust. Fixes #42420
2 parents dbed066 + 327116a commit b2f67c8

File tree

16 files changed

+8
-295
lines changed

16 files changed

+8
-295
lines changed

src/librustc_back/target/le32_unknown_nacl.rs

-51
This file was deleted.

src/librustc_back/target/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ supported_targets! {
215215
("i686-pc-windows-msvc", i686_pc_windows_msvc),
216216
("i586-pc-windows-msvc", i586_pc_windows_msvc),
217217

218-
("le32-unknown-nacl", le32_unknown_nacl),
219218
("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
220219
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
221220
("wasm32-experimental-emscripten", wasm32_experimental_emscripten),

src/librustc_llvm/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn main() {
8888
let is_crossed = target != host;
8989

9090
let mut optional_components =
91-
vec!["x86", "arm", "aarch64", "mips", "powerpc", "pnacl",
91+
vec!["x86", "arm", "aarch64", "mips", "powerpc",
9292
"systemz", "jsbackend", "webassembly", "msp430", "sparc", "nvptx"];
9393

9494
let mut version_cmd = Command::new(&llvm_config);

src/librustc_llvm/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,6 @@ pub fn initialize_available_targets() {
346346
LLVMInitializePowerPCTargetMC,
347347
LLVMInitializePowerPCAsmPrinter,
348348
LLVMInitializePowerPCAsmParser);
349-
init_target!(llvm_component = "pnacl",
350-
LLVMInitializePNaClTargetInfo,
351-
LLVMInitializePNaClTarget,
352-
LLVMInitializePNaClTargetMC);
353349
init_target!(llvm_component = "systemz",
354350
LLVMInitializeSystemZTargetInfo,
355351
LLVMInitializeSystemZTarget,

src/librustdoc/clean/cfg.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ impl<'a> fmt::Display for Html<'a> {
337337
"l4re" => "L4Re",
338338
"linux" => "Linux",
339339
"macos" => "macOS",
340-
"nacl" => "NaCl",
341340
"netbsd" => "NetBSD",
342341
"openbsd" => "OpenBSD",
343342
"redox" => "Redox",
@@ -886,4 +885,4 @@ mod test {
886885
only."
887886
);
888887
}
889-
}
888+
}

src/libstd/os/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub mod linux;
3838
#[cfg(all(not(dox), target_os = "haiku"))] pub mod haiku;
3939
#[cfg(all(not(dox), target_os = "ios"))] pub mod ios;
4040
#[cfg(all(not(dox), target_os = "macos"))] pub mod macos;
41-
#[cfg(all(not(dox), target_os = "nacl"))] pub mod nacl;
4241
#[cfg(all(not(dox), target_os = "netbsd"))] pub mod netbsd;
4342
#[cfg(all(not(dox), target_os = "openbsd"))] pub mod openbsd;
4443
#[cfg(all(not(dox), target_os = "solaris"))] pub mod solaris;

src/libstd/os/nacl/fs.rs

-128
This file was deleted.

src/libstd/os/nacl/mod.rs

-16
This file was deleted.

src/libstd/os/nacl/raw.rs

-56
This file was deleted.

src/libstd/sys/unix/env.rs

-21
Original file line numberDiff line numberDiff line change
@@ -118,27 +118,6 @@ pub mod os {
118118
pub const EXE_EXTENSION: &'static str = "";
119119
}
120120

121-
#[cfg(all(target_os = "nacl", not(target_arch = "le32")))]
122-
pub mod os {
123-
pub const FAMILY: &'static str = "unix";
124-
pub const OS: &'static str = "nacl";
125-
pub const DLL_PREFIX: &'static str = "lib";
126-
pub const DLL_SUFFIX: &'static str = ".so";
127-
pub const DLL_EXTENSION: &'static str = "so";
128-
pub const EXE_SUFFIX: &'static str = ".nexe";
129-
pub const EXE_EXTENSION: &'static str = "nexe";
130-
}
131-
#[cfg(all(target_os = "nacl", target_arch = "le32"))]
132-
pub mod os {
133-
pub const FAMILY: &'static str = "unix";
134-
pub const OS: &'static str = "pnacl";
135-
pub const DLL_PREFIX: &'static str = "lib";
136-
pub const DLL_SUFFIX: &'static str = ".pso";
137-
pub const DLL_EXTENSION: &'static str = "pso";
138-
pub const EXE_SUFFIX: &'static str = ".pexe";
139-
pub const EXE_EXTENSION: &'static str = "pexe";
140-
}
141-
142121
#[cfg(target_os = "haiku")]
143122
pub mod os {
144123
pub const FAMILY: &'static str = "unix";

src/libstd/sys/unix/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use libc;
2222
#[cfg(all(not(dox), target_os = "haiku"))] pub use os::haiku as platform;
2323
#[cfg(all(not(dox), target_os = "ios"))] pub use os::ios as platform;
2424
#[cfg(all(not(dox), target_os = "macos"))] pub use os::macos as platform;
25-
#[cfg(all(not(dox), target_os = "nacl"))] pub use os::nacl as platform;
2625
#[cfg(all(not(dox), target_os = "netbsd"))] pub use os::netbsd as platform;
2726
#[cfg(all(not(dox), target_os = "openbsd"))] pub use os::openbsd as platform;
2827
#[cfg(all(not(dox), target_os = "solaris"))] pub use os::solaris as platform;
@@ -77,11 +76,11 @@ pub fn init() {
7776
reset_sigpipe();
7877
}
7978

80-
#[cfg(not(any(target_os = "nacl", target_os = "emscripten", target_os="fuchsia")))]
79+
#[cfg(not(any(target_os = "emscripten", target_os="fuchsia")))]
8180
unsafe fn reset_sigpipe() {
8281
assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR);
8382
}
84-
#[cfg(any(target_os = "nacl", target_os = "emscripten", target_os="fuchsia"))]
83+
#[cfg(any(target_os = "emscripten", target_os="fuchsia"))]
8584
unsafe fn reset_sigpipe() {}
8685
}
8786

src/libstd/sys/unix/os.rs

-2
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,10 @@ pub fn home_dir() -> Option<PathBuf> {
483483

484484
#[cfg(any(target_os = "android",
485485
target_os = "ios",
486-
target_os = "nacl",
487486
target_os = "emscripten"))]
488487
unsafe fn fallback() -> Option<OsString> { None }
489488
#[cfg(not(any(target_os = "android",
490489
target_os = "ios",
491-
target_os = "nacl",
492490
target_os = "emscripten")))]
493491
unsafe fn fallback() -> Option<OsString> {
494492
let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {

src/libstd/sys/unix/process/process_common.rs

-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ mod tests {
464464
// test from being flaky we ignore it on macOS.
465465
#[test]
466466
#[cfg_attr(target_os = "macos", ignore)]
467-
#[cfg_attr(target_os = "nacl", ignore)] // no signals on NaCl.
468467
// When run under our current QEMU emulation test suite this test fails,
469468
// although the reason isn't very clear as to why. For now this test is
470469
// ignored there.

src/libstd/sys/unix/process/process_unix.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ impl Command {
184184
*sys::os::environ() = envp.as_ptr();
185185
}
186186

187-
// NaCl has no signal support.
188-
#[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
187+
// emscripten has no signal support.
188+
#[cfg(not(any(target_os = "emscripten")))]
189189
{
190190
use mem;
191191
// Reset signal handling so the child process starts in a

src/libstd/sys_common/backtrace.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![cfg_attr(target_os = "nacl", allow(dead_code))]
12-
1311
/// Common code for printing the backtrace in the same way across the different
1412
/// supported platforms.
1513

0 commit comments

Comments
 (0)