From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: IGT development <igt-dev@lists.freedesktop.org>
Cc: Dylan Baker <dylan@pnwbakers.com>, Sean Paul <sean@poorly.run>
Subject: [igt-dev] [PATCH i-g-t 4/4] gitlab-ci: arm64 cross compiling
Date: Mon, 29 Oct 2018 09:10:30 +0100 [thread overview]
Message-ID: <20181029081030.4041-4-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20181029081030.4041-1-daniel.vetter@ffwll.ch>
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 script doesn't know about the
exe wrapper and hence fails miserably. I discussed this a bit with
Dylan and he filed an upstream meson issue:
https://github.com/mesonbuild/meson/issues/4427#issuecomment-433553689
Another option would be to use binfmt-misc handling (which works
neatly locally), but on the runners we have I can't control that.
Maybe I can beg Daniel Stone ...
For not let's just mark this stage as optional and that failures are
allowed.
Cc: Sean Paul <sean@poorly.run>
Cc: Eric Anholt <eric@anholt.net>
Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
.gitlab-ci.yml | 31 +++++++++++++++++++++++++++
Dockerfile.debian-arm64 | 46 +++++++++++++++++++++++++++++++++++++++++
meson-cross-arm64.txt | 12 +++++++++++
3 files changed, 89 insertions(+)
create mode 100644 Dockerfile.debian-arm64
create mode 100644 meson-cross-arm64.txt
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2e04c0e84e1b..75e72998e596 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
@@ -115,6 +132,20 @@ 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
+ when: manual
+ image: docker:stable
+ 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
when: manual
diff --git a/Dockerfile.debian-arm64 b/Dockerfile.debian-arm64
new file mode 100644
index 000000000000..20c2e8b30663
--- /dev/null
+++ b/Dockerfile.debian-arm64
@@ -0,0 +1,46 @@
+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
diff --git a/meson-cross-arm64.txt b/meson-cross-arm64.txt
new file mode 100644
index 000000000000..d96f180e2b05
--- /dev/null
+++ b/meson-cross-arm64.txt
@@ -0,0 +1,12 @@
+[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'
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-10-29 8:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 8:10 [igt-dev] [PATCH i-g-t 1/4] lib: Make libunwind optional again Daniel Vetter
2018-10-29 8:10 ` [igt-dev] [PATCH i-g-t 2/4] gitlab-ci: build test libunwind stubs Daniel Vetter
2018-10-29 8:10 ` [igt-dev] [PATCH i-g-t 3/4] gitlab-ci: Build docs by default Daniel Vetter
2018-10-29 8:10 ` Daniel Vetter [this message]
2018-10-29 8:39 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] lib: Make libunwind optional again Patchwork
2018-10-29 9:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-10-29 10:20 ` [igt-dev] [PATCH i-g-t 1/4] " Petri Latvala
2018-10-29 15:35 ` Daniel Vetter
2018-10-29 15:41 ` Eric Anholt
2018-10-29 15:55 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-10-29 17:15 ` Daniel Vetter
2018-10-29 17:20 ` Daniel Vetter
2018-10-29 18:37 ` Sean Paul
2018-10-29 19:06 ` Daniel Vetter
2018-10-30 10:28 ` Petri Latvala
2018-10-30 2:24 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t] lib: Make libunwind optional again (rev5) Patchwork
2018-10-30 12:54 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2018-10-30 17:38 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-10-30 12:22 [igt-dev] [PATCH i-g-t 1/4] lib: Make libunwind optional again Daniel Vetter
2018-10-30 12:22 ` [igt-dev] [PATCH i-g-t 4/4] gitlab-ci: arm64 cross compiling Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181029081030.4041-4-daniel.vetter@ffwll.ch \
--to=daniel.vetter@ffwll.ch \
--cc=dylan@pnwbakers.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox