[08/10] travis: Add armv7-cross as cross-compile test

Submitted by Dmitry Safonov on Nov. 21, 2019, 9:56 p.m.

Details

Message ID 20191121215643.275552-9-dima@arista.com
State Accepted
Series "build: Test and support armv7 cross"
Commit 960691b1f4d7b557aea54e302de16b9df0986314
Headers show

Commit Message

Dmitry Safonov Nov. 21, 2019, 9:56 p.m.
Fixes: #455
Based-on-patch-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 .travis.yml                          |  4 +++
 scripts/build/Dockerfile.armv7-cross | 44 ++++++++++++++++++++++++++++
 scripts/build/Makefile               |  1 +
 3 files changed, 49 insertions(+)
 create mode 100644 scripts/build/Dockerfile.armv7-cross

Patch hide | download patch | download mbox

diff --git a/.travis.yml b/.travis.yml
index f6f71be48cc8..b27dbfe7b07c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -73,6 +73,10 @@  matrix:
       arch: amd64
       env: TR_ARCH=fedora-asan
       dist: xenial # test hangs on bionic
+    - os: linux
+      arch: amd64
+      env: TR_ARCH=armv7-cross
+      dist: bionic
   allow_failures:
     - env: TR_ARCH=docker-test
     - env: TR_ARCH=fedora-rawhide
diff --git a/scripts/build/Dockerfile.armv7-cross b/scripts/build/Dockerfile.armv7-cross
new file mode 100644
index 000000000000..434934aad16b
--- /dev/null
+++ b/scripts/build/Dockerfile.armv7-cross
@@ -0,0 +1,44 @@ 
+FROM dockcross/base:latest
+
+# Add the cross compiler sources
+RUN echo "deb http://ftp.us.debian.org/debian/ jessie main" >> /etc/apt/sources.list && \
+  dpkg --add-architecture armhf && \
+  apt-get install emdebian-archive-keyring
+
+RUN apt-get update && apt-get install -y \
+	crossbuild-essential-armhf	\
+	libbz2-dev:armhf		\
+	libexpat1-dev:armhf		\
+	ncurses-dev:armhf		\
+	libssl-dev:armhf		\
+	protobuf-c-compiler		\
+	protobuf-compiler		\
+	python-protobuf			\
+	libnl-3-dev:armhf		\
+	libprotobuf-dev:armhf		\
+	libnet-dev:armhf		\
+	libprotobuf-c-dev:armhf		\
+	libcap-dev:armhf		\
+	libaio-dev:armhf		\
+	libnl-route-3-dev:armhf
+
+ENV CROSS_TRIPLE=arm-linux-gnueabihf
+ENV CROSS_COMPILE=${CROSS_TRIPLE}-				\
+	CROSS_ROOT=/usr/${CROSS_TRIPLE}				\
+	AS=/usr/bin/${CROSS_TRIPLE}-as				\
+	AR=/usr/bin/${CROSS_TRIPLE}-ar				\
+	CC=/usr/bin/${CROSS_TRIPLE}-gcc				\
+	CPP=/usr/bin/${CROSS_TRIPLE}-cpp			\
+	CXX=/usr/bin/${CROSS_TRIPLE}-g++			\
+	LD=/usr/bin/${CROSS_TRIPLE}-ld				\
+	FC=/usr/bin/${CROSS_TRIPLE}-gfortran
+
+ENV PATH="${PATH}:${CROSS_ROOT}/bin"				\
+	PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLE}/pkgconfig	\
+	ARCH=arm						\
+	SUBARCH=armv7
+
+COPY . /criu
+WORKDIR /criu
+
+RUN	make mrproper && date && make -j $(nproc) zdtm && date
diff --git a/scripts/build/Makefile b/scripts/build/Makefile
index a7c78e8bd475..d093ce76c95a 100644
--- a/scripts/build/Makefile
+++ b/scripts/build/Makefile
@@ -2,6 +2,7 @@  ARCHES := x86_64 fedora-asan fedora-rawhide centos armv7hf
 TARGETS := $(ARCHES) alpine
 TARGETS_CLANG := $(addsuffix $(TARGETS),-clang)
 CONTAINER_RUNTIME := docker
+TARGETS += armv7-cross
 
 all: $(TARGETS) $(TARGETS_CLANG)
 .PHONY: all