From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566555412143800320 X-Received: by 2002:adf:f011:: with SMTP id j17-v6mr126234wro.31.1529061145585; Fri, 15 Jun 2018 04:12:25 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:fc44:: with SMTP id e4-v6ls3363417wrs.14.gmail; Fri, 15 Jun 2018 04:12:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJdY+r0pSqg4C2Zp1IM2ND13TKiU5B40Yl8W2v4E75o3KAX8MJXaRt76hn3QMiBNGkhpE7N X-Received: by 2002:adf:fe47:: with SMTP id m7-v6mr128882wrs.20.1529061145051; Fri, 15 Jun 2018 04:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529061145; cv=none; d=google.com; s=arc-20160816; b=TSxZkyPI55iidasH10n/m4iTNkgIoPMeb2bmqs0EAJM4A4n+vT4ILMULwzsCVnL1R+ UHPQN9anwz1CEIKgFE4srNgZ10si+/pQldLIp9112OwqKgqqiqBv1HX/NCTpHmVsniOe XCrrTZWHtEQp75Aoi2/jGsG0KburVsGLBS1+m/RadrkG86oVULnXFgr0cwaS9HX1qYdp eLUkIv/HWwlSeqxOrboCb+YzOEWydGIi/37adBDpT0Qc0ELsrd548F7PtgKNa6HWHLwY wAaE0ZypYwnaOMgYag7MWx0m5jb8Z6Ft3hbRGzbUKE3Yh/cFbJSYPMXkGiWYFJzywQhD tIqw== 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=l2oiWrob2z491kp70ffL0NFliMcKstWtx+Qq5TZhsx4=; b=oPMyU14v1bqQoq/BndxVu88+AGFkhGrYT3U9sfoSCWK7TCloLtdVNus6Se/oRcoKk2 /ViZ2SsB1FTz+wL/cyFy84D2HrlYaQN0i1jPnk0ss4AFwTkpWdG3MscHvK3KkA/haxx8 a8fy3VR2ZF7b0UR1aYB93xQapBlug3ZCnPHQpr3v1w5lQIXSyJfWubNYU/Rp7j6MTQx3 26NB8fufa0MF1/AW955eI/10A7mWuBFe0HYJUxH65QroObX+4g8yKVxgONrP5/vQ9hbZ L2ALO9fK/6VoyfpfO12QDH1EEzEbcseOXj7k80VeRdLQt+8pmfCfTThxX87KE+T8tS7H WMoA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id x7-v6si47305wmh.2.2018.06.15.04.12.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 04:12:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w5FBCO1G001243 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jun 2018 13:12:24 +0200 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w5FBCOwi021769; Fri, 15 Jun 2018 13:12:24 +0200 Subject: Re: [PATCH 5/9] buildchroot-cross: Initial implementation To: Alexander Smirnov 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: Jan Kiszka Message-ID: Date: Fri, 15 Jun 2018 13:12:23 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180615105619.GC24273@azat.radix50.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: gWTInFNkNe8J 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? Jan