Rollup merge of #117338 - workingjubilee:asmjs-meets-thanatos, r=b-naber

Remove asmjs

Fulfills [MCP 668](https://github.com/rust-lang/compiler-team/issues/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.
This commit is contained in:
Matthias Krüger 2023-11-17 23:04:21 +01:00 committed by GitHub
commit ca3a02836e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 11 additions and 138 deletions

View File

@ -990,11 +990,7 @@ unsafe fn embed_bitcode(
// reason (see issue #90326 for historical background).
let is_aix = target_is_aix(cgcx);
let is_apple = target_is_apple(cgcx);
if is_apple
|| is_aix
|| cgcx.opts.target_triple.triple().starts_with("wasm")
|| cgcx.opts.target_triple.triple().starts_with("asmjs")
{
if is_apple || is_aix || cgcx.opts.target_triple.triple().starts_with("wasm") {
// We don't need custom section flags, create LLVM globals.
let llconst = common::bytes_in_context(llcx, bitcode);
let llglobal = llvm::LLVMAddGlobal(

View File

@ -2243,9 +2243,9 @@ fn linker_with_args<'a>(
// ------------ Late order-dependent options ------------
// Doesn't really make sense.
// FIXME: In practice built-in target specs use this for arbitrary order-independent options,
// introduce a target spec option for order-independent linker options, migrate built-in specs
// to it and remove the option.
// FIXME: In practice built-in target specs use this for arbitrary order-independent options.
// Introduce a target spec option for order-independent linker options, migrate built-in specs
// to it and remove the option. Currently the last holdout is wasm32-unknown-emscripten.
add_post_link_args(cmd, sess, flavor);
Ok(cmd.take_cmd())

View File

@ -836,7 +836,6 @@ pub fn adjust_for_foreign_abi<C>(
wasm::compute_c_abi_info(cx, self)
}
}
"asmjs" => wasm::compute_c_abi_info(cx, self),
"bpf" => bpf::compute_abi_info(self),
arch => {
return Err(AdjustForForeignAbiError::Unsupported {

View File

@ -1609,7 +1609,6 @@ fn $module() {
("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
("thumbv7a-uwp-windows-msvc", thumbv7a_uwp_windows_msvc),
("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
("wasm32-unknown-unknown", wasm32_unknown_unknown),
("wasm32-wasi", wasm32_wasi),
@ -2244,10 +2243,6 @@ fn add_pre_link_args(&mut self, flavor: LinkerFlavor, args: &[&'static str]) {
add_link_args(&mut self.pre_link_args, flavor, args);
}
fn add_post_link_args(&mut self, flavor: LinkerFlavor, args: &[&'static str]) {
add_link_args(&mut self.post_link_args, flavor, args);
}
fn update_from_cli(&mut self) {
self.linker_flavor = LinkerFlavor::from_cli_json(
self.linker_flavor_json,

View File

@ -241,7 +241,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
),
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
target_family = "wasm",
target_arch = "asmjs",
target_os = "uefi",
windows,
))]
@ -270,7 +269,6 @@ pub struct VaListImpl<'f> {
),
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
target_family = "wasm",
target_arch = "asmjs",
target_os = "uefi",
windows,
))]
@ -395,7 +393,6 @@ pub struct VaList<'a, 'f: 'a> {
any(target_os = "macos", target_os = "ios", target_os = "tvos")
),
target_family = "wasm",
target_arch = "asmjs",
target_os = "uefi",
windows,
))]
@ -413,7 +410,6 @@ pub struct VaList<'a, 'f: 'a> {
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
),
not(target_family = "wasm"),
not(target_arch = "asmjs"),
not(target_os = "uefi"),
not(windows),
))]
@ -431,7 +427,6 @@ pub struct VaList<'a, 'f: 'a> {
),
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
target_family = "wasm",
target_arch = "asmjs",
target_os = "uefi",
windows,
))]
@ -461,7 +456,6 @@ pub fn as_va_list<'a>(&'a mut self) -> VaList<'a, 'f> {
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
),
not(target_family = "wasm"),
not(target_arch = "asmjs"),
not(target_os = "uefi"),
not(windows),
))]

View File

@ -25,7 +25,6 @@ fn main() {
|| target.contains("vxworks")
|| target.contains("wasm32")
|| target.contains("wasm64")
|| target.contains("asmjs")
|| target.contains("espidf")
|| target.contains("solid")
|| target.contains("nintendo-3ds")

View File

@ -31,7 +31,6 @@
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "arm",
target_arch = "asmjs",
target_arch = "wasm32"
))]
mod arch {

View File

@ -31,7 +31,6 @@
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "arm",
target_arch = "asmjs",
target_arch = "wasm32"
))]
mod arch {

View File

@ -14,7 +14,6 @@
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "sparc",
target_arch = "asmjs",
target_arch = "wasm32",
target_arch = "hexagon",
all(target_arch = "riscv32", not(target_os = "espidf")),

View File

@ -174,17 +174,6 @@ pub mod os {
pub const EXE_EXTENSION: &str = "elf";
}
#[cfg(all(target_os = "emscripten", target_arch = "asmjs"))]
pub mod os {
pub const FAMILY: &str = "unix";
pub const OS: &str = "emscripten";
pub const DLL_PREFIX: &str = "lib";
pub const DLL_SUFFIX: &str = ".so";
pub const DLL_EXTENSION: &str = "so";
pub const EXE_SUFFIX: &str = ".js";
pub const EXE_EXTENSION: &str = "js";
}
#[cfg(all(target_os = "emscripten", target_arch = "wasm32"))]
pub mod os {
pub const FAMILY: &str = "unix";

View File

@ -98,7 +98,7 @@
/* Extra values not defined in the built-in targets yet, but used in std */
(Some(Mode::Std), "target_env", Some(&["libnx"])),
// (Some(Mode::Std), "target_os", Some(&[])),
(Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa"])),
(Some(Mode::Std), "target_arch", Some(&["spirv", "nvptx", "xtensa"])),
/* Extra names used by dependencies */
// FIXME: Used by serde_json, but we should not be triggering on external dependencies.
(Some(Mode::Rustc), "no_btreemap_remove_entry", None),

View File

@ -1,43 +0,0 @@
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
sudo \
gdb \
xz-utils \
bzip2
COPY scripts/emscripten.sh /scripts/
RUN bash /scripts/emscripten.sh
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV PATH=$PATH:/emsdk-portable
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
ENV TARGETS=asmjs-unknown-emscripten
# Use -O1 optimizations in the link step to reduce time spent optimizing JS.
ENV EMCC_CFLAGS=-O1
# Emscripten installation is user-specific
ENV NO_CHANGE_USER=1
ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target $TARGETS
# This is almost identical to the wasm32-unknown-emscripten target, so
# running with assertions again is not useful
ENV NO_DEBUG_ASSERTIONS=1
ENV NO_LLVM_ASSERTIONS=1
ENV NO_OVERFLOW_CHECKS=1

View File

@ -75,8 +75,7 @@ ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7m-none-eabi
ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabi
ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabihf
ENV TARGETS=asmjs-unknown-emscripten
ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
ENV TARGETS=wasm32-unknown-emscripten
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi

View File

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

View File

@ -516,7 +516,6 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
(sym::target_arch, Some(arch)) => match arch.as_str() {
"aarch64" => "AArch64",
"arm" => "ARM",
"asmjs" => "JavaScript",
"loongarch64" => "LoongArch LA64",
"m68k" => "M68k",
"csky" => "CSKY",

View File

@ -82,7 +82,6 @@
"armv7r-none-eabi",
"armv7r-none-eabihf",
"armv7s-apple-ios",
"asmjs-unknown-emscripten",
"bpfeb-unknown-none",
"bpfel-unknown-none",
"i386-apple-ios",

View File

@ -410,9 +410,6 @@ pub fn target_cfg(&self) -> &TargetCfg {
pub fn matches_arch(&self, arch: &str) -> bool {
self.target_cfg().arch == arch ||
// Shorthand for convenience. The arch for
// asmjs-unknown-emscripten is actually wasm32.
(arch == "asmjs" && self.target.starts_with("asmjs")) ||
// Matching all the thumb variants as one can be convenient.
// (thumbv6m, thumbv7em, thumbv7m, etc.)
(arch == "thumb" && self.target.starts_with("thumb"))

View File

@ -146,19 +146,13 @@ macro_rules! condition {
}
// `wasm32-bare` is an alias to refer to just wasm32-unknown-unknown
// (in contrast to `wasm32` which also matches non-bare targets like
// asmjs-unknown-emscripten).
// (in contrast to `wasm32` which also matches non-bare targets)
condition! {
name: "wasm32-bare",
condition: config.target == "wasm32-unknown-unknown",
message: "when the target is WASM"
}
condition! {
name: "asmjs",
condition: config.target.starts_with("asmjs"),
message: "when the architecture is asm.js",
}
condition! {
name: "thumb",
condition: config.target.starts_with("thumb"),

View File

@ -398,8 +398,6 @@ fn ignore_arch() {
("x86_64-unknown-linux-gnu", "x86_64"),
("i686-unknown-linux-gnu", "x86"),
("nvptx64-nvidia-cuda", "nvptx64"),
("asmjs-unknown-emscripten", "wasm32"),
("asmjs-unknown-emscripten", "asmjs"),
("thumbv7m-none-eabi", "thumb"),
];
for (target, arch) in archs {
@ -492,9 +490,6 @@ fn wasm_special() {
("wasm32-unknown-unknown", "wasm32", true),
("wasm32-unknown-unknown", "wasm32-bare", true),
("wasm32-unknown-unknown", "wasm64", false),
("asmjs-unknown-emscripten", "emscripten", true),
("asmjs-unknown-emscripten", "wasm32", true),
("asmjs-unknown-emscripten", "wasm32-bare", false),
("wasm32-unknown-emscripten", "emscripten", true),
("wasm32-unknown-emscripten", "wasm32", true),
("wasm32-unknown-emscripten", "wasm32-bare", false),

View File

@ -345,7 +345,7 @@ fn min_align(&self, size: u64, kind: MiriMemoryKind) -> Align {
// List taken from `library/std/src/sys/common/alloc.rs`.
// This list should be kept in sync with the one from libstd.
let min_align = match this.tcx.sess.target.arch.as_ref() {
"x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
"x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "wasm32" => 8,
"x86_64" | "aarch64" | "mips64" | "mips64r6" | "s390x" | "sparc64" | "loongarch64" =>
16,
arch => bug!("unsupported target architecture for malloc: `{}`", arch),

View File

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

View File

@ -1,7 +1,6 @@
// Test that changing a tracked commandline argument invalidates
// the cache while changing an untracked one doesn't.
// ignore-asmjs wasm2js does not support source maps yet
// revisions:rpass1 rpass2 rpass3 rpass4
// compile-flags: -Z query-dep-graph

View File

@ -2,7 +2,6 @@
// compile-flags: -Z query-dep-graph -g
// aux-build:extern_crate.rs
// ignore-asmjs wasm2js does not support source maps yet
// This test case makes sure that we detect if paths emitted into debuginfo
// are changed, even when the change happens in an external crate.

View File

@ -3,7 +3,6 @@
// the spans and this test makes sure that we handle them correctly by hashing
// file:line:column instead of raw byte offset.
// ignore-asmjs wasm2js does not support source maps yet
// revisions:rpass1 rpass2
// compile-flags: -g -Z query-dep-graph

View File

@ -1,7 +1,6 @@
// Test that moving a type definition within a source file does not affect
// re-compilation.
// ignore-asmjs wasm2js does not support source maps yet
// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph -g

View File

@ -3,7 +3,6 @@
// revisions:rpass1 rpass2
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g -Z query-dep-graph
#![feature(rustc_attrs)]

View File

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

View File

@ -3,7 +3,6 @@
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
// run-pass
// ignore-asmjs wasm2js does not support source maps yet
use std::future::Future;
use std::task::Poll;

View File

@ -1,7 +1,6 @@
// run-pass
#![allow(dead_code)]
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
#[derive(PartialEq, Eq)]
struct NewBool(bool);

View File

@ -28,9 +28,6 @@ pub fn main() { }
#[cfg(target_arch = "s390x")]
pub fn main() { }
#[cfg(target_arch = "asmjs")]
pub fn main() { }
#[cfg(target_arch = "wasm32")]
pub fn main() { }

View File

@ -1,6 +1,5 @@
// run-pass
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
#![feature(coroutines, coroutine_trait)]

View File

@ -11,7 +11,6 @@
// edition:2018
// ignore-wasm32 issue #62807
// ignore-asmjs issue #62807
// needs-unwind Size of Closures change on panic=abort
#![feature(coroutines, coroutine_trait)]

View File

@ -6,7 +6,6 @@
// run-rustfix
// ignore-wasm32-bare no external library to link to.
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g
#![feature(rustc_private)]
extern crate libc;

View File

@ -6,7 +6,6 @@
// run-rustfix
// ignore-wasm32-bare no external library to link to.
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g
#![feature(rustc_private)]
extern crate libc;

View File

@ -1,5 +1,5 @@
error: extern items cannot be `const`
--> $DIR/extern-const.rs:16:11
--> $DIR/extern-const.rs:15:11
|
LL | const rust_dbg_static_mut: libc::c_int;
| ------^^^^^^^^^^^^^^^^^^^

View File

@ -2,7 +2,6 @@
// Test for issue #18804, #[linkage] does not propagate through generic
// functions. Failure results in a linker error.
// ignore-asmjs no weak symbol support
// ignore-emscripten no weak symbol support
// ignore-windows no extern_weak linkage
// ignore-macos no extern_weak linkage

View File

@ -1,5 +1,4 @@
// build-pass
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g
pub struct Dst {

View File

@ -1,7 +1,6 @@
// run-pass
// aux-build:issue-24687-lib.rs
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
extern crate issue_24687_lib as d;

View File

@ -3,7 +3,6 @@
// as options to the compiler.
// compile-flags:-g -g -O -O
// ignore-asmjs wasm2js does not support source maps yet
fn main() {
assert_eq!(1, 1);

View File

@ -1,6 +1,5 @@
// run-pass
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
fn helper<F: FnOnce(usize) -> bool>(_f: F) {
print!("");

View File

@ -1,6 +1,5 @@
// run-pass
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
use std::ops::Deref;

View File

@ -1,6 +1,5 @@
// run-pass
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
// In this test we just want to make sure that the code below does not lead to
// a debuginfo verification assertion during compilation. This was caused by the

View File

@ -2,7 +2,6 @@
// Regression test for #36856.
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
fn g() -> bool {
false

View File

@ -2,7 +2,6 @@
// Regression test for #42210.
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
trait Foo {
fn foo() { }

View File

@ -1,7 +1,6 @@
// run-pass
#![allow(unused_variables)]
// compile-flags:--test -g
// ignore-asmjs wasm2js does not support source maps yet
#[cfg(target_os = "macos")]
#[test]

View File

@ -1,6 +1,5 @@
// run-pass
// compile-flags:-C debuginfo=2
// ignore-asmjs wasm2js does not support source maps yet
fn foo() -> impl Copy {
foo

View File

@ -7,7 +7,6 @@
// aux-build:debuginfo-lto-aux.rs
// compile-flags: -C lto -g
// no-prefer-dynamic
// ignore-asmjs wasm2js does not support source maps yet
extern crate debuginfo_lto_aux;

View File

@ -7,7 +7,6 @@
// issue-48508-aux.rs
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
#![allow(uncommon_codepoints)]

View File

@ -4,7 +4,6 @@
// aux-build:sepcomp_lib.rs
// compile-flags: -C lto -g
// ignore-asmjs wasm2js does not support source maps yet
// no-prefer-dynamic
extern crate sepcomp_lib;

View File

@ -10,7 +10,6 @@
// This is a regression test for issue #17021.
//
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
use std::ptr;