Skip to content

Commit b1f7ba4

Browse files
committed
build: Add s390x cross build target
Add s390x arch to the cross builds so that we have a big endian target. Signed-off-by: Daniel Wagner <[email protected]>
1 parent e4f80bc commit b1f7ba4

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/cross/ubuntu-s390x.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[binaries]
2+
c = '/usr/bin/s390x-linux-gnu-gcc'
3+
ar = '/usr/s390x-linux-gnu/bin/ar'
4+
strip = '/usr/s390x-linux-gnu/bin/strip'
5+
pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'
6+
ld = '/usr/bin/s390x-linux-gnu-ld'
7+
exe_wrapper = '/usr/bin/qemu-s390x-static'
8+
9+
[properties]
10+
root = '/usr/s390x-linux-gnu'
11+
has_function_printf = true
12+
skip_sanity_check = true
13+
14+
[host_machine]
15+
system = 'linux'
16+
cpu_family = 's390x'
17+
cpu = ''
18+
endian = 'big'

.github/workflows/meson.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,36 @@ jobs:
9090
name: Linux_Meson_Testlog
9191
path: build/meson-logs/testlog.txt
9292

93+
build-cross-s390x:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: set up s390x architecture
97+
run: |
98+
export release=$(lsb_release -c -s)
99+
sudo dpkg --add-architecture s390x
100+
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
101+
sudo dd of=/etc/apt/sources.list.d/s390x.list <<EOF
102+
deb [arch=s390x] http://ports.ubuntu.com/ $release main universe restricted"
103+
deb [arch=s390x] http://ports.ubuntu.com/ $release-updates main universe restricted"
104+
EOF
105+
sudo apt update
106+
- name: install s390x compiler
107+
run: sudo apt install gcc-s390x-linux-gnu pkg-config qemu-user-static
108+
- name: install libraries
109+
run: sudo apt install libjson-c-dev:s390x
110+
- uses: actions/checkout@v3
111+
- uses: BSFishy/[email protected]
112+
with:
113+
# suppress python for now; the python headers currently assume native
114+
setup-options: --werror --cross-file=.github/cross/ubuntu-s390x.txt --wrap-mode=nofallback -Dpython=false
115+
options: --verbose
116+
action: test
117+
- uses: actions/upload-artifact@v3
118+
if: failure()
119+
with:
120+
name: Linux_Meson_Testlog
121+
path: build/meson-logs/testlog.txt
122+
93123
build-fallback:
94124
runs-on: ubuntu-latest
95125
steps:

0 commit comments

Comments
 (0)