Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove asmjs #117338

Merged
merged 8 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2251,9 +2251,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())
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/abi/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,6 @@ impl<'a, Ty> FnAbi<'a, Ty> {
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 {
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_target/src/spec/asmjs_unknown_emscripten.rs

This file was deleted.

5 changes: 0 additions & 5 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,6 @@ supported_targets! {
("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),
Expand Down Expand Up @@ -2276,10 +2275,6 @@ impl TargetOptions {
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,
Expand Down
6 changes: 0 additions & 6 deletions library/core/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ impl fmt::Debug for c_void {
),
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
target_family = "wasm",
target_arch = "asmjs",
target_os = "uefi",
windows,
))]
Expand Down Expand Up @@ -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,
))]
Expand Down Expand Up @@ -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,
))]
Expand All @@ -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),
))]
Expand All @@ -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,
))]
Expand Down Expand Up @@ -461,7 +456,6 @@ impl<'f> VaListImpl<'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),
))]
Expand Down
1 change: 0 additions & 1 deletion library/std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion library/std/src/os/l4re/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "arm",
target_arch = "asmjs",
target_arch = "wasm32"
))]
mod arch {
Expand Down
1 change: 0 additions & 1 deletion library/std/src/os/linux/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "arm",
target_arch = "asmjs",
target_arch = "wasm32"
))]
mod arch {
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/common/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::ptr;
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")),
Expand Down
11 changes: 0 additions & 11 deletions library/std/src/sys/unix/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
/* 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),
Expand Down
43 changes: 0 additions & 43 deletions src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile

This file was deleted.

3 changes: 1 addition & 2 deletions src/ci/docker/host-x86_64/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ impl<'a> fmt::Display for Display<'a> {
(sym::target_arch, Some(arch)) => match arch.as_str() {
"aarch64" => "AArch64",
"arm" => "ARM",
"asmjs" => "JavaScript",
"loongarch64" => "LoongArch LA64",
"m68k" => "M68k",
"csky" => "CSKY",
Expand Down
1 change: 0 additions & 1 deletion src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static TARGETS: &[&str] = &[
"armv7r-none-eabi",
"armv7r-none-eabihf",
"armv7s-apple-ios",
"asmjs-unknown-emscripten",
"bpfeb-unknown-none",
"bpfel-unknown-none",
"i386-apple-ios",
Expand Down
3 changes: 0 additions & 3 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,6 @@ impl Config {

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"))
Expand Down
8 changes: 1 addition & 7 deletions src/tools/compiletest/src/header/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,13 @@ pub(super) fn parse_cfg_name_directive<'a>(
}

// `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"),
Expand Down
5 changes: 0 additions & 5 deletions src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,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 {
Expand Down Expand Up @@ -490,9 +488,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),
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
// 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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/incremental/commandline-args.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/incremental/remapped_paths_cc/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 0 additions & 1 deletion tests/incremental/span_hash_stable/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/incremental/spans_in_type_debuginfo.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/incremental/spans_significant_w_debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 0 additions & 5 deletions tests/ui/abi/variadic-ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ use std::ffi::VaList;
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;
}

Expand Down
1 change: 0 additions & 1 deletion tests/ui/async-await/issue-60709.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion tests/ui/binding/match-arm-statics.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Loading
Loading