Skip to content

Commit 708a4b4

Browse files
feat: add docker image and sysroot for s390x (#24)
1 parent 671f90a commit 708a4b4

File tree

5 files changed

+1023
-0
lines changed

5 files changed

+1023
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- focal-devtoolset-ppc64le
2525
- focal-devtoolset-riscv64
2626
- trixie-devtoolset-loong64
27+
- focal-devtoolset-s390x
2728

2829
steps:
2930
- uses: actions/checkout@v3

.github/workflows/sysroot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
arch: 'ppc64el'
1717
pkg: 'powerpc64le-linux-gnu'
1818
suffix: '-glibc-2.28'
19+
- config: 's390x-gcc-10.5.0-glibc-2.28.config'
20+
arch: 's390x'
21+
pkg: 's390x-linux-gnu'
22+
suffix: '-glibc-2.28'
1923
steps:
2024
- uses: actions/checkout@v3
2125

focal-devtoolset-s390x/Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
2+
ARG TAG=20.04
3+
FROM ${REPO}:${TAG}
4+
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
ARG NODE_VERSION="16.20.2"
7+
8+
# ubuntu keeps its i386/amd64 and other architecture repos separate
9+
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
10+
# add the required repos for s390x and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support)
11+
RUN sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
12+
RUN echo "deb [arch=s390x] http://ports.ubuntu.com/ focal main universe multiverse restricted" | tee -a /etc/apt/sources.list
13+
RUN echo "deb [arch=s390x] http://ports.ubuntu.com/ focal-security main universe multiverse restricted" | tee -a /etc/apt/sources.list
14+
RUN echo "deb [arch=s390x] http://ports.ubuntu.com/ focal-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list
15+
RUN dpkg --add-architecture s390x
16+
RUN apt-get update && apt-get install -y --no-install-recommends \
17+
gcc-10-s390x-linux-gnu \
18+
g++-10-s390x-linux-gnu \
19+
binutils-s390x-linux-gnu \
20+
build-essential \
21+
git \
22+
pkg-config \
23+
fakeroot \
24+
rpm \
25+
sudo \
26+
apt-transport-https \
27+
ca-certificates \
28+
libx11-dev:s390x \
29+
libx11-xcb-dev:s390x \
30+
libxkbfile-dev:s390x \
31+
libsecret-1-dev:s390x \
32+
libkrb5-dev:s390x \
33+
libatomic1:s390x \
34+
curl \
35+
gnupg \
36+
unzip \
37+
# VSCodium
38+
jq
39+
40+
# Set python3 as default
41+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
42+
RUN python --version
43+
44+
# Setup Node.js
45+
RUN curl -L -O https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-s390x.tar.gz && \
46+
tar -xzf node-v${NODE_VERSION}-linux-s390x.tar.gz && \
47+
cp -R node-v${NODE_VERSION}-linux-s390x/* /usr/local/ && \
48+
rm -rf node-v${NODE_VERSION}-linux-s390x* && \
49+
node --version
50+
51+
# install yarn & node-gyp
52+
RUN npm install -g yarn node-gyp
53+
54+
# Set gcc-10 as default
55+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/s390x-linux-gnu-gcc-10 10
56+
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/s390x-linux-gnu-g++-10 10
57+
58+
# Check compiler toolchain
59+
RUN gcc --version
60+
RUN g++ --version
61+
62+
RUN mkdir -p /root/vscode
63+
WORKDIR /root/vscode
64+
65+
ENV AS=/usr/bin/s390x-linux-gnu-as \
66+
AR=/usr/bin/s390x-linux-gnu-ar \
67+
CC=/usr/bin/s390x-linux-gnu-gcc-10 \
68+
CPP=/usr/bin/s390x-linux-gnu-cpp-10 \
69+
CXX=/usr/bin/s390x-linux-gnu-g++-10 \
70+
LD=/usr/bin/s390x-linux-gnu-ld \
71+
PKG_CONFIG_PATH=/usr/lib/s390x-linux-gnu/pkgconfig

0 commit comments

Comments
 (0)