public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v5 00/12] Cross-compilation
@ 2018-07-30 19:39 Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 01/12] isar-bootstrap: Update routine to determine host arch Alexander Smirnov
                   ` (13 more replies)
  0 siblings, 14 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Hi all,

this is v5 for cross-compilation.

Updates since v4:
 - Fix 'cut' call according to the Henning's hint
 - Add documentation
 - Add cross parameter to the ci_build script

Alex

Alexander Smirnov (12):
  isar-bootstrap: Update routine to determine host arch
  buildchroot: Split generic part
  buildchroot: Add host buildchroot
  isar-bootstrap-helper: Add target architecture for dpkg
  build.sh: Add additional parameter
  cross-compilation: Introduce variable switch
  linux: Add ARM cross-compilation support
  isar: Add ARM64 cross-compilation support
  linux-module: Export ARCH and CROSS_COMPILE
  linux: Drop gcc from dependencies
  doc: Provide some notes about cross-compilation
  scripts/ci_build.sh: Add cross-compilation test

 doc/technical_overview.md                          | 49 ++++++++++++++++------
 doc/user_manual.md                                 | 27 ++++++++++++
 meta-isar/conf/local.conf.sample                   |  5 +++
 .../example-module/example-module.bb               |  7 ++++
 meta/classes/dpkg-base.bbclass                     | 19 +++++++--
 meta/classes/dpkg.bbclass                          |  4 +-
 meta/classes/isar-bootstrap-helper.bbclass         | 13 +++++-
 meta/classes/wic-img.bbclass                       |  3 +-
 meta/conf/isar-bitbake.conf                        |  3 +-
 .../buildchroot/buildchroot-host.bb                | 34 +++++++++++++++
 .../{buildchroot.bb => buildchroot-target.bb}      | 35 ++--------------
 meta/recipes-devtools/buildchroot/buildchroot.inc  | 37 ++++++++++++++++
 meta/recipes-devtools/buildchroot/files/build.sh   | 17 +++++++-
 .../recipes-kernel/linux-module/files/debian/rules | 12 ++++++
 meta/recipes-kernel/linux/files/build-kernel.sh    | 28 +++++++++++--
 meta/recipes-kernel/linux/linux-custom.inc         |  4 +-
 scripts/ci_build.sh                                | 14 ++++++-
 17 files changed, 248 insertions(+), 63 deletions(-)
 create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-host.bb
 rename meta/recipes-devtools/buildchroot/{buildchroot.bb => buildchroot-target.bb} (58%)
 create mode 100644 meta/recipes-devtools/buildchroot/buildchroot.inc

-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 01/12] isar-bootstrap: Update routine to determine host arch
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 02/12] buildchroot: Split generic part Alexander Smirnov
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Use generic dpkg call, because dpkg-architecture requires additional
package to install.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/classes/isar-bootstrap-helper.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index e4d99d5..3faee7c 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -9,8 +9,12 @@ IMAGE_TRANSIENT_PACKAGES ??= ""
 
 def get_deb_host_arch():
     import subprocess
-    arch =  subprocess.check_output(['/usr/bin/dpkg-architecture', '-q', 'DEB_HOST_ARCH'], universal_newlines=True)
-    return str.splitlines(arch)[0]
+    host_arch = subprocess.Popen("dpkg --print-architecture",
+                                 shell=True,
+                                 env=os.environ,
+                                 stdout=subprocess.PIPE
+                                ).stdout.read().decode('utf-8').strip()
+    return host_arch
 
 #Debian Distribution for SDK host
 HOST_DISTRO ?= "debian-stretch"
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 02/12] buildchroot: Split generic part
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 01/12] isar-bootstrap: Update routine to determine host arch Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 03/12] buildchroot: Add host buildchroot Alexander Smirnov
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Split generic part of the buildchroot creation process. Also
intriduce buildchroot recipe for target.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/classes/dpkg-base.bbclass                     |  2 +-
 meta/classes/dpkg-raw.bbclass                      |  1 +
 meta/classes/dpkg.bbclass                          |  4 ++-
 meta/classes/wic-img.bbclass                       |  3 +-
 meta/conf/isar-bitbake.conf                        |  2 +-
 .../{buildchroot.bb => buildchroot-target.bb}      | 35 ++------------------
 meta/recipes-devtools/buildchroot/buildchroot.inc  | 37 ++++++++++++++++++++++
 7 files changed, 48 insertions(+), 36 deletions(-)
 rename meta/recipes-devtools/buildchroot/{buildchroot.bb => buildchroot-target.bb} (58%)
 create mode 100644 meta/recipes-devtools/buildchroot/buildchroot.inc

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 75b45a7..3234234 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -15,7 +15,7 @@ inherit patch
 addtask patch after do_adjust_git before do_build
 
 # Add dependency from buildchroot creation
-do_build[depends] = "buildchroot:do_build"
+do_build[depends] = "buildchroot-target:do_build"
 
 # Add dependency between Isar recipes
 DEPENDS ?= ""
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index 28233ac..2f23eb7 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -7,6 +7,7 @@ DEBIAN_DEPENDS ?= ""
 MAINTAINER ?= "FIXME Unknown maintainer"
 
 D = "${WORKDIR}/image/"
+BUILDCHROOT_DIR = "${BUILDCHROOT_TARGET_DIR}"
 
 # Populate folder that will be picked up as package
 do_install() {
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index c8d4ac5..563b63c 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -1,8 +1,10 @@
 # This software is a part of ISAR.
-# Copyright (C) 2015-2016 ilbers GmbH
+# Copyright (C) 2015-2018 ilbers GmbH
 
 inherit dpkg-base
 
+BUILDCHROOT_DIR = "${BUILDCHROOT_TARGET_DIR}"
+
 # Build package from sources using build script
 dpkg_runbuild() {
     E="${@ bb.utils.export_proxies(d)}"
diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 07c2a9e..b56df7b 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -13,6 +13,7 @@ STAGING_DIR ?= "${TMPDIR}"
 IMAGE_BASENAME ?= "${PN}-${DISTRO}"
 FAKEROOTCMD ?= "${ISARROOT}/scripts/wic_fakeroot"
 RECIPE_SYSROOT_NATIVE ?= "/"
+BUILDCHROOT_DIR = "${BUILDCHROOT_TARGET_DIR}"
 
 do_wic_image[stamp-extra-info] = "${DISTRO}-${MACHINE}"
 
@@ -73,6 +74,6 @@ do_wic_image() {
     cp -f `ls -t -1 ${BUILDCHROOT_DIR}/tmp/${WKS_FILE}*.direct | head -1` ${WIC_IMAGE_FILE}
 }
 
-do_wic_image[depends] = "buildchroot:do_build"
+do_wic_image[depends] = "buildchroot-target:do_build"
 
 addtask wic_image before do_build after do_copy_boot_files
diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf
index ead7798..aaba96e 100644
--- a/meta/conf/isar-bitbake.conf
+++ b/meta/conf/isar-bitbake.conf
@@ -21,7 +21,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_TARGET_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot-target/rootfs"
 CACHE = "${TMPDIR}/cache"
 
 OVERRIDES_append = ":${DISTRO}:${DISTRO_ARCH}"
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot-target.bb
similarity index 58%
rename from meta/recipes-devtools/buildchroot/buildchroot.bb
rename to meta/recipes-devtools/buildchroot/buildchroot-target.bb
index 7ad24f1..66b526a 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot-target.bb
@@ -1,19 +1,11 @@
 # Root filesystem for packages building
 #
 # This software is a part of ISAR.
-# Copyright (C) 2015-2016 ilbers GmbH
+# Copyright (C) 2015-2018 ilbers GmbH
 
-DESCRIPTION = "Isar development filesystem"
+DESCRIPTION = "Isar development filesystem for target"
 
-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.sh"
-PV = "1.0"
-
-inherit isar-bootstrap-helper
+include buildchroot.inc
 
 BUILDCHROOT_PREINSTALL ?= "gcc \
                            make \
@@ -59,25 +51,4 @@ python () {
                     d.getVar('BUILDCHROOT_PREINSTALL_WIC', True))
 }
 
-WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
-
-do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-do_build[root_cleandirs] = "${BUILDCHROOT_DIR} \
-                            ${BUILDCHROOT_DIR}/isar-apt \
-                            ${BUILDCHROOT_DIR}/downloads \
-                            ${BUILDCHROOT_DIR}/home/builder"
 do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-target:do_bootstrap"
-
-do_build() {
-    setup_root_file_system "${BUILDCHROOT_DIR}" ${BUILDCHROOT_PREINSTALL}
-
-    # Install package builder script
-    sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder"
-    sudo install -m 755 ${WORKDIR}/build.sh ${BUILDCHROOT_DIR}
-
-    # Configure root filesystem
-    sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_DIR}
-    sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
-
-    sudo mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
-}
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.inc b/meta/recipes-devtools/buildchroot/buildchroot.inc
new file mode 100644
index 0000000..43e3cd6
--- /dev/null
+++ b/meta/recipes-devtools/buildchroot/buildchroot.inc
@@ -0,0 +1,37 @@
+# Common part for build chroot filesystem.
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2018 ilbers GmbH
+
+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.sh"
+PV = "1.0"
+
+inherit isar-bootstrap-helper
+
+WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
+BUILDCHROOT_DIR = "${WORKDIR}/rootfs"
+
+do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+do_build[root_cleandirs] = "${BUILDCHROOT_DIR} \
+                            ${BUILDCHROOT_DIR}/isar-apt \
+                            ${BUILDCHROOT_DIR}/downloads \
+                            ${BUILDCHROOT_DIR}/home/builder"
+
+do_build() {
+    setup_root_file_system ${PARAMS} ${BUILDCHROOT_DIR} ${BUILDCHROOT_PREINSTALL}
+
+    # Install package builder script
+    sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder"
+    sudo install -m 755 ${WORKDIR}/build.sh ${BUILDCHROOT_DIR}
+
+    # Configure root filesystem
+    sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_DIR}
+    sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
+
+    sudo mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
+}
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 03/12] buildchroot: Add host buildchroot
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 01/12] isar-bootstrap: Update routine to determine host arch Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 02/12] buildchroot: Split generic part Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 04/12] isar-bootstrap-helper: Add target architecture for dpkg Alexander Smirnov
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Add buildchroot for host architecture.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/conf/isar-bitbake.conf                        |  1 +
 .../buildchroot/buildchroot-host.bb                | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-host.bb

diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf
index aaba96e..666c4a3 100644
--- a/meta/conf/isar-bitbake.conf
+++ b/meta/conf/isar-bitbake.conf
@@ -21,6 +21,7 @@
 WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PF}"
 DL_DIR = "${TOPDIR}/downloads"
 SSTATE_DIR ?= "${TMPDIR}/sstate-cache"
+BUILDCHROOT_HOST_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot-host/rootfs"
 BUILDCHROOT_TARGET_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot-target/rootfs"
 CACHE = "${TMPDIR}/cache"
 
diff --git a/meta/recipes-devtools/buildchroot/buildchroot-host.bb b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
new file mode 100644
index 0000000..048998d
--- /dev/null
+++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
@@ -0,0 +1,31 @@
+# Root filesystem for packages building
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2018 ilbers GmbH
+
+DESCRIPTION = "Isar development filesystem for host"
+
+include buildchroot.inc
+
+BUILDCHROOT_PREINSTALL ?= "make \
+                           debhelper \
+                           autotools-dev \
+                           dpkg \
+                           locales \
+                           docbook-to-man \
+                           apt \
+                           automake \
+                           devscripts \
+                           equivs \
+                           libc6:${DISTRO_ARCH}"
+
+# Please note: this works for Stretch distro only. According to the wiki page:
+#     https://wiki.debian.org/CrossToolchains
+# Jessie doesn't contain toolchain. It should be fetched from the external
+# repository:
+#     http://emdebian.org/tools/debian/
+BUILDCHROOT_PREINSTALL_append_armhf += "binutils-arm-linux-gnueabihf \
+                                        crossbuild-essential-armhf"
+
+PARAMS = "--host-arch"
+do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_bootstrap"
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 04/12] isar-bootstrap-helper: Add target architecture for dpkg
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (2 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 03/12] buildchroot: Add host buildchroot Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 05/12] build.sh: Add additional parameter Alexander Smirnov
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

This filesystem intended for cross-compilation, so the target
architecture should be added. Otherwise dpkg won't be able to
install dependencies.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/classes/isar-bootstrap-helper.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index 3faee7c..d45cdd7 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -111,6 +111,11 @@ setup_root_file_system() {
         -o Dir::Etc::sourcelist="sources.list.d/isar-apt.list" \
         -o Dir::Etc::sourceparts="-" \
         -o APT::Get::List-Cleanup="0"
+    # Add multiarch for cross-target
+    if [ "${ROOTFS_ARCH}" != "${DISTRO_ARCH}" ]; then
+        sudo -E chroot "$ROOTFSDIR" /usr/bin/dpkg --add-architecture ${DISTRO_ARCH}
+        sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-get update
+    fi
     sudo -E chroot "$ROOTFSDIR" \
         /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES \
             ${IMAGE_TRANSIENT_PACKAGES}
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 05/12] build.sh: Add additional parameter
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (3 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 04/12] isar-bootstrap-helper: Add target architecture for dpkg Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-08-01 14:51   ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 06/12] cross-compilation: Introduce variable switch Alexander Smirnov
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Pass target architecture as a parameter for build.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/recipes-devtools/buildchroot/files/build.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
index 73c0889..c2967d2 100644
--- a/meta/recipes-devtools/buildchroot/files/build.sh
+++ b/meta/recipes-devtools/buildchroot/files/build.sh
@@ -6,6 +6,19 @@
 
 set -e
 
+# Create human-readable names
+target_arch=$2
+
+# Notes:
+#   mk-build-deps for jessie and jtretch has different parameter name to specify
+#   host architecture.
+debian_version=$(cut -c1 /etc/debian_version)
+if [ $(($debian_version)) -ge 9 ]; then
+    set_arch="--host-arch $target_arch"
+else
+    set_arch="-a $target_arch"
+fi
+
 # Go to build directory
 cd $1
 
@@ -36,7 +49,7 @@ install_cmd="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y
         -o APT::Get::List-Cleanup="0"
 
     # Install all build deps
-    mk-build-deps -t "${install_cmd}" -i -r debian/control
+    mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
 ) 42>/dpkg.lock
 
 # If autotools files have been created, update their timestamp to
@@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am Makefile.in; do
 done
 
 # Build the package
-dpkg-buildpackage
+dpkg-buildpackage -a$target_arch
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 06/12] cross-compilation: Introduce variable switch
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (4 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 05/12] build.sh: Add additional parameter Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 07/12] linux: Add ARM cross-compilation support Alexander Smirnov
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Add variable to switch from native to cross compilation.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta-isar/conf/local.conf.sample                      |  5 +++++
 .../recipes-kernel/example-module/example-module.bb   |  7 +++++++
 meta/classes/dpkg-base.bbclass                        | 19 ++++++++++++++++---
 meta/classes/dpkg-raw.bbclass                         |  1 -
 meta/classes/dpkg.bbclass                             |  4 +---
 5 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 16ef488..27b43d1 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -156,3 +156,8 @@ CONF_VERSION = "1"
 #
 # The default list of extra packages to be installed.
 IMAGE_INSTALL = "example-hello example-raw example-module"
+
+#
+# Enable cross-compilation support
+# NOTE: this works only for stretch-armhf and stretch-amd64 targets for now.
+ISAR_CROSS_COMPILE ?= "0"
diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb
index 98d0aaa..6b63ae3 100644
--- a/meta-isar/recipes-kernel/example-module/example-module.bb
+++ b/meta-isar/recipes-kernel/example-module/example-module.bb
@@ -12,3 +12,10 @@ SRC_URI += "file://src"
 S = "${WORKDIR}/src"
 
 AUTOLOAD = "1"
+
+# Cross-compilation is not supported for the default Debian kernels.
+# For example, package with kernel headers for ARM:
+#   linux-headers-armmp
+# has hard dependencies from linux-compiler-gcc-4.8-arm, what
+# conflicts with the host binaries.
+ISAR_CROSS_COMPILE = "0"
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 3234234..674c0b5 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -1,6 +1,22 @@
 # This software is a part of ISAR.
 # Copyright (C) 2017 Siemens AG
 
+ISAR_CROSS_COMPILE ??= "0"
+
+# Add dependency from the correct buildchroot: host or target
+python __anonymous() {
+    mode = d.getVar('ISAR_CROSS_COMPILE', True)
+    if mode == "0":
+        dep = "buildchroot-target:do_build"
+        rootfs = d.getVar('BUILDCHROOT_TARGET_DIR', True)
+    else:
+        dep = "buildchroot-host:do_build"
+        rootfs = d.getVar('BUILDCHROOT_HOST_DIR', True)
+
+    d.setVarFlag('do_build', 'depends', dep)
+    d.setVar('BUILDCHROOT_DIR', rootfs)
+}
+
 do_adjust_git() {
     if [ -f ${S}/.git/objects/info/alternates ]; then
         sed -i ${S}/.git/objects/info/alternates \
@@ -14,9 +30,6 @@ do_adjust_git[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
 inherit patch
 addtask patch after do_adjust_git before do_build
 
-# Add dependency from buildchroot creation
-do_build[depends] = "buildchroot-target:do_build"
-
 # Add dependency between Isar recipes
 DEPENDS ?= ""
 do_build[deptask] = "do_deploy_deb"
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index 2f23eb7..28233ac 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -7,7 +7,6 @@ DEBIAN_DEPENDS ?= ""
 MAINTAINER ?= "FIXME Unknown maintainer"
 
 D = "${WORKDIR}/image/"
-BUILDCHROOT_DIR = "${BUILDCHROOT_TARGET_DIR}"
 
 # Populate folder that will be picked up as package
 do_install() {
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 563b63c..ab70645 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -3,10 +3,8 @@
 
 inherit dpkg-base
 
-BUILDCHROOT_DIR = "${BUILDCHROOT_TARGET_DIR}"
-
 # Build package from sources using build script
 dpkg_runbuild() {
     E="${@ bb.utils.export_proxies(d)}"
-    sudo -E chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${PPS}
+    sudo -E chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${PPS} ${DISTRO_ARCH}
 }
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 07/12] linux: Add ARM cross-compilation support
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (5 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 06/12] cross-compilation: Introduce variable switch Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 08/12] isar: Add ARM64 " Alexander Smirnov
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Add possibility to cross-compile ARM target.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/recipes-kernel/linux/files/build-kernel.sh | 24 +++++++++++++++++++++---
 meta/recipes-kernel/linux/linux-custom.inc      |  2 +-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh
index 1ec094e..cc137a8 100644
--- a/meta/recipes-kernel/linux/files/build-kernel.sh
+++ b/meta/recipes-kernel/linux/files/build-kernel.sh
@@ -9,6 +9,22 @@
 
 set -e
 
+host_arch=$(dpkg --print-architecture)
+target_arch=$2
+
+if [ "$host_arch" != "$target_arch" ]; then
+    case $target_arch in
+    armhf)
+        export ARCH=arm
+        export CROSS_COMPILE="arm-linux-gnueabihf-"
+        ;;
+    *)
+        echo "error: unsupported architecture ($target_arch)"
+        exit 1
+        ;;
+    esac
+fi
+
 REPACK_DIR="$1/../repack"
 REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
 REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
@@ -29,7 +45,7 @@ if [ "${KV}" != "${PV}" ]; then
 fi
 
 rm -f .version
-make -j $(($(nproc) * 2)) deb-pkg
+KBUILD_DEBARCH=$target_arch make -j $(($(nproc) * 2)) deb-pkg
 
 rm -rf ${REPACK_DIR}
 mkdir -p ${REPACK_DIR}
@@ -49,7 +65,8 @@ dpkg-gencontrol -crepack/debian/control \
 	-DPackage="linux-image-${KERNEL_NAME}" \
 	-DSection=kernel \
 	-DPriority=required \
-	-DDepends="${KERNEL_DEBIAN_DEPENDS}"
+	-DDepends="${KERNEL_DEBIAN_DEPENDS}" \
+	-DArchitecture=$target_arch
 
 # Add Debian-like link installation to postinst
 touch ${REPACK_LINUX_IMAGE_DIR}/lib/modules/${PV}/.fresh-install
@@ -82,7 +99,8 @@ dpkg-gencontrol -crepack/debian/control \
 	-Vkernel:debarch="${KERNEL_NAME}" \
 	-DPackage="linux-headers-${KERNEL_NAME}" \
 	-DSection=kernel \
-	-DDepends="${KERNEL_HEADERS_DEBIAN_DEPENDS}"
+	-DDepends="${KERNEL_HEADERS_DEBIAN_DEPENDS}" \
+	-DArchitecture=$target_arch
 
 dpkg-deb -b ${REPACK_LINUX_IMAGE_DIR} \
 	linux-image-${KERNEL_NAME}_${PV}-1_${KERNEL_NAME}.deb
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 1176b25..d5fc5a6 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -43,5 +43,5 @@ dpkg_runbuild() {
 	export KERNEL_DEBIAN_DEPENDS="${KERNEL_DEBIAN_DEPENDS}"
 	export KERNEL_HEADERS_DEBIAN_DEPENDS="${KERNEL_HEADERS_DEBIAN_DEPENDS}"
 
-	sudo -E chroot ${BUILDCHROOT_DIR} /build-kernel.sh ${PP}/${PPS}
+	sudo -E chroot ${BUILDCHROOT_DIR} /build-kernel.sh ${PP}/${PPS} ${DISTRO_ARCH}
 }
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 08/12] isar: Add ARM64 cross-compilation support
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (6 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 07/12] linux: Add ARM cross-compilation support Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 09/12] linux-module: Export ARCH and CROSS_COMPILE Alexander Smirnov
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Add possibility to cross-compile ARM64 target.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/recipes-devtools/buildchroot/buildchroot-host.bb | 3 +++
 meta/recipes-kernel/linux/files/build-kernel.sh       | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/meta/recipes-devtools/buildchroot/buildchroot-host.bb b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
index 048998d..daf92a2 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot-host.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
@@ -26,6 +26,9 @@ BUILDCHROOT_PREINSTALL ?= "make \
 #     http://emdebian.org/tools/debian/
 BUILDCHROOT_PREINSTALL_append_armhf += "binutils-arm-linux-gnueabihf \
                                         crossbuild-essential-armhf"
+BUILDCHROOT_PREINSTALL_append_arm64 += "binutils-aarch64-linux-gnu \
+                                        crossbuild-essential-arm64"
+
 
 PARAMS = "--host-arch"
 do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_bootstrap"
diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh
index cc137a8..8b58e93 100644
--- a/meta/recipes-kernel/linux/files/build-kernel.sh
+++ b/meta/recipes-kernel/linux/files/build-kernel.sh
@@ -18,6 +18,10 @@ if [ "$host_arch" != "$target_arch" ]; then
         export ARCH=arm
         export CROSS_COMPILE="arm-linux-gnueabihf-"
         ;;
+    arm64)
+        export ARCH=arm64
+        export CROSS_COMPILE="aarch64-linux-gnu-"
+        ;;
     *)
         echo "error: unsupported architecture ($target_arch)"
         exit 1
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 09/12] linux-module: Export ARCH and CROSS_COMPILE
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (7 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 08/12] isar: Add ARM64 " Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 10/12] linux: Drop gcc from dependencies Alexander Smirnov
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Export necessary kernel variables to be able to cross-build modules.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/recipes-kernel/linux-module/files/debian/rules | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/recipes-kernel/linux-module/files/debian/rules b/meta/recipes-kernel/linux-module/files/debian/rules
index 46cf977..95206b7 100755
--- a/meta/recipes-kernel/linux-module/files/debian/rules
+++ b/meta/recipes-kernel/linux-module/files/debian/rules
@@ -11,5 +11,17 @@ export KDIR=$(shell ls -d /lib/modules/*/build)
 
 export DEB_BUILD_OPTIONS=parallel=$(shell nproc)
 
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+
+ifeq ($(DEB_HOST_GNU_CPU), arm)
+export ARCH=arm
+endif
+ifeq ($(DEB_HOST_GNU_CPU), arm64)
+export ARCH=arm64
+endif
+ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU)))
+export ARCH=x86
+endif
+
 %:
 	CFLAGS= LDFLAGS= dh $@ --parallel
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 10/12] linux: Drop gcc from dependencies
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (8 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 09/12] linux-module: Export ARCH and CROSS_COMPILE Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 11/12] doc: Provide some notes about cross-compilation Alexander Smirnov
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

This dependency pulls target tools what conflicts with the host ones.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/recipes-kernel/linux/linux-custom.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index d5fc5a6..87d4377 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -26,7 +26,7 @@ SRC_URI += "file://build-kernel.sh"
 
 KBUILD_DEPENDS ?= "libssl-dev libelf-dev bc"
 KERNEL_DEBIAN_DEPENDS ?= "initramfs-tools | linux-initramfs-tool, kmod, linux-base (>= 4.3~)"
-KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, libssl1.1, gcc"
+KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, libssl1.1"
 
 dpkg_runbuild() {
 	# Install package builder script
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 11/12] doc: Provide some notes about cross-compilation
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (9 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 10/12] linux: Drop gcc from dependencies Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-07-30 19:39 ` [PATCH v5 12/12] scripts/ci_build.sh: Add cross-compilation test Alexander Smirnov
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Provide general overview and steps how to enable cross-compilation in
Isar.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 doc/technical_overview.md | 49 ++++++++++++++++++++++++++++++++++-------------
 doc/user_manual.md        | 27 ++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/doc/technical_overview.md b/doc/technical_overview.md
index ab62de9..ddd2c79 100644
--- a/doc/technical_overview.md
+++ b/doc/technical_overview.md
@@ -57,24 +57,29 @@ Typical example, when Isar builds the following configurations:
 
  - Debian Stretch, i386
 
-In this case there will be 3 different buildchroots, so standard hello demo
-application should be processed 3 times for each environment. Three different
-sets of stamps should be used for correct bitbake operating.
+In this case there will be 3 different build subtrees. So the standard
+example-hello demo application will be processed 3 times for each
+environment. Three different sets of stamps will be used to distinguish
+build progress between different bitbake configurations.
 
 ## 2.3 Buildchroot
 
 One of the key aspect of Debian philosophy claims the fact, that everything in
-Debian should be built within Debian environment. Moreover native compilation
-is more preferable than cross-compilation. To follow this rules, Isar
+Debian should be built within Debian environment. To follow this rule, Isar
 introduces the new component - buildchroot. Bulidchroot is typical Debian
 filesystem that is created using standard Debian tools: debootstrap, apt. The
 source of packages can be either official Debian repositories or custom
-repositories created by user.
+repositories created by user. Buildchroot could be one of the following type:
+
+ - `buildchroot-host` with the host architecture for cross-compilation.
+
+ - `buildchroot-target` with the target architecture for target native
+   compilation.
 
 Buildchroot lifecycle can be described as following:
 
  - Buildchroot starts out with a minimal base system that was generated by the
-   isar-bootstrap recipe that uses debootstrap and apt.
+   isar-bootstrap-[host,target] recipe that uses debootstrap and apt.
 
  - During building custom Debian package, list of its build dependencies is
    installed to buildchroot.
@@ -85,7 +90,8 @@ Buildchroot lifecycle can be described as following:
 ## 2.4 Target Root Filesystem
 
 Target filesystem is quite similar to buildchroot. The only difference is that
-it doesn't have development packages installed.
+it doesn't have development packages installed and always has target
+architecture.
 
 Target filesystem lifecycle can be described as following:
 
@@ -93,7 +99,8 @@ Target filesystem lifecycle can be described as following:
    system generated by the isar-bootstrap recipe.
 
  - According to the list of custom packages in bitbake recipes, the initial
-   filesystem will be populated by successfully built packages.
+   filesystem will be populated by successfully built packages from locally
+   created Isar repository.
 
 # 3 Isar Internal Processes
 
@@ -120,7 +127,7 @@ All these steps are described in details below.
 ## 3.2 Minimal base system
 
 A minimal base system is generated by the isar-bootstrap recipe found here:
-`meta/recipes-core/isar-bootstrap/isar-bootstrap.bb`.
+`meta/recipes-core/isar-bootstrap/isar-bootstrap-[host,target].bb`.
 
 This recipe implements several tasks which are executed in this order:
 
@@ -155,9 +162,12 @@ This recipe implements several tasks which are executed in this order:
 As mentioned above, initial buildchroot is generated using the minimal base
 system generated by isar-bootstrap. The bitbake recipe which is responsible for
 buildchroot can be found here:
-`meta/recipes-devtools/buildchroot/buildchroot.bb`
+`meta/recipes-devtools/buildchroot/buildchroot-[host,target].bb`
 
-This recipe implementes `do_build` task which performs the following:
+Section 3.8 describes when host or target architecture is used, please refer
+to it for more details.
+
+This recipe implements `do_build` task which performs the following:
 
 1. Calls the `setup_root_file_system` helper function defined in
    `meta/classes/isar-bootstrap-helper.bbclass` that copies the minimal base
@@ -191,7 +201,8 @@ here: `meta-isar/recipes-core/images/files`, and it implements `do_build` task.
 Isar provides the possibility to build Debian packages from sources. This
 feature works with Debian-like source packages, i.e. the source code tree
 should contain debian folder. This build process is implemented in
-`meta/classes/dpkg.bbclass`.
+`meta/classes/dpkg.bbclass`. Moreover this process is common for both: native
+and cross compilation modes.
 
 Another way of creating Debian packages is implemented in
 `meta/classes/dpkg-raw.bbclass`. This class can be used for customizations that
@@ -247,3 +258,15 @@ This process contains the following steps:
 
    1.1. `do_ext4_image`: target filesystem is packed to extfs image.
    1.2. `do_wic_image`: a bootable disk image gets created for the platform
+
+## 3.8 Cross-compilation
+
+Isar provides possibility to cross-compile all or individual packages. There is
+variable ISAR_CROSS_COMPILE that could be set globaly for whole Isar build,
+but also it could be overwritten from the individual recipe to force specific
+compilation mode for it. This variable influences on which buildchroot will be
+used for recipe compilation. Isar is free from packages modification to perform
+cross-compilation, this is done by the same tools as for native compilation.
+Depending on ISAR_CROSS_COMPILE value, additional architecture specifiers are
+passed to build tools automatically, so this is absolutely transparent from
+the user point of view.
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 7549d26..4e7f29a 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -17,6 +17,7 @@ Copyright (C) 2016-2017, ilbers GmbH
  - [Add a New Image](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#add-a-new-image)
  - [Add a New Image Type](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#add-a-new-image-type)
  - [Add a Custom Application](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#add-a-custom-application)
+ - [Enabling Cross-compilation](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#isar-cross-compilation)
  - [Create an ISAR SDK root filesystem](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#create-an-isar-sdk-root-filesystem)
 
 ## Introduction
@@ -582,6 +583,32 @@ For the variables please have a look at the previous example, the following new
 
 Have a look at the `example-raw` recipe to get an idea how the `dpkg-raw` class can be used to customize your image.
 
+## Isar Cross-compilation
+
+### Motivation
+
+binfmt is a powerful feature that makes possible to run foreign architectures like ARM on x86 hosts. But at the same the performance of
+such emulation is quite low. For the cases when lots of packages should be built from sources, a cross-compilation support could be very
+useful.
+
+### Solution
+
+Cross-compilation mode could be enabled by using the `ISAR_CROSS_COMPILE` variable. This variable could be set in both:
+
+ - In `local.conf` to set cross-compilation mode to be the default option for the whole build.
+ - In specific recipe to overwrite global settings. This could be useful when package doesn't support cross-compilation, so the following line
+   should be added to its recipe: `ISAR_CROSS_COMPILE := "0"`.
+
+The cross-building process is absolutely the same as for native compilation, no extra tasks are added and removed: newly built packages are
+put into Isar apt.
+
+### Limitation
+
+Debian cross-compilation works out of the box starting from Debian stretch distribution. So currently the only following build configurations are supported in Isar:
+
+ - qemuarm-stretch
+ - qemuarm64-stretch
+
 ## Create an ISAR SDK root filesystem
 
 ### Motivation
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v5 12/12] scripts/ci_build.sh: Add cross-compilation test
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (10 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 11/12] doc: Provide some notes about cross-compilation Alexander Smirnov
@ 2018-07-30 19:39 ` Alexander Smirnov
  2018-08-02 19:00 ` [PATCH v5 00/12] Cross-compilation Alexander Smirnov
  2018-08-06  7:57 ` Maxim Yu. Osipov
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-07-30 19:39 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov

Add possibility to test cross-compilation for all the supported
configurations.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 scripts/ci_build.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index fec0000..6e9a4eb 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -50,6 +50,9 @@ do
         BUILD_DIR="$2"
         shift
         ;;
+    -c|--cross)
+        CROSS_BUILD="1"
+        ;;
     -d|--debug)
         BB_ARGS="$BB_ARGS -d"
         ;;
@@ -71,8 +74,14 @@ if [ ! -d $BUILD_DIR ]; then
 fi
 source isar-init-build-env $BUILD_DIR
 
-# Start build for all possible configurations
-bitbake $BB_ARGS \
+if [ -n "$CROSS_BUILD" ]; then
+    sed -i -e 's/ISAR_CROSS_COMPILE ?= "0"/ISAR_CROSS_COMPILE ?= "1"/g' conf/local.conf
+    bitbake $BB_ARGS \
+        multiconfig:qemuarm-stretch:isar-image-base \
+        multiconfig:qemuarm64-stretch:isar-image-base
+else
+    # Start build for all possible configurations
+    bitbake $BB_ARGS \
         multiconfig:qemuarm-wheezy:isar-image-base \
         multiconfig:qemuarm-jessie:isar-image-base \
         multiconfig:qemuarm-stretch:isar-image-base \
@@ -82,3 +91,4 @@ bitbake $BB_ARGS \
         multiconfig:qemuamd64-jessie:isar-image-base \
         multiconfig:qemuamd64-stretch:isar-image-base \
         multiconfig:rpi-jessie:isar-image-base
+fi
-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 05/12] build.sh: Add additional parameter
  2018-07-30 19:39 ` [PATCH v5 05/12] build.sh: Add additional parameter Alexander Smirnov
@ 2018-08-01 14:51   ` Alexander Smirnov
  2018-08-02  4:05     ` Maxim Yu. Osipov
  2018-08-02  7:56     ` Henning Schild
  0 siblings, 2 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-08-01 14:51 UTC (permalink / raw)
  To: isar-users

On 30.07.2018 22:39, Alexander Smirnov wrote:
> Pass target architecture as a parameter for build.
> 
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> ---
>   meta/recipes-devtools/buildchroot/files/build.sh | 17 +++++++++++++++--
>   1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
> index 73c0889..c2967d2 100644
> --- a/meta/recipes-devtools/buildchroot/files/build.sh
> +++ b/meta/recipes-devtools/buildchroot/files/build.sh
> @@ -6,6 +6,19 @@
>   
>   set -e
>   
> +# Create human-readable names
> +target_arch=$2
> +
> +# Notes:
> +#   mk-build-deps for jessie and jtretch has different parameter name to specify
> +#   host architecture.
> +debian_version=$(cut -c1 /etc/debian_version)
> +if [ $(($debian_version)) -ge 9 ]; then

Damn! This doesn't work on stretch:

$ cat /etc/debian_version
stretch/sid

But on jessie there were numbers. Will fix this.

Alex

> +    set_arch="--host-arch $target_arch"
> +else
> +    set_arch="-a $target_arch"
> +fi
> +
>   # Go to build directory
>   cd $1
>   
> @@ -36,7 +49,7 @@ install_cmd="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y
>           -o APT::Get::List-Cleanup="0"
>   
>       # Install all build deps
> -    mk-build-deps -t "${install_cmd}" -i -r debian/control
> +    mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
>   ) 42>/dpkg.lock
>   
>   # If autotools files have been created, update their timestamp to
> @@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am Makefile.in; do
>   done
>   
>   # Build the package
> -dpkg-buildpackage
> +dpkg-buildpackage -a$target_arch
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 05/12] build.sh: Add additional parameter
  2018-08-01 14:51   ` Alexander Smirnov
@ 2018-08-02  4:05     ` Maxim Yu. Osipov
  2018-08-02  7:56     ` Henning Schild
  1 sibling, 0 replies; 21+ messages in thread
From: Maxim Yu. Osipov @ 2018-08-02  4:05 UTC (permalink / raw)
  To: Alexander Smirnov, isar-users

On 08/01/2018 05:51 PM, Alexander Smirnov wrote:
> On 30.07.2018 22:39, Alexander Smirnov wrote:
>> Pass target architecture as a parameter for build.
>>
>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>> ---
>>   meta/recipes-devtools/buildchroot/files/build.sh | 17 +++++++++++++++--
>>   1 file changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh 
>> b/meta/recipes-devtools/buildchroot/files/build.sh
>> index 73c0889..c2967d2 100644
>> --- a/meta/recipes-devtools/buildchroot/files/build.sh
>> +++ b/meta/recipes-devtools/buildchroot/files/build.sh
>> @@ -6,6 +6,19 @@
>>   set -e
>> +# Create human-readable names
>> +target_arch=$2
>> +
>> +# Notes:
>> +#   mk-build-deps for jessie and jtretch has different parameter name 
>> to specify
>> +#   host architecture.
>> +debian_version=$(cut -c1 /etc/debian_version)
>> +if [ $(($debian_version)) -ge 9 ]; then
> 
> Damn! This doesn't work on stretch:
> 
> $ cat /etc/debian_version
> stretch/sid

> But on jessie there were numbers. Will fix this.

It should work on stretch -
I've a couple of stretch installations:

cat /etc/debian_version
9.0

cat etc/debian_version
9.5

Kind regards,
Maxim.

> Alex
> 
>> +    set_arch="--host-arch $target_arch"
>> +else
>> +    set_arch="-a $target_arch"
>> +fi
>> +
>>   # Go to build directory
>>   cd $1
>> @@ -36,7 +49,7 @@ install_cmd="apt-get -o 
>> Debug::pkgProblemResolver=yes --no-install-recommends -y
>>           -o APT::Get::List-Cleanup="0"
>>       # Install all build deps
>> -    mk-build-deps -t "${install_cmd}" -i -r debian/control
>> +    mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
>>   ) 42>/dpkg.lock
>>   # If autotools files have been created, update their timestamp to
>> @@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am 
>> Makefile.in; do
>>   done
>>   # Build the package
>> -dpkg-buildpackage
>> +dpkg-buildpackage -a$target_arch
>>
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 05/12] build.sh: Add additional parameter
  2018-08-01 14:51   ` Alexander Smirnov
  2018-08-02  4:05     ` Maxim Yu. Osipov
@ 2018-08-02  7:56     ` Henning Schild
  2018-08-02 11:05       ` Alexander Smirnov
  1 sibling, 1 reply; 21+ messages in thread
From: Henning Schild @ 2018-08-02  7:56 UTC (permalink / raw)
  To: Alexander Smirnov; +Cc: isar-users

Am Wed, 1 Aug 2018 17:51:57 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:

> On 30.07.2018 22:39, Alexander Smirnov wrote:
> > Pass target architecture as a parameter for build.
> > 
> > Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> > ---
> >   meta/recipes-devtools/buildchroot/files/build.sh | 17
> > +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta/recipes-devtools/buildchroot/files/build.sh
> > b/meta/recipes-devtools/buildchroot/files/build.sh index
> > 73c0889..c2967d2 100644 ---
> > a/meta/recipes-devtools/buildchroot/files/build.sh +++
> > b/meta/recipes-devtools/buildchroot/files/build.sh @@ -6,6 +6,19 @@
> >   
> >   set -e
> >   
> > +# Create human-readable names
> > +target_arch=$2
> > +
> > +# Notes:
> > +#   mk-build-deps for jessie and jtretch has different parameter
> > name to specify +#   host architecture.
> > +debian_version=$(cut -c1 /etc/debian_version)
> > +if [ $(($debian_version)) -ge 9 ]; then  
> 
> Damn! This doesn't work on stretch:
> 
> $ cat /etc/debian_version
> stretch/sid

Maybe that is an old installation when stretch was still sid?
What does "lsb_release -r" say on that machine? That might be the
better tool, instead of looking directly at the file.
And it might be a good idea to turn the logic around. So if the check
somehow does not work we default to "new".

Henning

> But on jessie there were numbers. Will fix this.
> 
> Alex
> 
> > +    set_arch="--host-arch $target_arch"
> > +else
> > +    set_arch="-a $target_arch"
> > +fi
> > +
> >   # Go to build directory
> >   cd $1
> >   
> > @@ -36,7 +49,7 @@ install_cmd="apt-get -o
> > Debug::pkgProblemResolver=yes --no-install-recommends -y -o
> > APT::Get::List-Cleanup="0" 
> >       # Install all build deps
> > -    mk-build-deps -t "${install_cmd}" -i -r debian/control
> > +    mk-build-deps $set_arch -t "${install_cmd}" -i -r
> > debian/control ) 42>/dpkg.lock
> >   
> >   # If autotools files have been created, update their timestamp to
> > @@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am
> > Makefile.in; do done
> >   
> >   # Build the package
> > -dpkg-buildpackage
> > +dpkg-buildpackage -a$target_arch
> >   
> 


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 05/12] build.sh: Add additional parameter
  2018-08-02  7:56     ` Henning Schild
@ 2018-08-02 11:05       ` Alexander Smirnov
  2018-08-02 17:05         ` Henning Schild
  0 siblings, 1 reply; 21+ messages in thread
From: Alexander Smirnov @ 2018-08-02 11:05 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

Hi everybody,

On 02.08.2018 10:56, Henning Schild wrote:
> Am Wed, 1 Aug 2018 17:51:57 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> 
>> On 30.07.2018 22:39, Alexander Smirnov wrote:
>>> Pass target architecture as a parameter for build.
>>>
>>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>>> ---
>>>    meta/recipes-devtools/buildchroot/files/build.sh | 17
>>> +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh
>>> b/meta/recipes-devtools/buildchroot/files/build.sh index
>>> 73c0889..c2967d2 100644 ---
>>> a/meta/recipes-devtools/buildchroot/files/build.sh +++
>>> b/meta/recipes-devtools/buildchroot/files/build.sh @@ -6,6 +6,19 @@
>>>    
>>>    set -e
>>>    
>>> +# Create human-readable names
>>> +target_arch=$2
>>> +
>>> +# Notes:
>>> +#   mk-build-deps for jessie and jtretch has different parameter
>>> name to specify +#   host architecture.
>>> +debian_version=$(cut -c1 /etc/debian_version)
>>> +if [ $(($debian_version)) -ge 9 ]; then
>>
>> Damn! This doesn't work on stretch:
>>
>> $ cat /etc/debian_version
>> stretch/sid
> 
> Maybe that is an old installation when stretch was still sid?
> What does "lsb_release -r" say on that machine? That might be the
> better tool, instead of looking directly at the file.
> And it might be a good idea to turn the logic around. So if the check
> somehow does not work we default to "new".
> 

Sorry for the false alarm, I was in Ubuntu 16.04 chroot. :-( For Debian 
it's correct:

$ cat /etc/debian_version
9.5

Alex

> Henning
> 
>> But on jessie there were numbers. Will fix this.
>>
>> Alex
>>
>>> +    set_arch="--host-arch $target_arch"
>>> +else
>>> +    set_arch="-a $target_arch"
>>> +fi
>>> +
>>>    # Go to build directory
>>>    cd $1
>>>    
>>> @@ -36,7 +49,7 @@ install_cmd="apt-get -o
>>> Debug::pkgProblemResolver=yes --no-install-recommends -y -o
>>> APT::Get::List-Cleanup="0"
>>>        # Install all build deps
>>> -    mk-build-deps -t "${install_cmd}" -i -r debian/control
>>> +    mk-build-deps $set_arch -t "${install_cmd}" -i -r
>>> debian/control ) 42>/dpkg.lock
>>>    
>>>    # If autotools files have been created, update their timestamp to
>>> @@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am
>>> Makefile.in; do done
>>>    
>>>    # Build the package
>>> -dpkg-buildpackage
>>> +dpkg-buildpackage -a$target_arch
>>>    
>>
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 05/12] build.sh: Add additional parameter
  2018-08-02 11:05       ` Alexander Smirnov
@ 2018-08-02 17:05         ` Henning Schild
  2018-08-02 18:16           ` Alexander Smirnov
  0 siblings, 1 reply; 21+ messages in thread
From: Henning Schild @ 2018-08-02 17:05 UTC (permalink / raw)
  To: Alexander Smirnov; +Cc: isar-users

Am Thu, 2 Aug 2018 14:05:12 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:

> Hi everybody,
> 
> On 02.08.2018 10:56, Henning Schild wrote:
> > Am Wed, 1 Aug 2018 17:51:57 +0300
> > schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> >   
> >> On 30.07.2018 22:39, Alexander Smirnov wrote:  
> >>> Pass target architecture as a parameter for build.
> >>>
> >>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> >>> ---
> >>>    meta/recipes-devtools/buildchroot/files/build.sh | 17
> >>> +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh
> >>> b/meta/recipes-devtools/buildchroot/files/build.sh index
> >>> 73c0889..c2967d2 100644 ---
> >>> a/meta/recipes-devtools/buildchroot/files/build.sh +++
> >>> b/meta/recipes-devtools/buildchroot/files/build.sh @@ -6,6 +6,19
> >>> @@ 
> >>>    set -e
> >>>    
> >>> +# Create human-readable names
> >>> +target_arch=$2
> >>> +
> >>> +# Notes:
> >>> +#   mk-build-deps for jessie and jtretch has different parameter
> >>> name to specify +#   host architecture.
> >>> +debian_version=$(cut -c1 /etc/debian_version)
> >>> +if [ $(($debian_version)) -ge 9 ]; then  
> >>
> >> Damn! This doesn't work on stretch:
> >>
> >> $ cat /etc/debian_version
> >> stretch/sid  
> > 
> > Maybe that is an old installation when stretch was still sid?
> > What does "lsb_release -r" say on that machine? That might be the
> > better tool, instead of looking directly at the file.
> > And it might be a good idea to turn the logic around. So if the
> > check somehow does not work we default to "new".
> >   
> 
> Sorry for the false alarm, I was in Ubuntu 16.04 chroot. :-( For
> Debian it's correct:

Did you experiment with building Ubuntu images with Isar? That is
something i thought about. Not that i want Ubuntu for anything, the
opposite is true, but to get those communities looking at Isar.

Henning

> $ cat /etc/debian_version
> 9.5
> 
> Alex
> 
> > Henning
> >   
> >> But on jessie there were numbers. Will fix this.
> >>
> >> Alex
> >>  
> >>> +    set_arch="--host-arch $target_arch"
> >>> +else
> >>> +    set_arch="-a $target_arch"
> >>> +fi
> >>> +
> >>>    # Go to build directory
> >>>    cd $1
> >>>    
> >>> @@ -36,7 +49,7 @@ install_cmd="apt-get -o
> >>> Debug::pkgProblemResolver=yes --no-install-recommends -y -o
> >>> APT::Get::List-Cleanup="0"
> >>>        # Install all build deps
> >>> -    mk-build-deps -t "${install_cmd}" -i -r debian/control
> >>> +    mk-build-deps $set_arch -t "${install_cmd}" -i -r
> >>> debian/control ) 42>/dpkg.lock
> >>>    
> >>>    # If autotools files have been created, update their timestamp
> >>> to @@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am
> >>> Makefile.in; do done
> >>>    
> >>>    # Build the package
> >>> -dpkg-buildpackage
> >>> +dpkg-buildpackage -a$target_arch
> >>>      
> >>  
> >   


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 05/12] build.sh: Add additional parameter
  2018-08-02 17:05         ` Henning Schild
@ 2018-08-02 18:16           ` Alexander Smirnov
  0 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-08-02 18:16 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

Hi Henning,

On 02.08.2018 20:05, Henning Schild wrote:
> Am Thu, 2 Aug 2018 14:05:12 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> 
>> Hi everybody,
>>
>> On 02.08.2018 10:56, Henning Schild wrote:
>>> Am Wed, 1 Aug 2018 17:51:57 +0300
>>> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>>>    
>>>> On 30.07.2018 22:39, Alexander Smirnov wrote:
>>>>> Pass target architecture as a parameter for build.
>>>>>
>>>>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>>>>> ---
>>>>>     meta/recipes-devtools/buildchroot/files/build.sh | 17
>>>>> +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh
>>>>> b/meta/recipes-devtools/buildchroot/files/build.sh index
>>>>> 73c0889..c2967d2 100644 ---
>>>>> a/meta/recipes-devtools/buildchroot/files/build.sh +++
>>>>> b/meta/recipes-devtools/buildchroot/files/build.sh @@ -6,6 +6,19
>>>>> @@
>>>>>     set -e
>>>>>     
>>>>> +# Create human-readable names
>>>>> +target_arch=$2
>>>>> +
>>>>> +# Notes:
>>>>> +#   mk-build-deps for jessie and jtretch has different parameter
>>>>> name to specify +#   host architecture.
>>>>> +debian_version=$(cut -c1 /etc/debian_version)
>>>>> +if [ $(($debian_version)) -ge 9 ]; then
>>>>
>>>> Damn! This doesn't work on stretch:
>>>>
>>>> $ cat /etc/debian_version
>>>> stretch/sid
>>>
>>> Maybe that is an old installation when stretch was still sid?
>>> What does "lsb_release -r" say on that machine? That might be the
>>> better tool, instead of looking directly at the file.
>>> And it might be a good idea to turn the logic around. So if the
>>> check somehow does not work we default to "new".
>>>    
>>
>> Sorry for the false alarm, I was in Ubuntu 16.04 chroot. :-( For
>> Debian it's correct:
> 
> Did you experiment with building Ubuntu images with Isar? That is
> something i thought about. Not that i want Ubuntu for anything, the
> opposite is true, but to get those communities looking at Isar.
> 

Not yet, but I agree with, that this would be helpful. Let me try at 
least Ubuntu 16.04 will come back with the results.

Alex

> Henning
> 
>> $ cat /etc/debian_version
>> 9.5
>>
>> Alex
>>
>>> Henning
>>>    
>>>> But on jessie there were numbers. Will fix this.
>>>>
>>>> Alex
>>>>   
>>>>> +    set_arch="--host-arch $target_arch"
>>>>> +else
>>>>> +    set_arch="-a $target_arch"
>>>>> +fi
>>>>> +
>>>>>     # Go to build directory
>>>>>     cd $1
>>>>>     
>>>>> @@ -36,7 +49,7 @@ install_cmd="apt-get -o
>>>>> Debug::pkgProblemResolver=yes --no-install-recommends -y -o
>>>>> APT::Get::List-Cleanup="0"
>>>>>         # Install all build deps
>>>>> -    mk-build-deps -t "${install_cmd}" -i -r debian/control
>>>>> +    mk-build-deps $set_arch -t "${install_cmd}" -i -r
>>>>> debian/control ) 42>/dpkg.lock
>>>>>     
>>>>>     # If autotools files have been created, update their timestamp
>>>>> to @@ -48,4 +61,4 @@ for i in configure aclocal.m4 Makefile.am
>>>>> Makefile.in; do done
>>>>>     
>>>>>     # Build the package
>>>>> -dpkg-buildpackage
>>>>> +dpkg-buildpackage -a$target_arch
>>>>>       
>>>>   
>>>    
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 00/12] Cross-compilation
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (11 preceding siblings ...)
  2018-07-30 19:39 ` [PATCH v5 12/12] scripts/ci_build.sh: Add cross-compilation test Alexander Smirnov
@ 2018-08-02 19:00 ` Alexander Smirnov
  2018-08-06  7:57 ` Maxim Yu. Osipov
  13 siblings, 0 replies; 21+ messages in thread
From: Alexander Smirnov @ 2018-08-02 19:00 UTC (permalink / raw)
  To: isar-users

Hi all,

good news, seems this series works for buster also:

$ bitbake multiconfig:qemuarm-buster:example-hello
$ find tmp/deploy/apt/debian-buster/ -name '*.deb'
tmp/deploy/apt/debian-buster/pool/main/h/hello/example-hello-dbgsym_0.2_armhf.deb
tmp/deploy/apt/debian-buster/pool/main/h/hello/example-hello_0.2_armhf.deb
tmp/deploy/apt/debian-buster/pool/main/libh/libhello/libhello-dbgsym_0.1_armhf.deb
tmp/deploy/apt/debian-buster/pool/main/libh/libhello/libhello_0.1_armhf.deb
tmp/deploy/apt/debian-buster/pool/main/libh/libhello/libhello-dev_0.1_armhf.deb

P.S.: I took buster series posted here by Henning.

Alex

On 30.07.2018 22:39, Alexander Smirnov wrote:
> Hi all,
> 
> this is v5 for cross-compilation.
> 
> Updates since v4:
>   - Fix 'cut' call according to the Henning's hint
>   - Add documentation
>   - Add cross parameter to the ci_build script
> 
> Alex
> 
> Alexander Smirnov (12):
>    isar-bootstrap: Update routine to determine host arch
>    buildchroot: Split generic part
>    buildchroot: Add host buildchroot
>    isar-bootstrap-helper: Add target architecture for dpkg
>    build.sh: Add additional parameter
>    cross-compilation: Introduce variable switch
>    linux: Add ARM cross-compilation support
>    isar: Add ARM64 cross-compilation support
>    linux-module: Export ARCH and CROSS_COMPILE
>    linux: Drop gcc from dependencies
>    doc: Provide some notes about cross-compilation
>    scripts/ci_build.sh: Add cross-compilation test
> 
>   doc/technical_overview.md                          | 49 ++++++++++++++++------
>   doc/user_manual.md                                 | 27 ++++++++++++
>   meta-isar/conf/local.conf.sample                   |  5 +++
>   .../example-module/example-module.bb               |  7 ++++
>   meta/classes/dpkg-base.bbclass                     | 19 +++++++--
>   meta/classes/dpkg.bbclass                          |  4 +-
>   meta/classes/isar-bootstrap-helper.bbclass         | 13 +++++-
>   meta/classes/wic-img.bbclass                       |  3 +-
>   meta/conf/isar-bitbake.conf                        |  3 +-
>   .../buildchroot/buildchroot-host.bb                | 34 +++++++++++++++
>   .../{buildchroot.bb => buildchroot-target.bb}      | 35 ++--------------
>   meta/recipes-devtools/buildchroot/buildchroot.inc  | 37 ++++++++++++++++
>   meta/recipes-devtools/buildchroot/files/build.sh   | 17 +++++++-
>   .../recipes-kernel/linux-module/files/debian/rules | 12 ++++++
>   meta/recipes-kernel/linux/files/build-kernel.sh    | 28 +++++++++++--
>   meta/recipes-kernel/linux/linux-custom.inc         |  4 +-
>   scripts/ci_build.sh                                | 14 ++++++-
>   17 files changed, 248 insertions(+), 63 deletions(-)
>   create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-host.bb
>   rename meta/recipes-devtools/buildchroot/{buildchroot.bb => buildchroot-target.bb} (58%)
>   create mode 100644 meta/recipes-devtools/buildchroot/buildchroot.inc
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v5 00/12] Cross-compilation
  2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
                   ` (12 preceding siblings ...)
  2018-08-02 19:00 ` [PATCH v5 00/12] Cross-compilation Alexander Smirnov
@ 2018-08-06  7:57 ` Maxim Yu. Osipov
  13 siblings, 0 replies; 21+ messages in thread
From: Maxim Yu. Osipov @ 2018-08-06  7:57 UTC (permalink / raw)
  To: Alexander Smirnov, isar-users

On 07/30/2018 10:39 PM, Alexander Smirnov wrote:
> Hi all,
> 
> this is v5 for cross-compilation.
> 
> Updates since v4:
>   - Fix 'cut' call according to the Henning's hint
>   - Add documentation
>   - Add cross parameter to the ci_build script

Applied to the 'next',

Thank you very much,
Maxim.

> Alex
> 
> Alexander Smirnov (12):
>    isar-bootstrap: Update routine to determine host arch
>    buildchroot: Split generic part
>    buildchroot: Add host buildchroot
>    isar-bootstrap-helper: Add target architecture for dpkg
>    build.sh: Add additional parameter
>    cross-compilation: Introduce variable switch
>    linux: Add ARM cross-compilation support
>    isar: Add ARM64 cross-compilation support
>    linux-module: Export ARCH and CROSS_COMPILE
>    linux: Drop gcc from dependencies
>    doc: Provide some notes about cross-compilation
>    scripts/ci_build.sh: Add cross-compilation test
> 
>   doc/technical_overview.md                          | 49 ++++++++++++++++------
>   doc/user_manual.md                                 | 27 ++++++++++++
>   meta-isar/conf/local.conf.sample                   |  5 +++
>   .../example-module/example-module.bb               |  7 ++++
>   meta/classes/dpkg-base.bbclass                     | 19 +++++++--
>   meta/classes/dpkg.bbclass                          |  4 +-
>   meta/classes/isar-bootstrap-helper.bbclass         | 13 +++++-
>   meta/classes/wic-img.bbclass                       |  3 +-
>   meta/conf/isar-bitbake.conf                        |  3 +-
>   .../buildchroot/buildchroot-host.bb                | 34 +++++++++++++++
>   .../{buildchroot.bb => buildchroot-target.bb}      | 35 ++--------------
>   meta/recipes-devtools/buildchroot/buildchroot.inc  | 37 ++++++++++++++++
>   meta/recipes-devtools/buildchroot/files/build.sh   | 17 +++++++-
>   .../recipes-kernel/linux-module/files/debian/rules | 12 ++++++
>   meta/recipes-kernel/linux/files/build-kernel.sh    | 28 +++++++++++--
>   meta/recipes-kernel/linux/linux-custom.inc         |  4 +-
>   scripts/ci_build.sh                                | 14 ++++++-
>   17 files changed, 248 insertions(+), 63 deletions(-)
>   create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-host.bb
>   rename meta/recipes-devtools/buildchroot/{buildchroot.bb => buildchroot-target.bb} (58%)
>   create mode 100644 meta/recipes-devtools/buildchroot/buildchroot.inc
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-08-06  7:57 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 19:39 [PATCH v5 00/12] Cross-compilation Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 01/12] isar-bootstrap: Update routine to determine host arch Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 02/12] buildchroot: Split generic part Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 03/12] buildchroot: Add host buildchroot Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 04/12] isar-bootstrap-helper: Add target architecture for dpkg Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 05/12] build.sh: Add additional parameter Alexander Smirnov
2018-08-01 14:51   ` Alexander Smirnov
2018-08-02  4:05     ` Maxim Yu. Osipov
2018-08-02  7:56     ` Henning Schild
2018-08-02 11:05       ` Alexander Smirnov
2018-08-02 17:05         ` Henning Schild
2018-08-02 18:16           ` Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 06/12] cross-compilation: Introduce variable switch Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 07/12] linux: Add ARM cross-compilation support Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 08/12] isar: Add ARM64 " Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 09/12] linux-module: Export ARCH and CROSS_COMPILE Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 10/12] linux: Drop gcc from dependencies Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 11/12] doc: Provide some notes about cross-compilation Alexander Smirnov
2018-07-30 19:39 ` [PATCH v5 12/12] scripts/ci_build.sh: Add cross-compilation test Alexander Smirnov
2018-08-02 19:00 ` [PATCH v5 00/12] Cross-compilation Alexander Smirnov
2018-08-06  7:57 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox