diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile
index 6c08340eb98b30d48903b1972475fc36c4430b13..64f73aa6a00b9282faffcca8c1261ef865e0f93e 100644
--- a/ci/docker/asmjs-unknown-emscripten/Dockerfile
+++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile
@@ -7,6 +7,7 @@ RUN apt-get update && \
     gcc \
     git \
     libc6-dev \
+    libxml2 \
     python \
     xz-utils
 
diff --git a/ci/docker/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile
index c0ce825ed74436156dcacddb77084f77d5aebbcf..4de9e7475559d853213396f27e047e536347ec27 100644
--- a/ci/docker/wasm32-unknown-emscripten/Dockerfile
+++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile
@@ -10,6 +10,7 @@ RUN apt-get update && \
     gcc \
     git \
     libc6-dev \
+    libxml2 \
     python \
     cmake \
     sudo \
diff --git a/ci/emscripten.sh b/ci/emscripten.sh
index db3132325503d081e3dfff087708a2897d51d5b2..acec4ca26f87f7057630fc9a3db3f2c8a550c772 100644
--- a/ci/emscripten.sh
+++ b/ci/emscripten.sh
@@ -28,21 +28,18 @@ exit 1
   set -x
 }
 
-cd /
-curl --retry 5 -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
-    tar -xz
-
+git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
 cd /emsdk-portable
-./emsdk update
-hide_output ./emsdk install sdk-1.38.15-64bit
-./emsdk activate sdk-1.38.15-64bit
+# TODO: switch to an upstream install once
+# https://github.com/rust-lang/rust/pull/63649 lands
+hide_output ./emsdk install 1.38.42
+./emsdk activate 1.38.42
 
 # Compile and cache libc
 # shellcheck disable=SC1091
 source ./emsdk_env.sh
 echo "main(){}" > a.c
 HOME=/emsdk-portable/ emcc a.c
-HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c
 rm -f a.*
 
 # Make emsdk usable by any user
@@ -53,4 +50,3 @@ chmod a+rxw -R /emsdk-portable
 cd /
 curl --retry 5 -L https://nodejs.org/dist/v12.3.1/node-v12.3.1-linux-x64.tar.xz | \
     tar -xJ
-
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index 67631fccf08925483077946fde9df5708075cf66..acce2c1d41fedc10cfc81b3aff60fb1d733ddb38 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -5,8 +5,8 @@ pub type dev_t = u32;
 pub type socklen_t = u32;
 pub type pthread_t = c_ulong;
 pub type mode_t = u32;
-pub type ino64_t = u32;
-pub type off64_t = i32;
+pub type ino64_t = u64;
+pub type off64_t = i64;
 pub type blkcnt64_t = i32;
 pub type rlim64_t = u64;
 pub type shmatt_t = ::c_ulong;
@@ -16,14 +16,14 @@ pub type msglen_t = ::c_ulong;
 pub type nfds_t = ::c_ulong;
 pub type nl_item = ::c_int;
 pub type idtype_t = ::c_uint;
-pub type loff_t = i32;
+pub type loff_t = i64;
 pub type pthread_key_t = ::c_uint;
 
 pub type clock_t = c_long;
 pub type time_t = c_long;
 pub type suseconds_t = c_long;
-pub type ino_t = u32;
-pub type off_t = i32;
+pub type ino_t = u64;
+pub type off_t = i64;
 pub type blkcnt_t = i32;
 
 pub type blksize_t = c_long;