From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566555412143800320 X-Received: by 2002:a1c:5b0b:: with SMTP id p11-v6mr898308wmb.11.1529263746093; Sun, 17 Jun 2018 12:29:06 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:eb8e:: with SMTP id t14-v6ls5032010wrn.7.gmail; Sun, 17 Jun 2018 12:29:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIaOsEASVCaLp5KN6F7h2A10S7UhVMEny6iU3TwgxtAtjT0AvG3psGHWp0uZBSzGRqgW3fn X-Received: by 2002:adf:fdcf:: with SMTP id i15-v6mr770610wrs.5.1529263745599; Sun, 17 Jun 2018 12:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529263745; cv=none; d=google.com; s=arc-20160816; b=vN9o3jFCWkKxgy6y6VV3A6mPjr22lrx3LYa2eXnjNdgXz/wXGLF2ht5r0UcpB3H6ya UDV06JLDbBZMCILGZK1a+eQi8yUPOx7EsXkJAwL3eo0ei3r1DmmWJZztUTI5C53ALsLx V8vYZWNE/wil+YZVD+FA7tr3+Wp9H0oerHmoLYBfLPpnDd+NLqqynfHDOWRbt8OHBZCB YGWUUaw12uQlFyOYqv2guyXAApBviPCfk6XYprj+pcIHg5v6ESy2UXFi/oaznpV9XgTb Ww/TO0O7KRxs3ri2rZmtktv1pLDem9sXA56PTLhzGbaqQ5VDXHHwLOunxtzryuIe06vO BRMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=JeuHVy2vXCfrp20ccvOlBUKDskTcEq1yHKWjhUjwia0=; b=rnyJN/9SzPYNDUd32p2X5tREOxR6kRegCAKgoF2rSp2dNtcRdYE2bvXRMP6HRsGydb sGHb1eHyKxHnyLoVu3Hpgxp+knzOgu9rMEsIkujesLhW5rgY6fUsBaqU+BTq0ygAiVUF RFLC0gitJQOA1iSvrHXijo83ydzCvwX9IeLYC7nzcVnQDlFVhU6Ei1/5FnzSSJldZ7A3 R7S7vLaCFWdHbLepgD6YsToCtz5dTsLCBG3tSBfCvH1966IEMPBp3LOJR1c+H16H6+kS sDf3MImLLl6cIyfHFwUo6chRImqq/AreJwXegV9EeAPMDcTEls8iYpVzzYlJujdtByKk 82EA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id a6-v6si372254wmg.4.2018.06.17.12.29.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 12:29:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w5HJT15r013742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 17 Jun 2018 21:29:04 +0200 Subject: Re: [PATCH 5/9] buildchroot-cross: Initial implementation To: Jan Kiszka Cc: isar-users@googlegroups.com References: <20180613130807.2461-1-asmirnov@ilbers.de> <20180613130807.2461-6-asmirnov@ilbers.de> <0789d066-e475-e68c-41aa-e68d0e2ecbb4@siemens.com> <20180615105619.GC24273@azat.radix50.net> From: Alexander Smirnov Message-ID: <1a202d15-d180-9fd9-2e0e-c49ac2181ea1@ilbers.de> Date: Sun, 17 Jun 2018 22:28:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: KoW2/pRjicQm Hi Jan, On 06/15/2018 02:12 PM, Jan Kiszka wrote: > On 2018-06-15 12:56, Alexander Smirnov wrote: >> On Thu, Jun 14, 2018 at 05:55:48PM +0200, Jan Kiszka wrote: >>> On 2018-06-13 15:08, Alexander Smirnov wrote: >>>> Add initial generation of buildchroot for cross-compilation. >>>> >>>> Signed-off-by: Alexander Smirnov >>>> --- >>>> meta/conf/isar-bitbake.conf | 1 + >>>> .../buildchroot/buildchroot-cross.bb | 53 ++++++++++++++++++++++ >>>> .../buildchroot/files/build-cross.sh | 29 ++++++++++++ >>>> 3 files changed, 83 insertions(+) >>>> create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-cross.bb >>>> create mode 100644 meta/recipes-devtools/buildchroot/files/build-cross.sh >>>> >>>> diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf >>>> index ead7798..1412508 100644 >>>> --- a/meta/conf/isar-bitbake.conf >>>> +++ b/meta/conf/isar-bitbake.conf >>>> @@ -22,6 +22,7 @@ WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PF}" >>>> DL_DIR = "${TOPDIR}/downloads" >>>> SSTATE_DIR ?= "${TMPDIR}/sstate-cache" >>>> BUILDCHROOT_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot/rootfs" >>>> +BUILDCHROOT_CROSS_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot-cross/rootfs" >>>> CACHE = "${TMPDIR}/cache" >>>> >>>> OVERRIDES_append = ":${DISTRO}:${DISTRO_ARCH}" >>>> diff --git a/meta/recipes-devtools/buildchroot/buildchroot-cross.bb b/meta/recipes-devtools/buildchroot/buildchroot-cross.bb >>>> new file mode 100644 >>>> index 0000000..935a626 >>>> --- /dev/null >>>> +++ b/meta/recipes-devtools/buildchroot/buildchroot-cross.bb >>>> @@ -0,0 +1,53 @@ >>>> +# Root filesystem for packages cross-building >>>> +# >>>> +# This software is a part of ISAR. >>>> +# Copyright (C) 2015-2016 ilbers GmbH >>>> + >>>> +DESCRIPTION = "Isar development cross-filesystem" >>>> + >>>> +LICENSE = "gpl-2.0" >>>> +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" >>>> + >>>> +FILESPATH_prepend := "${THISDIR}/files:" >>>> +SRC_URI = "file://configscript.sh \ >>>> + file://build-cross.sh" >>>> +PV = "1.0" >>>> + >>>> +inherit isar-bootstrap-helper >>>> + >>>> +BUILDCHROOT_CROSS_PREINSTALL ?= "gcc-multilib \ >>>> + make \ >>>> + build-essential \ >>>> + debhelper \ >>>> + autotools-dev \ >>>> + dpkg \ >>>> + locales \ >>>> + docbook-to-man \ >>>> + apt \ >>>> + automake \ >>>> + devscripts \ >>>> + equivs" >>>> + >>>> +# TODO: make this inclusion depending on the target arch >>>> +BUILDCHROOT_CROSS_PREINSTALL += "binutils" >>>> + >>>> +WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" >>>> + >>>> +do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" >>>> +do_build[root_cleandirs] = "${BUILDCHROOT_CROSS_DIR} \ >>>> + ${BUILDCHROOT_CROSS_DIR}/isar-apt \ >>>> + ${BUILDCHROOT_CROSS_DIR}/downloads \ >>>> + ${BUILDCHROOT_CROSS_DIR}/home/builder" >>>> +do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_deploy" >>>> + >>>> +do_build() { >>>> + setup_root_file_system --host-arch "${BUILDCHROOT_CROSS_DIR}" ${BUILDCHROOT_CROSS_PREINSTALL} >>>> + >>>> + # Install package builder script >>>> + sudo chmod -R a+rw "${BUILDCHROOT_CROSS_DIR}/home/builder" >>>> + sudo install -m 755 ${WORKDIR}/build-cross.sh ${BUILDCHROOT_CROSS_DIR}/build.sh >>>> + >>>> + # Configure root filesystem >>>> + sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_CROSS_DIR} >>>> + sudo chroot ${BUILDCHROOT_CROSS_DIR} /configscript.sh >>>> +} >>>> diff --git a/meta/recipes-devtools/buildchroot/files/build-cross.sh b/meta/recipes-devtools/buildchroot/files/build-cross.sh >>>> new file mode 100644 >>>> index 0000000..8c3ddaf >>>> --- /dev/null >>>> +++ b/meta/recipes-devtools/buildchroot/files/build-cross.sh >>>> @@ -0,0 +1,29 @@ >>>> +#!/bin/bash >>>> +# >>>> +# This software is a part of ISAR. >>>> +# Copyright (C) 2015-2017 ilbers GmbH >>>> +# Copyright (c) 2018 Siemens AG >>>> + >>>> +set -e >>>> + >>>> +# Go to build directory >>>> +cd $1 >>>> + >>>> +# Add target architecture >>>> +dpkg --add-architecture $2 >>>> + >>>> +# To avoid Perl locale warnings: >>>> +export LC_ALL=C >>>> +export LANG=C >>>> +export LANGUAGE=C >>>> + >>>> +# If autotools files have been created, update their timestamp to >>>> +# prevent them from being regenerated >>>> +for i in configure aclocal.m4 Makefile.am Makefile.in; do >>>> + if [ -f "${i}" ]; then >>>> + touch "${i}" >>>> + fi >>>> +done >>>> + >>>> +# Build the package >>>> +dpkg-buildpackage -a$2 >>>> >>> >>> This build-cross.sh doesn't install any of the build dependencies the >>> target package lists. How do they come in? Or is this a limitation of >>> this version? For the kernel cross-build, I'm currently trying to >>> translate the what is needed for a corresponding build-kernel-cross.sh. >>> >> >> That's exactly the limitation of this series about which I mentioned in >> the cover letter. Attempt to install them in similar way like for >> 'build.sh' failed, due to it tries to replace native packages like: >> build-essentials, binutils by foreign ones :-(. Henning already proposed >> to try to play with mk-build-deps params, so I'm going to do this. > > OK, this would be a road-blocker for building anything cross. Already > libhello would lack docbook-to-man (if that is a real dependency). > >> >>> Those packages would go into the cross-buildchroot, or are we also using >>> the native buildchroot here? >> >> buildchroot and buildchroot-cross has nothing common except isar-apt >> repository. > > So the plan is to install all build deps into the buildchroot-cross, right? > > Is there an officially documented way in Debian to do cross builds? What > does it say regarding build-deps installation? > According to the following link (and some others): https://wiki.debian.org/Multiarch/HOWTO#Installing_cross-dependencies The official way to install build deps: $ apt-get build-dep ... But this doesn't work for us, because we have no source package yet :-( Alex