Skip to content

Update Emscripten system types #1478

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

Merged
merged 10 commits into from
Sep 7, 2019
Merged
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
1 change: 1 addition & 0 deletions ci/docker/asmjs-unknown-emscripten/Dockerfile
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ RUN apt-get update && \
gcc \
git \
libc6-dev \
libxml2 \
python \
xz-utils

1 change: 1 addition & 0 deletions ci/docker/wasm32-unknown-emscripten/Dockerfile
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ RUN apt-get update && \
gcc \
git \
libc6-dev \
libxml2 \
python \
cmake \
sudo \
14 changes: 5 additions & 9 deletions ci/emscripten.sh
Original file line number Diff line number Diff line change
@@ -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

10 changes: 5 additions & 5 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
@@ -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;