From patchwork Tue Jan 24 14:33:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 92366 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1730087obz; Tue, 24 Jan 2017 06:41:01 -0800 (PST) X-Received: by 10.55.12.14 with SMTP id 14mr29453976qkm.308.1485268861782; Tue, 24 Jan 2017 06:41:01 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s49si13283774qtb.234.2017.01.24.06.41.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Jan 2017 06:41:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cW2HL-0001my-4b for patch@linaro.org; Tue, 24 Jan 2017 09:40:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cW2AX-0004Yt-2n for qemu-devel@nongnu.org; Tue, 24 Jan 2017 09:34:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cW2AV-0005LU-KO for qemu-devel@nongnu.org; Tue, 24 Jan 2017 09:33:57 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cW2AV-0005L0-F0 for qemu-devel@nongnu.org; Tue, 24 Jan 2017 09:33:55 -0500 Received: by mail-wm0-x235.google.com with SMTP id c206so212473634wme.0 for ; Tue, 24 Jan 2017 06:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qQD+k13+K9ebMWVsjVPJFwwUWSC17AM+7tfDT8yACbI=; b=YU4AixVJp+/M9p26x4WAUjY71BTHfuj8SLRrxMs/BgTU6x1/xqElIubNXIFvwbuUNK N5TWlJde32OMzzlY1vI5B0SGyq71wPIcQXJAlqVAE5q9/wVktFYxt63BGoZfod1dQMPZ gchh8xjTUlAHTzOd3YV+bNiin62ByzAL2OpXo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qQD+k13+K9ebMWVsjVPJFwwUWSC17AM+7tfDT8yACbI=; b=MyPKRf7N0tm/FTGi5c6/Eucz6yIHk0aafMGPVrEbLsCfXBwCQc0K/YtdwrgAoYSHmc 1vFn/KqWxhks7isOw/SdJeTlfqYP+9GDosTGsOqR0dq4OyyX5zRFM04RlBMaFABSsl5g PaLbk9LNO49y7hKKW7oiFmvKWEx09I7mUBgamGIWbuVOz+O59Wh/Mfw0znQFcSovEpeu DKi7peMGW5vmA5/bdjkSh2h3apPpw47dMKlVcfMPc7e/pZlyEfsgKwUZMQrB+Zxu1VJB 7DD5hJZYrOR0QYwoC6h09fuIza3tcb5FYGz1ro/VGqnwGdNTUFnkSJTS676MN8mkiChe r5Ug== X-Gm-Message-State: AIkVDXI+8hxTarnhbud62nQZjE40AnCF666C12sQv5yVfggZ5b7qBCF43pVFpcq+gvmdWAXo X-Received: by 10.28.216.14 with SMTP id p14mr17081167wmg.56.1485268434413; Tue, 24 Jan 2017 06:33:54 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 10sm20141628wrw.13.2017.01.24.06.33.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 06:33:52 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id F2EE43E2AAF; Tue, 24 Jan 2017 14:33:46 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Date: Tue, 24 Jan 2017 14:33:44 +0000 Message-Id: <20170124143346.22240-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170124143346.22240-1-alex.bennee@linaro.org> References: <20170124143346.22240-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 Subject: [Qemu-devel] [PATCH v2 5/7] new debian-multiarch-cross.docker: a cross-compiling docker guest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , "open list:All patches CC here" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This provides a basic Debian install with access to the emdebian cross compilers for armhf, arm64, mipsel and ppc64el. On its own it provides the basic cross build essentials for building any of those architectures. More complex cross-compilations would need to install library dependencies on top of this image. An example use: docker run --rm -it \ -v /home/alex/lsrc/qemu/qemu.git/:/home/alex/lsrc/qemu/qemu.git/ \ --user=alex:alex \ -w /home/alex/lsrc/qemu/qemu.git/arm-linux-user/tests \ -e CROSS_CC="arm-linux-gnueabihf-gcc" \ debian:cross make -f ../../tests/tcg/arm/Makefile Signed-off-by: Alex Bennée --- v2 - add clang (keep shippable happy) - rm adduser code (done direct now) - add aptitude (useful for debugging package clashes) --- .../dockerfiles/debian-multiarch-cross.docker | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/docker/dockerfiles/debian-multiarch-cross.docker -- 2.11.0 diff --git a/tests/docker/dockerfiles/debian-multiarch-cross.docker b/tests/docker/dockerfiles/debian-multiarch-cross.docker new file mode 100644 index 0000000000..749fdf07e1 --- /dev/null +++ b/tests/docker/dockerfiles/debian-multiarch-cross.docker @@ -0,0 +1,45 @@ +# +# Docker multiarch cross-compiler target +# +# This docker target is builds on Debian and Emdebian's cross compiler targets +# to build distro with a selection of cross compilers for building test binaries. +# +# This does not include the build dependancies for QEMU as there are +# so many there are unresolvable clashes. +# +FROM debian:stable-slim + +# Setup some basic tools we need +RUN apt update +RUN apt install -yy curl aptitude + +# Setup Emdebian +RUN echo "deb http://emdebian.org/tools/debian/ jessie main" >> /etc/apt/sources.list +RUN curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add - + +# Duplicate deb line as deb-src +RUN cat /etc/apt/sources.list | sed "s/deb/deb-src/" >> /etc/apt/sources.list + +# Add the foriegn architectures we want +RUN dpkg --add-architecture armhf +RUN dpkg --add-architecture arm64 +RUN dpkg --add-architecture mipsel +RUN dpkg --add-architecture ppc64el + +#FIXME: Currently these cause clashes due to multi-arch being an ongoig process +#RUN dpkg --add-architecture mips +#RUN dpkg --add-architecture powerpc + +# Final update +RUN apt update + +# Install the crossbuild essential packages +# FIXME: crossbuild-essential-powerpc has a clash with '/lib/ld.so.1' +RUN apt install -yy clang crossbuild-essential-arm64 crossbuild-essential-armhf crossbuild-essential-mipsel crossbuild-essential-ppc64el + +# Before you can actually build something you need to install its build dependancies. +# This is best done in a child container as architecture specific -dev packages have a habit of clashing with +# each other because not everything is fully complient with the multiarch specififcation. +# +# To install the QEMU build dependacnies you need to run: +# RUN apt-get build-dep -yy -a armhf qemu