Skip to content

Commit

Permalink
ci: Support Linux on SystemZ
Browse files Browse the repository at this point in the history
  • Loading branch information
slavek-kucera authored Jul 26, 2024
1 parent bc04cd9 commit 4a19fe4
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,28 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: ./scripts/toolchain.linux_arm64.sh

s390x-linux-musl:
name: Build Linux S390X toolchain
runs-on: ubuntu-24.04
container: alpine:3.19
steps:
- uses: actions/checkout@v4
- name: Install TAR
run: apk add tar
- uses: actions/cache@v4
id: cache
with:
path: toolchain.tar.gz
key: ${{ hashFiles('scripts/toolchain.linux_s390x.sh') }}
lookup-only: true
- name: Build image
if: steps.cache.outputs.cache-hit != 'true'
run: ./scripts/toolchain.linux_s390x.sh

build-matrix:
name: Build
runs-on: ${{ matrix.os }}
needs: [generate_grammar, aarch64-linux-musl]
needs: [generate_grammar, aarch64-linux-musl, s390x-linux-musl]
strategy:
matrix:
include:
Expand All @@ -202,6 +220,11 @@ jobs:
container: alpine:3.19
dbg-strip: aarch64-linux-musl-objcopy --only-keep-debug hlasm_language_server hlasm_language_server.dbg && aarch64-linux-musl-objcopy --strip-unneeded hlasm_language_server && aarch64-linux-musl-objcopy --add-gnu-debuglink=hlasm_language_server.dbg hlasm_language_server
dbg-pattern: build/bin/hlasm_language_server.dbg
- os: ubuntu-24.04
native: linux_s390x
container: alpine:3.19
dbg-strip: s390x-linux-musl-objcopy --only-keep-debug hlasm_language_server hlasm_language_server.dbg && s390x-linux-musl-objcopy --strip-unneeded hlasm_language_server && s390x-linux-musl-objcopy --add-gnu-debuglink=hlasm_language_server.dbg hlasm_language_server
dbg-pattern: build/bin/hlasm_language_server.dbg
- os: ubuntu-24.04
native: wasm
container: emscripten/emsdk:3.1.59
Expand Down Expand Up @@ -300,6 +323,9 @@ jobs:
- os: ubuntu-24.04
native: linux_arm64
chmod: true
- os: ubuntu-24.04
native: linux_s390x
chmod: true
- os: windows-2022
native: win32_x64
chmod: false
Expand Down Expand Up @@ -408,6 +434,11 @@ jobs:
with:
name: hlasm_language_server_linux_arm64
path: ${{ env.CLIENT_DIR }}/bin/linux_arm64/
- name: Download linux language server (s390x)
uses: actions/download-artifact@v4
with:
name: hlasm_language_server_linux_s390x
path: ${{ env.CLIENT_DIR }}/bin/linux_s390x/
- name: Download MacOS language server (x64)
uses: actions/download-artifact@v4
with:
Expand All @@ -433,6 +464,7 @@ jobs:
chmod +x ${{ env.CLIENT_DIR }}/bin/darwin_arm64/hlasm_language_server
chmod +x ${{ env.CLIENT_DIR }}/bin/linux_x64/hlasm_language_server
chmod +x ${{ env.CLIENT_DIR }}/bin/linux_arm64/hlasm_language_server
chmod +x ${{ env.CLIENT_DIR }}/bin/linux_s390x/hlasm_language_server
- name: NPM CI
run: npm ci
working-directory: ${{ env.CLIENT_DIR }}
Expand Down Expand Up @@ -495,6 +527,11 @@ jobs:
with:
name: hlasm_language_server_linux_arm64
path: ${{ env.CLIENT_DIR }}/bin/linux_arm64/
- name: Download linux language server (s390x)
uses: actions/download-artifact@v4
with:
name: hlasm_language_server_linux_s390x
path: ${{ env.CLIENT_DIR }}/bin/linux_s390x/
- name: Download MacOS language server (x64)
uses: actions/download-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions clients/vscode-hlasmplugin/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ function getGitHubPublisherPlugin() {
'label': 'hlasm-language-support-linux-arm64-${nextRelease.version}',
'name': 'hlasm-language-support-linux-arm64-${nextRelease.version}'
},
{
'path': 'bin/linux_s390x/hlasm_language_server',
'label': 'hlasm-language-support-linux-s390x-${nextRelease.version}',
'name': 'hlasm-language-support-linux-s390x-${nextRelease.version}'
},
{
'path': 'bin/darwin_x64/hlasm_language_server',
'label': 'hlasm-language-support-darwin-x64-${nextRelease.version}',
Expand Down
1 change: 1 addition & 0 deletions clients/vscode-hlasmplugin/src/serverFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const supportedNativePlatforms: Readonly<{ [key: string]: string }> = Object.fre
'win32.arm64': 'win32_arm64',
'linux.x64': 'linux_x64',
'linux.arm64': 'linux_arm64',
'linux.s390x': 'linux_s390x',
'darwin.x64': 'darwin_x64',
'darwin.arm64': 'darwin_arm64',
});
Expand Down
3 changes: 3 additions & 0 deletions scripts/config.linux_s390x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
set -e
cmake -G Ninja -DCMAKE_VERIFY_HEADER_SETS=On -DCMAKE_SYSTEM_NAME="Linux" -DCMAKE_C_COMPILER="s390x-linux-musl-gcc" -DCMAKE_CXX_COMPILER="s390x-linux-musl-g++" -DCMAKE_BUILD_TYPE=Release -DDISCOVER_TESTS=Off -DCMAKE_EXE_LINKER_FLAGS="-static -Wl,--gc-sections" -DBUILD_VSIX=Off -DUSE_PRE_GENERATED_GRAMMAR="generated_parser" ../
3 changes: 3 additions & 0 deletions scripts/prereq.linux_s390x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
set -e
apk update && apk add --no-cache git cmake ninja qemu-s390x tar
3 changes: 3 additions & 0 deletions scripts/test-runner.linux_s390x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
set -e
qemu-s390x $1
36 changes: 36 additions & 0 deletions scripts/toolchain.linux_s390x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env sh

set -e

apk update
apk add git curl g++ bison make patch tar xz

mkdir /toolchain

git clone https://github.com/richfelker/musl-cross-make.git

cd musl-cross-make

git checkout -f e149c31c48b4f4a4c9349ddf7bc0027b90245afc

echo "TARGET = s390x-linux-musl" >> config.mak
echo "OUTPUT = /toolchain/" >> config.mak
echo "BINUTILS_VER = 2.41" >> config.mak
echo "GCC_VER = 14.1.0" >> config.mak
echo "DL_CMD = curl -C - -L -o" >> config.mak
echo "COMMON_CONFIG += CFLAGS=\"-fdata-sections -ffunction-sections -O2 -g0\" CXXFLAGS=\"-fdata-sections -ffunction-sections -O2 -g0\"" >> config.mak
echo "BINUTILS_CONFIG = --enable-gprofng=no" >> config.mak

echo "0aec8d432b8473559942a45c12459a5db3a04618 *gcc-14.1.0.tar.xz" > hashes/gcc-14.1.0.tar.xz.sha1
echo "0e008260a958bbd10182ee3384672ae0a310eece *binutils-2.41.tar.xz" > hashes/binutils-2.41.tar.xz.sha1

mkdir patches/gcc-14.1.0
cp patches/gcc-11.2.0/0002-posix_memalign.diff patches/gcc-14.1.0/

make -j 8
make install

cd ..

tar czvf toolchain.tar.gz /toolchain

0 comments on commit 4a19fe4

Please sign in to comment.