Compare commits

...

30 Commits

Author SHA1 Message Date
69efc9161e Merge branch 'master' into emscripten-3.1.0 2022-01-02 14:21:15 +01:00
2c170310cb Merge pull request #645 from thewtex/wasm-tools
web-wasm,web-wasi: Add build tools
2022-01-02 14:20:26 +01:00
04090c683a web-wasm: Bump Emscripten to 3.1.0 2022-01-01 22:08:43 -05:00
6f3a3aad49 web-wasm,web-wasi: Add build tools
- Binaryen
- wabt
- WASI runtimes: wasmtime, wasmer, wavm, wasm3
2022-01-01 21:40:22 -05:00
f096312a46 Merge pull request #640 from thewtex/wasi-sdk-14
wasi sdk 14
2021-11-25 21:43:42 -05:00
94b0730c49 web-wasm: Update Emscripten to 3.0.0 2021-11-25 09:02:41 -05:00
bca37cd589 web-wasi: Update wasi-sdk to 14.0 2021-11-25 08:52:58 -05:00
79e99402c2 Merge pull request #637 from thewtex/emscripten-2.0.34
web-wasm: Bump Emscripten to 2.0.34
2021-11-08 19:43:47 +01:00
16b60946a0 Change env variable EMSCRIPTEN_VERSION to 2.0.34
Change env variable EMSCRIPTEN_VERSION to 2.0.34
2021-11-08 16:22:24 +01:00
0aa303003f web-wasm: Bump Emscripten to 2.0.34 2021-11-07 18:08:36 -05:00
310496590c Merge pull request #635 from bensuperpc/update_readme2 2021-11-04 08:18:01 -04:00
da9b0a0afd Merge pull request #633 from sabelka/add-osslsigncode 2021-11-04 08:17:19 -04:00
c2b200951d Merge pull request #636 from thewtex/wasmtime 2021-11-04 08:16:22 -04:00
ed2c1eb321 web-wasi: Use wasmtime instead of wasmer for the cross-compiling emulator
wasmtime is the official reference implementation and wasmer has
permission issues without sudo.
2021-11-03 19:28:11 -04:00
4dcd7eeec1 Update build example in readme
Update build example in readme

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-11-03 20:54:39 +01:00
3559ec8f5c Update Dockerfile.in 2021-11-03 20:17:07 +01:00
fceb7a8a6b Update common.debian 2021-11-03 20:15:08 +01:00
b41256cc2f add osslsigncode tool for Windows
Code-signing of generated executables is usually done with "signtool" on
Windows. When cross-compiling on Linux this tool is not avaiilable,
however, osslsigncode can be used as an replacement.
2021-11-03 16:15:24 +01:00
ea4d106ed8 Merge pull request #632 from thewtex/sudo-wrapper-bash
imagefiles: gosu sudo wrapper requires bash
2021-11-02 21:14:37 -04:00
9098b1a478 imagefiles: gosu sudo wrapper requires bash
Addresses:

  /usr/local/bin/sudo: 5: 2: not found

that occurs during sudo execution.
2021-10-31 21:31:40 -04:00
cb7421fc79 Merge pull request #631 from bensuperpc/add_tbb
Add tbb
2021-10-26 09:40:43 -04:00
77e7761286 Update Dockerfile.in 2021-10-25 00:09:39 +02:00
9f3cbd5a17 Add tbb
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-10-24 19:29:02 +02:00
e607d1252b Merge pull request #630 from bensuperpc/update_windows_image 2021-10-20 14:11:23 -04:00
b50710ea8f Merge pull request #629 from bensuperpc/update_readme
Update readme
2021-10-20 16:55:57 +02:00
e1a1191559 Update readme
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-10-19 14:30:16 +02:00
ed5ecc293e Update text
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-10-18 10:52:20 +02:00
6d00aa95f5 Update text
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-10-18 10:51:55 +02:00
c06be541ac Bold some words
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-10-18 10:49:04 +02:00
0f9beb211c Update readme
move image list

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-10-18 10:46:38 +02:00
15 changed files with 112 additions and 25 deletions

3
.gitignore vendored
View File

@ -1,5 +1,8 @@
bin
dockcross
dockcross-*
build
build-*
*/test/
Dockerfile
web-wasm/Dockerfile

View File

@ -44,7 +44,8 @@ NON_STANDARD_IMAGES = manylinux2014-x64 manylinux2014-x86 \
# Docker composite files
DOCKER_COMPOSITE_SOURCES = common.docker common.debian common.manylinux common.buildroot \
common.crosstool common.windows common-manylinux.crosstool common.dockcross common.label-and-env
common.crosstool common.webassembly common.windows common-manylinux.crosstool common.dockcross \
common.label-and-env
DOCKER_COMPOSITE_FOLDER_PATH = common/
DOCKER_COMPOSITE_PATH = $(addprefix $(DOCKER_COMPOSITE_FOLDER_PATH),$(DOCKER_COMPOSITE_SOURCES))
@ -98,6 +99,7 @@ $(GEN_IMAGE_DOCKERFILES) Dockerfile: %Dockerfile: %Dockerfile.in $(DOCKER_COMPOS
-e '/common.crosstool/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.crosstool' \
-e '/common.buildroot/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.buildroot' \
-e '/common-manylinux.crosstool/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common-manylinux.crosstool' \
-e '/common.webassembly/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.webassembly' \
-e '/common.windows/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.windows' \
-e '/common.dockcross/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.dockcross' \
-e '/common.label-and-env/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.label-and-env' \

View File

@ -56,7 +56,8 @@ Only 64-bit x86_64 images are provided, a 64-bit x86_64 host system is required.
For the impatient, here\'s how to compile a hello world for armv7:
```bash
cd ~/src/dockcross
git clone https://github.com/dockcross/dockcross.git
cd dockcross
docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7
chmod +x ./dockcross-linux-armv7
./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm'
@ -117,6 +118,17 @@ The dockcross script will execute the given command-line inside the container, a
| dockcross/windows-armv7 | ARMv7 | Clang | Windows |
| dockcross/windows-arm64 | ARMv8 | Clang | Windows |
The list of docker images that are **no longer maintained**.
| Image name | Target arch | Compiler | Target OS |
|:-------:|:--------:|:------:|:-----:|
| dockcross/manylinux1-x86 | x86 | GCC | manylinux |
| dockcross/manylinux1-x64 | x86_64 | GCC| manylinux |
| dockcross/manylinux2010-x86 | x86 | GCC | manylinux |
| dockcross/manylinux2010-x64 | x86_64 | GCC | manylinux |
| dockcross/linux-mipsel | mipsel | GCC 4.9 | Debian 8 |
## Cross compilers
### dockcross/base
@ -381,17 +393,6 @@ ARMv7 32-bit Windows cross-compiler based on [LLVM/MinGW-w64](https://github.com
ARMv8 64-bit Windows cross-compiler based on [llvm-mingw](https://github.com/mstorsjo/llvm-mingw)
## Summary legacy cross compilers
The list of docker images that are no longer supported or broken
| Image name | Target arch | Compiler | Target OS |
|:-------:|:--------:|:------:|:-----:|
| dockcross/manylinux1-x86 | x86 | GCC | manylinux |
| dockcross/manylinux1-x64 | x86_64 | GCC| manylinux |
| dockcross/manylinux2010-x86 | x86 | GCC | manylinux |
| dockcross/manylinux2010-x64 | x86_64 | GCC | manylinux |
## Articles
- [dockcross: C++ Write Once, Run

View File

@ -18,6 +18,7 @@ RUN \
gettext \
gzip \
gnupg \
osslsigncode \
initramfs-tools \
libncurses5 \
libtool \

68
common/common.webassembly Normal file
View File

@ -0,0 +1,68 @@
# common.webassembly
#
# Common WebAssembly tools.
# main 2021-12-31
ENV BINARYEN_GIT_TAG 6137b338c7fb37ba98b63c31225ec9cfda8cfa59
RUN git clone https://github.com/WebAssembly/binaryen.git && \
cd binaryen && \
git checkout ${BINARYEN_GIT_TAG} && \
cd ../ && \
mkdir binaryen-build && \
cd binaryen-build && \
/usr/bin/cmake \
-DCMAKE_C_COMPILER=/usr/bin/cc \
-DCMAKE_CXX_COMPILER=/usr/bin/c++ \
-G Ninja \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_TOOLCHAIN_FILE="" \
../binaryen && \
ninja && \
ninja install && \
cd ../ && \
rm -rf binaryen*
# main 2021-12-31
ENV WABT_GIT_TAG a4366956e877c404d328358b2c00320b476763c0
RUN git clone --recurse-submodules https://github.com/WebAssembly/wabt.git && \
cd wabt && \
git checkout ${WABT_GIT_TAG} && \
cd ../ && \
mkdir wabt-build && \
cd wabt-build && \
/usr/bin/cmake \
-DCMAKE_C_COMPILER=/usr/bin/cc \
-DCMAKE_CXX_COMPILER=/usr/bin/c++ \
-G Ninja \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_TOOLCHAIN_FILE="" \
../wabt && \
ninja && \
ninja install && \
cd ../ && \
rm -rf wabt*
RUN mkdir /wasi-runtimes
ENV WASMTIME_HOME /wasi-runtimes/wasmtime
RUN mkdir ${WASMTIME_HOME} && curl https://wasmtime.dev/install.sh -sSf | bash
COPY imagefiles/wasmtime-pwd.sh ${WASMTIME_HOME}/bin/
ENV PATH "$WASMTIME_HOME/bin:$PATH"
ENV WASMER_DIR /wasi-runtimes/wasmer
RUN curl https://get.wasmer.io -sSfL | sh
COPY imagefiles/wasmer-pwd.sh ${WASMER_DIR}/bin/
ENV PATH "$WASMER_DIR/bin:$PATH"
ENV WASM3_VERSION 0.5.0
RUN mkdir -p /wasi-runtimes/wasm3/bin && \
curl -LO https://github.com/wasm3/wasm3/releases/download/v${WASM3_VERSION}/wasm3-linux-x64.elf && \
mv wasm3-linux-x64.elf /wasi-runtimes/wasm3/bin/wasm3 && \
chmod +x /wasi-runtimes/wasm3/bin/wasm3
ENV PATH "/wasi-runtimes/wasm3/bin:$PATH"
ENV WAVM_VERSION 2021-12-15
RUN mkdir -p /wasi-runtimes/wavm/ && \
curl -LO https://github.com/WAVM/WAVM/releases/download/nightly%2F${WAVM_VERSION}/wavm-0.0.0-prerelease-linux.tar.gz && \
tar -xv -C /wasi-runtimes/wavm/ -f wavm-0.0.0-prerelease-linux.tar.gz
ENV PATH "/wasi-runtimes/wavm/bin:$PATH"

View File

@ -56,6 +56,7 @@ RUN \
make \
nsis \
openssl \
osslsigncode \
p7zip-full \
patch \
perl \

View File

@ -16,7 +16,7 @@ gosu nobody true
# is created in /usr/local/bin
cat << EOF >> /usr/local/bin/sudo
#!/bin/sh
#!/bin/bash
# Emulate the sudo command
SUDO_USER=root
SUDO_GROUP=root

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Mount the PWD to enable access in try_run commands
exec /usr/local/wasmer/bin/wasmer run --dir=. --dir=$PWD "$@"
exec ${WASMER_DIR}/bin/wasmer run --dir=. --dir=$PWD "$@"

4
imagefiles/wasmtime-pwd.sh Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Mount the PWD to enable access in try_run commands
exec ${WASMTIME_HOME}/bin/wasmtime run --dir=. --dir=$PWD "$@"

View File

@ -7,6 +7,11 @@ LABEL maintainer="Matt McCormick matt.mccormick@kitware.com"
ARG REPO_URL=https://repo.or.cz/tinycc.git
ENV REPO_URL=${REPO_URL}
RUN apt-get update && \
apt-get -y install \
libtbb-dev \
&& apt-get clean --yes
# Disable options: --with-libgcc --disable-static
RUN git clone --recurse-submodules --remote-submodules ${REPO_URL} \
&& cd tinycc \

View File

@ -6,6 +6,7 @@ RUN apt-get update && \
apt-get -y install \
libelf-dev \
libssl-dev \
libtbb-dev \
&& apt-get clean --yes
ENV CROSS_TRIPLE x86_64-linux-gnu

View File

@ -7,6 +7,7 @@ RUN dpkg --add-architecture i386 && \
gcc-multilib \
g++-multilib \
libc6:i386 \
libtbb-dev:i386 \
libstdc++6:i386 \
libbz2-dev:i386 \
libexpat1-dev:i386 \

View File

@ -2,12 +2,7 @@ FROM dockcross/base:latest
LABEL maintainer="Matt McCormick matt.mccormick@kitware.com"
# The cross-compiling emulator
ENV WASMER_DIR /usr/local/wasmer
RUN curl https://get.wasmer.io -sSfL | sh
ENV PATH /usr/local/wasmer/bin:${PATH}
ENV WASI_VERSION 12
ENV WASI_VERSION 14
ENV WASI_VERSION_FULL ${WASI_VERSION}.0
RUN cd /usr/ && \
curl -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \
@ -16,7 +11,7 @@ RUN cd /usr/ && \
ENV WASI_SDK_PATH /usr/wasi-sdk-${WASI_VERSION_FULL}
ENV WASI_SYSROOT ${WASI_SDK_PATH}/share/wasi-sysroot
COPY clang-wasi-sysroot.sh clang++-wasi-sysroot.sh wasmer-pwd.sh /usr/local/bin/
COPY clang-wasi-sysroot.sh clang++-wasi-sysroot.sh /usr/local/bin/
ENV CROSS_TRIPLE=wasm32-wasi
ENV CROSS_ROOT=${WASI_SDK_PATH}
@ -26,6 +21,8 @@ ENV AR=${CROSS_ROOT}/bin/llvm-ar \
CXX=clang++-wasi-sysroot.sh \
LD=${CROSS_ROOT}/bin/wasm-ld
#include "common.webassembly"
COPY WASI.cmake /usr/src/
RUN mv /usr/src/WASI.cmake /usr/share/cmake-*/Modules/Platform/
COPY Toolchain.cmake ${CROSS_ROOT}/

View File

@ -7,4 +7,4 @@ set(CMAKE_SYSROOT $ENV{WASI_SYSROOT})
set(CMAKE_C_COMPILER /usr/local/bin/clang-wasi-sysroot.sh)
set(CMAKE_CXX_COMPILER /usr/local/bin/clang++-wasi-sysroot.sh)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/local/bin/wasmer-pwd.sh)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/local/bin/wasmtime-pwd.sh)

View File

@ -1,4 +1,4 @@
FROM emscripten/emsdk:2.0.31
FROM emscripten/emsdk:3.1.0
LABEL maintainer="Matt McCormick matt.mccormick@kitware.com"
@ -33,6 +33,7 @@ RUN \
libtool \
python3 \
python3-pip \
osslsigncode \
rsync \
sed \
ssh \
@ -53,7 +54,9 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
#include "common.docker"
ENV EMSCRIPTEN_VERSION 2.0.31
#include "common.webassembly"
ENV EMSCRIPTEN_VERSION 3.1.0
ENV PATH /emsdk:/emsdk/upstream/bin/:/emsdk/upstream/emscripten:${PATH}
ENV CC=/emsdk/upstream/emscripten/emcc \