Skip to content

Commit ca3a028

Browse files
authored
Rollup merge of rust-lang#117338 - workingjubilee:asmjs-meets-thanatos, r=b-naber
Remove asmjs Fulfills [MCP 668](rust-lang/compiler-team#668). `asmjs-unknown-emscripten` does not work as-specified, and lacks essential upstream support for generating asm.js, so it should not exist at all.
2 parents f6dcaee + dbb2500 commit ca3a028

File tree

50 files changed

+11
-138
lines changed

Some content is hidden

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

50 files changed

+11
-138
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -990,11 +990,7 @@ unsafe fn embed_bitcode(
990990
// reason (see issue #90326 for historical background).
991991
let is_aix = target_is_aix(cgcx);
992992
let is_apple = target_is_apple(cgcx);
993-
if is_apple
994-
|| is_aix
995-
|| cgcx.opts.target_triple.triple().starts_with("wasm")
996-
|| cgcx.opts.target_triple.triple().starts_with("asmjs")
997-
{
993+
if is_apple || is_aix || cgcx.opts.target_triple.triple().starts_with("wasm") {
998994
// We don't need custom section flags, create LLVM globals.
999995
let llconst = common::bytes_in_context(llcx, bitcode);
1000996
let llglobal = llvm::LLVMAddGlobal(

compiler/rustc_codegen_ssa/src/back/link.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2243,9 +2243,9 @@ fn linker_with_args<'a>(
22432243
// ------------ Late order-dependent options ------------
22442244

22452245
// Doesn't really make sense.
2246-
// FIXME: In practice built-in target specs use this for arbitrary order-independent options,
2247-
// introduce a target spec option for order-independent linker options, migrate built-in specs
2248-
// to it and remove the option.
2246+
// FIXME: In practice built-in target specs use this for arbitrary order-independent options.
2247+
// Introduce a target spec option for order-independent linker options, migrate built-in specs
2248+
// to it and remove the option. Currently the last holdout is wasm32-unknown-emscripten.
22492249
add_post_link_args(cmd, sess, flavor);
22502250

22512251
Ok(cmd.take_cmd())

compiler/rustc_target/src/abi/call/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ impl<'a, Ty> FnAbi<'a, Ty> {
836836
wasm::compute_c_abi_info(cx, self)
837837
}
838838
}
839-
"asmjs" => wasm::compute_c_abi_info(cx, self),
840839
"bpf" => bpf::compute_abi_info(self),
841840
arch => {
842841
return Err(AdjustForForeignAbiError::Unsupported {

compiler/rustc_target/src/spec/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,6 @@ supported_targets! {
16091609
("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
16101610
("thumbv7a-uwp-windows-msvc", thumbv7a_uwp_windows_msvc),
16111611

1612-
("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
16131612
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
16141613
("wasm32-unknown-unknown", wasm32_unknown_unknown),
16151614
("wasm32-wasi", wasm32_wasi),
@@ -2244,10 +2243,6 @@ impl TargetOptions {
22442243
add_link_args(&mut self.pre_link_args, flavor, args);
22452244
}
22462245

2247-
fn add_post_link_args(&mut self, flavor: LinkerFlavor, args: &[&'static str]) {
2248-
add_link_args(&mut self.post_link_args, flavor, args);
2249-
}
2250-
22512246
fn update_from_cli(&mut self) {
22522247
self.linker_flavor = LinkerFlavor::from_cli_json(
22532248
self.linker_flavor_json,

library/core/src/ffi/mod.rs

-6
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ impl fmt::Debug for c_void {
241241
),
242242
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
243243
target_family = "wasm",
244-
target_arch = "asmjs",
245244
target_os = "uefi",
246245
windows,
247246
))]
@@ -270,7 +269,6 @@ pub struct VaListImpl<'f> {
270269
),
271270
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
272271
target_family = "wasm",
273-
target_arch = "asmjs",
274272
target_os = "uefi",
275273
windows,
276274
))]
@@ -395,7 +393,6 @@ pub struct VaList<'a, 'f: 'a> {
395393
any(target_os = "macos", target_os = "ios", target_os = "tvos")
396394
),
397395
target_family = "wasm",
398-
target_arch = "asmjs",
399396
target_os = "uefi",
400397
windows,
401398
))]
@@ -413,7 +410,6 @@ pub struct VaList<'a, 'f: 'a> {
413410
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
414411
),
415412
not(target_family = "wasm"),
416-
not(target_arch = "asmjs"),
417413
not(target_os = "uefi"),
418414
not(windows),
419415
))]
@@ -431,7 +427,6 @@ pub struct VaList<'a, 'f: 'a> {
431427
),
432428
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
433429
target_family = "wasm",
434-
target_arch = "asmjs",
435430
target_os = "uefi",
436431
windows,
437432
))]
@@ -461,7 +456,6 @@ impl<'f> VaListImpl<'f> {
461456
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
462457
),
463458
not(target_family = "wasm"),
464-
not(target_arch = "asmjs"),
465459
not(target_os = "uefi"),
466460
not(windows),
467461
))]

library/std/build.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ fn main() {
2525
|| target.contains("vxworks")
2626
|| target.contains("wasm32")
2727
|| target.contains("wasm64")
28-
|| target.contains("asmjs")
2928
|| target.contains("espidf")
3029
|| target.contains("solid")
3130
|| target.contains("nintendo-3ds")

library/std/src/os/l4re/raw.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
3131
target_arch = "powerpc",
3232
target_arch = "sparc",
3333
target_arch = "arm",
34-
target_arch = "asmjs",
3534
target_arch = "wasm32"
3635
))]
3736
mod arch {

library/std/src/os/linux/raw.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
3131
target_arch = "powerpc",
3232
target_arch = "sparc",
3333
target_arch = "arm",
34-
target_arch = "asmjs",
3534
target_arch = "wasm32"
3635
))]
3736
mod arch {

library/std/src/sys/common/alloc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use crate::ptr;
1414
target_arch = "powerpc",
1515
target_arch = "powerpc64",
1616
target_arch = "sparc",
17-
target_arch = "asmjs",
1817
target_arch = "wasm32",
1918
target_arch = "hexagon",
2019
all(target_arch = "riscv32", not(target_os = "espidf")),

library/std/src/sys/unix/env.rs

-11
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,6 @@ pub mod os {
174174
pub const EXE_EXTENSION: &str = "elf";
175175
}
176176

177-
#[cfg(all(target_os = "emscripten", target_arch = "asmjs"))]
178-
pub mod os {
179-
pub const FAMILY: &str = "unix";
180-
pub const OS: &str = "emscripten";
181-
pub const DLL_PREFIX: &str = "lib";
182-
pub const DLL_SUFFIX: &str = ".so";
183-
pub const DLL_EXTENSION: &str = "so";
184-
pub const EXE_SUFFIX: &str = ".js";
185-
pub const EXE_EXTENSION: &str = "js";
186-
}
187-
188177
#[cfg(all(target_os = "emscripten", target_arch = "wasm32"))]
189178
pub mod os {
190179
pub const FAMILY: &str = "unix";

src/bootstrap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
9898
/* Extra values not defined in the built-in targets yet, but used in std */
9999
(Some(Mode::Std), "target_env", Some(&["libnx"])),
100100
// (Some(Mode::Std), "target_os", Some(&[])),
101-
(Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa"])),
101+
(Some(Mode::Std), "target_arch", Some(&["spirv", "nvptx", "xtensa"])),
102102
/* Extra names used by dependencies */
103103
// FIXME: Used by serde_json, but we should not be triggering on external dependencies.
104104
(Some(Mode::Rustc), "no_btreemap_remove_entry", None),

src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile

-43
This file was deleted.

src/ci/docker/host-x86_64/dist-various-1/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7m-none-eabi
7575
ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabi
7676
ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabihf
7777

78-
ENV TARGETS=asmjs-unknown-emscripten
79-
ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
78+
ENV TARGETS=wasm32-unknown-emscripten
8079
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
8180
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
8281
ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi

src/doc/rustc/src/platform-support.md

-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ target | std | notes
148148
`armv7a-none-eabi` | * | Bare ARMv7-A
149149
`armv7r-none-eabi` | * | Bare ARMv7-R
150150
`armv7r-none-eabihf` | * | Bare ARMv7-R, hardfloat
151-
`asmjs-unknown-emscripten` | ✓ | asm.js via Emscripten
152151
`i586-pc-windows-msvc` | * | 32-bit Windows w/o SSE [^x86_32-floats-x87]
153152
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux w/o SSE (kernel 3.2, glibc 2.17) [^x86_32-floats-x87]
154153
`i586-unknown-linux-musl` | ✓ | 32-bit Linux w/o SSE, MUSL [^x86_32-floats-x87]

src/librustdoc/clean/cfg.rs

-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,6 @@ impl<'a> fmt::Display for Display<'a> {
516516
(sym::target_arch, Some(arch)) => match arch.as_str() {
517517
"aarch64" => "AArch64",
518518
"arm" => "ARM",
519-
"asmjs" => "JavaScript",
520519
"loongarch64" => "LoongArch LA64",
521520
"m68k" => "M68k",
522521
"csky" => "CSKY",

src/tools/build-manifest/src/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ static TARGETS: &[&str] = &[
8282
"armv7r-none-eabi",
8383
"armv7r-none-eabihf",
8484
"armv7s-apple-ios",
85-
"asmjs-unknown-emscripten",
8685
"bpfeb-unknown-none",
8786
"bpfel-unknown-none",
8887
"i386-apple-ios",

src/tools/compiletest/src/common.rs

-3
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ impl Config {
410410

411411
pub fn matches_arch(&self, arch: &str) -> bool {
412412
self.target_cfg().arch == arch ||
413-
// Shorthand for convenience. The arch for
414-
// asmjs-unknown-emscripten is actually wasm32.
415-
(arch == "asmjs" && self.target.starts_with("asmjs")) ||
416413
// Matching all the thumb variants as one can be convenient.
417414
// (thumbv6m, thumbv7em, thumbv7m, etc.)
418415
(arch == "thumb" && self.target.starts_with("thumb"))

src/tools/compiletest/src/header/cfg.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,13 @@ pub(super) fn parse_cfg_name_directive<'a>(
146146
}
147147

148148
// `wasm32-bare` is an alias to refer to just wasm32-unknown-unknown
149-
// (in contrast to `wasm32` which also matches non-bare targets like
150-
// asmjs-unknown-emscripten).
149+
// (in contrast to `wasm32` which also matches non-bare targets)
151150
condition! {
152151
name: "wasm32-bare",
153152
condition: config.target == "wasm32-unknown-unknown",
154153
message: "when the target is WASM"
155154
}
156155

157-
condition! {
158-
name: "asmjs",
159-
condition: config.target.starts_with("asmjs"),
160-
message: "when the architecture is asm.js",
161-
}
162156
condition! {
163157
name: "thumb",
164158
condition: config.target.starts_with("thumb"),

src/tools/compiletest/src/header/tests.rs

-5
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,6 @@ fn ignore_arch() {
398398
("x86_64-unknown-linux-gnu", "x86_64"),
399399
("i686-unknown-linux-gnu", "x86"),
400400
("nvptx64-nvidia-cuda", "nvptx64"),
401-
("asmjs-unknown-emscripten", "wasm32"),
402-
("asmjs-unknown-emscripten", "asmjs"),
403401
("thumbv7m-none-eabi", "thumb"),
404402
];
405403
for (target, arch) in archs {
@@ -492,9 +490,6 @@ fn wasm_special() {
492490
("wasm32-unknown-unknown", "wasm32", true),
493491
("wasm32-unknown-unknown", "wasm32-bare", true),
494492
("wasm32-unknown-unknown", "wasm64", false),
495-
("asmjs-unknown-emscripten", "emscripten", true),
496-
("asmjs-unknown-emscripten", "wasm32", true),
497-
("asmjs-unknown-emscripten", "wasm32-bare", false),
498493
("wasm32-unknown-emscripten", "emscripten", true),
499494
("wasm32-unknown-emscripten", "wasm32", true),
500495
("wasm32-unknown-emscripten", "wasm32-bare", false),

src/tools/miri/src/shims/foreign_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
345345
// List taken from `library/std/src/sys/common/alloc.rs`.
346346
// This list should be kept in sync with the one from libstd.
347347
let min_align = match this.tcx.sess.target.arch.as_ref() {
348-
"x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
348+
"x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "wasm32" => 8,
349349
"x86_64" | "aarch64" | "mips64" | "mips64r6" | "s390x" | "sparc64" | "loongarch64" =>
350350
16,
351351
arch => bug!("unsupported target architecture for malloc: `{}`", arch),

tests/assembly/stack-protector/stack-protector-target-support.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// targets, with the exception of nvptx64-nvidia-cuda
33
//
44
// revisions: r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23
5-
// revisions: r24 r25 r26 r27 r28 r29 r30 r31 r32 r33 r34 r35 r36 r37 r38 r39 r40 r41 r42 r43 r44
5+
// revisions: r24 r25 r26 r27 r28 r29 r30 r31 r32 r33 r35 r36 r37 r38 r39 r40 r41 r42 r43 r44
66
// revisions: r45 r46 r47 r48 r49 r50 r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63 r64 r65
77
// revisions: r66 r67 r68 r69 r70 r71 r72 r73 r74 r75 r76 r77 r78 r79 r80 r81 r82 r83 r84
88
// assembly-output: emit-asm
@@ -72,8 +72,7 @@
7272
// [r32] needs-llvm-components: arm
7373
// [r33] compile-flags: --target armv7-unknown-linux-musleabihf
7474
// [r33] needs-llvm-components: arm
75-
// [r34] compile-flags: --target asmjs-unknown-emscripten
76-
// [r34] needs-llvm-components: webassembly
75+
7776
// [r35] compile-flags: --target i586-pc-windows-msvc
7877
// [r35] needs-llvm-components: x86
7978
// [r36] compile-flags: --target i586-unknown-linux-gnu

tests/incremental/commandline-args.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Test that changing a tracked commandline argument invalidates
22
// the cache while changing an untracked one doesn't.
33

4-
// ignore-asmjs wasm2js does not support source maps yet
54
// revisions:rpass1 rpass2 rpass3 rpass4
65
// compile-flags: -Z query-dep-graph
76

tests/incremental/remapped_paths_cc/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// compile-flags: -Z query-dep-graph -g
33
// aux-build:extern_crate.rs
44

5-
// ignore-asmjs wasm2js does not support source maps yet
65
// This test case makes sure that we detect if paths emitted into debuginfo
76
// are changed, even when the change happens in an external crate.
87

tests/incremental/span_hash_stable/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// the spans and this test makes sure that we handle them correctly by hashing
44
// file:line:column instead of raw byte offset.
55

6-
// ignore-asmjs wasm2js does not support source maps yet
76
// revisions:rpass1 rpass2
87
// compile-flags: -g -Z query-dep-graph
98

tests/incremental/spans_in_type_debuginfo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Test that moving a type definition within a source file does not affect
22
// re-compilation.
33

4-
// ignore-asmjs wasm2js does not support source maps yet
54
// revisions:rpass1 rpass2
65
// compile-flags: -Z query-dep-graph -g
76

tests/incremental/spans_significant_w_debuginfo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// revisions:rpass1 rpass2
55

6-
// ignore-asmjs wasm2js does not support source maps yet
76
// compile-flags: -g -Z query-dep-graph
87

98
#![feature(rustc_attrs)]

tests/ui/abi/variadic-ffi.rs

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ use std::ffi::VaList;
88
extern "C" {
99
fn rust_interesting_average(_: u64, ...) -> f64;
1010

11-
// FIXME: we need to disable this lint for `VaList`,
12-
// since it contains a `MaybeUninit<i32>` on the asmjs target,
13-
// and this type isn't FFI-safe. This is OK for now,
14-
// since the type is layout-compatible with `i32`.
15-
#[cfg_attr(target_arch = "asmjs", allow(improper_ctypes))]
1611
fn rust_valist_interesting_average(_: u64, _: VaList) -> f64;
1712
}
1813

tests/ui/async-await/issue-60709.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
44

55
// run-pass
6-
// ignore-asmjs wasm2js does not support source maps yet
76

87
use std::future::Future;
98
use std::task::Poll;

tests/ui/binding/match-arm-statics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
#![allow(dead_code)]
33
// compile-flags: -g
4-
// ignore-asmjs wasm2js does not support source maps yet
54

65
#[derive(PartialEq, Eq)]
76
struct NewBool(bool);

tests/ui/cfg/conditional-compile-arch.rs

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ pub fn main() { }
2828
#[cfg(target_arch = "s390x")]
2929
pub fn main() { }
3030

31-
#[cfg(target_arch = "asmjs")]
32-
pub fn main() { }
33-
3431
#[cfg(target_arch = "wasm32")]
3532
pub fn main() { }
3633

0 commit comments

Comments
 (0)