Skip to content
Snippets Groups Projects
Commit f882a542 authored by Simona Vetter's avatar Simona Vetter
Browse files

gitlab-ci: arm64 cross compiling

First I tried to build in a full sysroot, but I didn't figure out why
ld never found the libraries (this was on fedora, which might have
been part of the problem - if you just need a toolchain for kernel
corss-building fedora is perfectly fine).

Then I tried using debian's multiarch stuff, which worked a lot
better, except there's some minor gotchas:
- some libraries conflict and can't be multi-arch installed
- some libraries are buggy and cause conflicts when installing
- pkgconfig and ld get confused with some other libraries and pick the
  first one they find (i.e. the x86_64 one, not the arm64 one).
That means we need a new docker image with just the cross libaries
installed as -dev packages, and none of the native ones.

Next up I tried to run the tests. Meson has really nice support for an
exe wrapper, and qemu happily runs arm64 on x86_64. With that I
managed to run some tests successfully (it's not even that slow!). But
most are run through a script, and the scrip...
parent 445c2051
No related merge requests found
Pipeline #7196 canceled
......@@ -57,6 +57,15 @@ build:tests-debian-meson:
paths:
- meson-test-list.txt
build:tests-debian-meson-arm64:
image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64:latest
stage: build
script:
- PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/ meson --cross-file meson-cross-arm64.txt build
- ninja -C build
artifacts:
paths:
- build
build:tests-debian-autotools:
image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian:latest
......@@ -77,6 +86,14 @@ test:ninja-test:
stage: test
script: ninja -C build test
test:ninja-test-arm64:
when: manual
image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64:latest
dependencies:
- build:tests-debian-meson-arm64
stage: test
script: ninja -C build test
test:test-list-diff:
dependencies:
- build:tests-debian-autotools
......@@ -117,6 +134,22 @@ containers:igt-debian:
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian -f Dockerfile.debian .
- docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian
containers:igt-debian-arm64:
stage: containers
image: docker:stable
only:
changes:
- Dockerfile.debian-arm64
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64 -f Dockerfile.debian-arm64 .
- docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64
containers:igt-fedora:
stage: containers
image: docker:stable
......
FROM debian:stretch-backports
RUN apt-get update
RUN apt-get install -y \
flex \
bison \
pkg-config \
x11proto-dri2-dev \
python-docutils \
valgrind \
peg
RUN dpkg --add-architecture arm64
RUN apt-get update
RUN apt-get install -y \
gcc-aarch64-linux-gnu \
libpciaccess-dev:arm64 \
libkmod-dev:arm64 \
libprocps-dev:arm64 \
libunwind-dev:arm64 \
libdw-dev:arm64 \
zlib1g-dev:arm64 \
liblzma-dev:arm64 \
libssl-dev:arm64 \
libcairo-dev:arm64 \
libpixman-1-dev:arm64 \
libudev-dev:arm64 \
libgsl-dev:arm64 \
libasound2-dev:arm64 \
libjson-c-dev:arm64 \
libcurl4-openssl-dev:arm64 \
libxrandr-dev:arm64 \
libxv-dev:arm64
RUN apt-get install -t stretch-backports -y \
meson \
libdrm-dev:arm64 \
qemu-user
# autotools build deps
RUN apt-get install -y \
autoconf \
automake \
xutils-dev \
libtool \
make
[binaries]
c = '/usr/bin/aarch64-linux-gnu-gcc'
ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'
strip = '/usr/bin/aarch64-linux-gnu-strip'
pkgconfig = 'pkg-config'
exe_wrapper = 'qemu-aarch64'
[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment