From: Alexander Smirnov <asmirnov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 5/9] buildchroot-cross: Initial implementation
Date: Sun, 17 Jun 2018 22:28:56 +0300 [thread overview]
Message-ID: <1a202d15-d180-9fd9-2e0e-c49ac2181ea1@ilbers.de> (raw)
In-Reply-To: <c073bee5-2afd-753d-7418-86c67057270c@siemens.com>
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 <asmirnov@ilbers.de>
>>>> ---
>>>> 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
next prev parent reply other threads:[~2018-06-17 19:29 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 13:07 [RFC] [PATCH 0/9] Initial cross-compilation support Alexander Smirnov
2018-06-13 13:07 ` [PATCH 1/9] isar-bootstrap: Add routin to determine host arch Alexander Smirnov
2018-06-14 11:23 ` Henning Schild
2018-06-15 11:11 ` Alexander Smirnov
2018-06-15 11:15 ` Jan Kiszka
2018-06-13 13:08 ` [PATCH 2/9] isar-bootstrap: Move common part to include Alexander Smirnov
2018-06-13 13:08 ` [PATCH 3/9] isar-bootstrap: Add host architecture support Alexander Smirnov
2018-06-14 11:27 ` Henning Schild
2018-06-15 11:09 ` Alexander Smirnov
2018-06-13 13:08 ` [PATCH 4/9] isar-bootstrap-helper: Add parameter to set arch Alexander Smirnov
2018-06-13 13:08 ` [PATCH 5/9] buildchroot-cross: Initial implementation Alexander Smirnov
2018-06-14 11:36 ` Henning Schild
2018-06-15 11:16 ` Alexander Smirnov
2018-06-14 15:55 ` Jan Kiszka
2018-06-15 10:56 ` Alexander Smirnov
2018-06-15 11:12 ` Jan Kiszka
2018-06-17 19:28 ` Alexander Smirnov [this message]
2018-06-13 13:08 ` [PATCH 6/9] classes/dpkg*: Relocate dependency from buildchroot Alexander Smirnov
2018-06-14 6:44 ` Jan Kiszka
2018-06-15 10:52 ` Alexander Smirnov
2018-06-13 13:08 ` [PATCH 7/9] classes/dpkg*: Drop hardcoded buildchroot blobs Alexander Smirnov
2018-06-13 13:08 ` [PATCH 8/9] classes/dpkg-cross: Initial implementation Alexander Smirnov
2018-06-13 13:08 ` [PATCH 9/9] [FOR TESTING] libhello: Switch to cross compilation Alexander Smirnov
2018-06-13 13:57 ` [RFC] [PATCH 0/9] Initial cross-compilation support Jan Kiszka
2018-06-14 11:20 ` Henning Schild
2018-06-17 19:41 ` Alexander Smirnov
2018-06-18 7:04 ` Henning Schild
2018-06-14 12:01 ` Henning Schild
2018-06-14 12:04 ` Claudius Heine
2018-06-14 12:24 ` Henning Schild
2018-06-14 12:36 ` Claudius Heine
2018-06-14 12:30 ` Jan Kiszka
2018-06-14 12:42 ` Claudius Heine
2018-06-14 12:55 ` Claudius Heine
2018-06-15 10:50 ` Alexander Smirnov
2018-06-15 13:17 ` Claudius Heine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a202d15-d180-9fd9-2e0e-c49ac2181ea1@ilbers.de \
--to=asmirnov@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox