Skip to content

Commit

Permalink
Merge branch 'main' into wat2wasmGC
Browse files Browse the repository at this point in the history
  • Loading branch information
Guo-yyds authored Feb 15, 2024
2 parents 0a8f724 + 1471dff commit a4ff263
Show file tree
Hide file tree
Showing 16 changed files with 861 additions and 95 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,50 @@ jobs:
- run: make clang-debug
- name: tests (wasm2c tests excluding memory64)
run: ./test/run-tests.py wasm2c --exclude-dir memory64

build-cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [s390x]
services: # still faster on debian...
distcc:
image: debian:latest
options: --health-cmd distccmon-text --health-interval 5s --health-start-period 5m debian:latest bash -c "apt-get update && apt-get install -y g++-s390x-linux-gnu distcc && distccd --daemon --no-detach"
ports:
- 3632:3632
env:
QEMU_LD_PREFIX: /usr/${{matrix.arch}}-linux-gnu/
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v1
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: ${{matrix.arch}}
image: "tonistiigi/binfmt:master"
- name: install ninja
run: sudo apt-get install ninja-build
- name: install the toolchain
run: sudo apt-get install g++-${{matrix.arch}}-linux-gnu
- name: install distcc
run: sudo apt-get install distcc
- name: mkdir distcc symlinks
run: sudo mkdir -p /opt/bin/distcc_symlinks
- name: distcc symlink
run: sudo ln -s /usr/bin/distcc /opt/bin/distcc_symlinks/${{matrix.arch}}-linux-gnu-gcc # only CC is needed
- name: cmake
run: cmake -S . -B out -G Ninja -DCMAKE_TOOLCHAIN_FILE=../scripts/TC-${{matrix.arch}}.cmake -DWITH_WASI=ON -DWERROR=OFF -Werror=dev -Wno-deprecated
- name: build
run: cmake --build out
- name: check if generated files are up-to-date
run: python ./scripts/check_clean.py
- name: unittests
run: cmake --build out --target run-unittests
- name: tests
run: cmake --build out --target run-tests
11 changes: 11 additions & 0 deletions scripts/TC-s390x.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(CMAKE_SYSTEM_NAME Linux)

set(CMAKE_C_COMPILER /opt/bin/distcc_symlinks/s390x-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER s390x-linux-gnu-g++)

set(CMAKE_FIND_ROOT_PATH /usr/s390x-linux-gnu)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
13 changes: 12 additions & 1 deletion scripts/clang-format-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@ set -o pipefail

if [ -n "$1" ]; then
BRANCH="$1"
elif [ "$CI" != "true" ]; then
echo "Please specify a base branch in the command line"
exit 1
elif [ -n "$GITHUB_EVENT_BEFORE" ] && [ "push" = "$GITHUB_EVENT_NAME" ]; then
BRANCH="$GITHUB_EVENT_BEFORE"
elif [ -n "$GITHUB_BASE_REF" ]; then
BRANCH="origin/$GITHUB_BASE_REF"
else
elif git symbolic-ref -q HEAD; then # check if we're in a branch
BRANCH="@{upstream}"
else
# in a detached HEAD.
# default to origin/main, this is a "last resort" to make this script do the
# right thing, and is only really here so it works when pushing a new branch,
# with the caveat that it assumes the base branch to be called "main".
# (this has been the case with wabt for a while. may fail if the repo lacks a
# "main" branch for some reason.)
BRANCH="origin/main"
fi

MERGE_BASE=$(git merge-base $BRANCH HEAD)
Expand Down
Loading

0 comments on commit a4ff263

Please sign in to comment.