Skip to content

Commit a16dca3

Browse files
committed
Auto merge of #65251 - tlively:emscripten-upstream-upgrade, r=tlively
Upgrade Emscripten targets to use upstream LLVM backend - Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649. r? @alexcrichton
2 parents 7e49800 + c0aa7cb commit a16dca3

File tree

148 files changed

+438
-603
lines changed

Some content is hidden

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

148 files changed

+438
-603
lines changed

config.toml.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
# but you can also optionally enable the "emscripten" backend for asm.js or
378378
# make this an empty array (but that probably won't get too far in the
379379
# bootstrap)
380+
# FIXME: remove the obsolete emscripten backend option.
380381
#codegen-backends = ["llvm"]
381382

382383
# This is the name of the directory in which codegen backends will get installed

src/bootstrap/builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ impl<'a> Builder<'a> {
980980
Some("-Wl,-rpath,@loader_path/../lib")
981981
} else if !target.contains("windows") &&
982982
!target.contains("wasm32") &&
983+
!target.contains("emscripten") &&
983984
!target.contains("fuchsia") {
984985
Some("-Wl,-rpath,$ORIGIN/../lib")
985986
} else {

src/bootstrap/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,11 @@ impl Step for Compiletest {
10471047
// Also provide `rust_test_helpers` for the host.
10481048
builder.ensure(native::TestHelpers { target: compiler.host });
10491049

1050-
// wasm32 can't build the test helpers
1051-
if !target.contains("wasm32") {
1050+
// As well as the target, except for plain wasm32, which can't build it
1051+
if !target.contains("wasm32") || target.contains("emscripten") {
10521052
builder.ensure(native::TestHelpers { target });
10531053
}
1054+
10541055
builder.ensure(RemoteCopyLibs { compiler, target });
10551056

10561057
let mut cmd = builder.tool_cmd(Tool::Compiletest);

src/ci/azure-pipelines/auto.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ jobs:
124124
IMAGE: dist-x86_64-netbsd
125125
DEPLOY: 1
126126

127-
asmjs:
128-
IMAGE: asmjs
129127
i686-gnu:
130128
IMAGE: i686-gnu
131129
i686-gnu-nopt:
132130
IMAGE: i686-gnu-nopt
133131
test-various:
134132
IMAGE: test-various
133+
wasm32:
134+
IMAGE: wasm32
135135
x86_64-gnu:
136136
IMAGE: x86_64-gnu
137137
x86_64-gnu-full-bootstrap:

src/ci/docker/asmjs/Dockerfile

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++ \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python \
10+
git \
11+
cmake \
12+
sudo \
13+
gdb \
14+
xz-utils \
15+
bzip2
16+
17+
COPY scripts/emscripten.sh /scripts/
18+
RUN bash /scripts/emscripten.sh
19+
20+
COPY scripts/sccache.sh /scripts/
21+
RUN sh /scripts/sccache.sh
22+
23+
ENV PATH=$PATH:/emsdk-portable
24+
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
25+
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
26+
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
27+
28+
ENV TARGETS=asmjs-unknown-emscripten
29+
30+
# Use -O1 optimizations in the link step to reduce time spent optimizing JS.
31+
ENV EMCC_CFLAGS=-O1
32+
33+
# Emscripten installation is user-specific
34+
ENV NO_CHANGE_USER=1
35+
36+
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
37+
38+
# This is almost identical to the wasm32-unknown-emscripten target, so
39+
# running with assertions again is not useful
40+
ENV NO_DEBUG_ASSERTIONS=1
41+
ENV NO_LLVM_ASSERTIONS=1

src/ci/docker/disabled/wasm32-exp/Dockerfile

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/ci/docker/disabled/wasm32-exp/node.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/ci/docker/disabled/wasm32/Dockerfile

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/ci/docker/scripts/emscripten-wasm.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)