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

Dmitry Safonov dima at arista.com
Fri Nov 22 00:56:41 MSK 2019


Fixes: #455
Based-on-patch-by: Andrei Vagin <avagin at gmail.com>
Signed-off-by: Dmitry Safonov <dima at 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

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
-- 
2.24.0



More information about the CRIU mailing list