From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566555412143800320 X-Received: by 2002:a2e:9754:: with SMTP id f20-v6mr544738ljj.21.1529305449770; Mon, 18 Jun 2018 00:04:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:7c05:: with SMTP id x5-v6ls1710917ljc.11.gmail; Mon, 18 Jun 2018 00:04:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKN37KZ3HgX2hhVlJg9+VQ8DpkDxonbVzroRmLM2wwO/lPB7ATDYijlXk5c1lMjevF70cfZ X-Received: by 2002:a2e:8556:: with SMTP id u22-v6mr547096ljj.19.1529305449275; Mon, 18 Jun 2018 00:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529305449; cv=none; d=google.com; s=arc-20160816; b=I+ci2g5sPC+nk0R4EyyeaOCS804ISdfz03DeMs592tLrjMy6TmuWFrFHmEwqCp/PF7 pNyH12LvzGbRMLyLYRECBZlM13V+dEy02zUnUR0FfZMJanyVXBW1fKj+zlb+zhBsEICs NbObVNY4MD86kx/5mi3pY2phw2OR7uIbDln6y4x4j7+FEN/JbUZY/nGGwpEJEoJVwMxX agrEPjzuN58gJwQ0WAaVAdGQFcGwSlWYgIfXq34WdbYYKasnNF9J6/akRm8JZtLafMcN ykQXmQzcRf8ZNQir7RPDw0Sk8cS+VfVZICAszMiBCO8ikOxhaAb2+qoIapLVxiuPp3TR dq3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=dYzaN/HuZDBjfPilxCWeUqWzTODS/A6h0FRGf6bmRs0=; b=cl0j/VIDRWlw/7NLLwCZ++/loxvEk72FxpTCFSDkdUhGsDFKOxEaiHpfw9kCm2nAGR MNfn75p2pDX/8ItuekWctU+zGwgUh4Dlx74t4O1jCfg5OZe9LDWTRs2I+duEX+8BoqrW 1XX/A+Cr5RBHen6STiT7kJldGRVILh4t2CzUuUNa63vh/nmOdIaNa8aXmt6VRsSd9VAA vzY8yZ+TnNz9Clq/GVpkan3aPsarsQvx1UwSzcm8Dn9UsyEyXEKaavjfcVmTUAGBqvdU 5WJ1UwdMop8k5Zw2G4pZk95rzlvnysZ017MmBC3LWqxz74Y6ljYp6SeuG5qurw+28GvB eD/Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id p40-v6si535945lfg.1.2018.06.18.00.04.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 00:04:09 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w5I748eU014874 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jun 2018 09:04:08 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w5I748ec028239; Mon, 18 Jun 2018 09:04:08 +0200 Date: Mon, 18 Jun 2018 09:04:00 +0200 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [RFC] [PATCH 0/9] Initial cross-compilation support Message-ID: <20180618090400.130c721d@md1pvb1c.ad001.siemens.net> In-Reply-To: <78111574-15e2-449f-fb71-626587033863@ilbers.de> References: <20180613130807.2461-1-asmirnov@ilbers.de> <20180614132041.02ee1d78@md1pvb1c.ad001.siemens.net> <78111574-15e2-449f-fb71-626587033863@ilbers.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: OzvA20m4Cjxs Am Sun, 17 Jun 2018 22:41:08 +0300 schrieb Alexander Smirnov : > Hi Henning, > > On 06/14/2018 02:20 PM, Henning Schild wrote: > > Am Wed, 13 Jun 2018 15:07:58 +0200 > > schrieb Alexander Smirnov : > > > >> Hi all, > >> > >> this series introduces basic cross-compilation support for Isar. > >> The implementation is based around new entity - buildchroot-cross, > >> which is quite similar to original buildchroot, but has host > >> architecture. > >> > >> This series tested for the following configuration only: > >> > >> $ bitbake multiconfig:qemui386 > >> > >> In this build: > >> - libhello is cross-compiled > >> - example-hello is compiled traditionally (but it's successfully > >> linked with libhello) > >> > >> TODO list: > >> - Depending on the target architecture, various host tools > >> should be installed. For example binutils package has the > >> following names: > >> * binutils > >> * binutils-x86-64-linux-gnu > >> * binutils-arm-linux-gnueabihf > >> - Cross-dependency installation. This topic is still open for me > >> because 'mk-build-deps' tool doesn't work here correctly. For > >> example package depends on binutils, but instead of installation of > >> 'binutils-arm-linux-gnueabihf' it tries to install 'binutils:armhf' > >> and ruins the rootfs. > > > > mk-build-deps supports the following switches "--arch foo > > --host-arch foo", maybe they help? > > > > Sorry that mess the thread, but the last message in this thread > doesn't contain you comment :-) > > So, I've tried to play with mk-build-deps, but results are really > disappointed: > > 1. mk-build-deps support --host-arch and --build-arch starting from > stretch only, in jessie these parameters are not presented. > > 2. I've tried to run mk-build-deps in stretch for libhello: > > $ mk-build-deps --host-arch amd64 --build-arch i386 debian/control > ... > dpkg -I libhello-cross-build-deps-depends_0.1_amd64.deb > new debian package, version 2.0. > size 2012 bytes: control archive=516 bytes. > 367 bytes, 11 lines control > 283 bytes, 3 lines md5sums > Package: libhello-cross-build-deps-depends > Version: 0.1 > Architecture: amd64 > Maintainer: root > Installed-Size: 9 > Depends: build-essential:i386, crossbuild-essential-amd64:i386, > debhelper (>= 9), docbook-to-man > Section: devel > Priority: optional > Multi-Arch: foreign > Description: build-dependencies for libhello > Dependency package to build the 'libhello' package > > BUT: package 'crossbuild-essential-amd64:i386' does not exists. At > least I wasn't able to find it via apt (I've also added i386 to > source list). > > Another issue during attempts to install generated deps: > > $ apt-get install build-essential:i386 > Reading package lists... Done > Building dependency tree > Reading state information... Done > You might want to run 'apt --fix-broken install' to correct these. > The following packages have unmet dependencies: > build-essential:i386 : Depends: libc6-dev:i386 but it is not going > to be installed or > libc-dev:i386 > Depends: gcc:i386 (>= 4:6.3) but it is not > going to be installed > Depends: g++:i386 (>= 4:6.3) but it is not > going to be installed > Depends: make:i386 > libhello-cross-build-deps : Depends: > crossbuild-essential-amd64:i386 but it is not installable > E: Unmet dependencies. Try 'apt --fix-broken install' with no > packages (or specify a solution). > > It tries to pull target compiler, what is also incorrect behavior. > The cross binutils should be installed instead. > > So, will continue this investigation :-( The stretch+ would not be such a big issue, we already have a few features that will not work for older distros. But since debian upstream does not really support cross, it is not too surprising that it is hard to get working. Since cross will be more of a hack anyways, maybe you can revive the perl (or was it sed) magic that my mk-build-dep patch replaced. We could also think about a variable like "CROSS_BUILD_DEBIAN_DEPENDS" that would by default carry the toolchain etc. and could be extended with whatever all the recipes for the image might need. So instead of actually looking at the recipe, just expect that global image-variable to be all you need. ... Again the whole thing is a hack. Code that tries to use debian/control to install more is optional on top of the general mechanism. Henning > Alex > > > Henning > > > >> So, as usually, comments and suggestions are welcome :-) > >> > >> With best redgards, > >> Alex > >> > >> Alexander Smirnov (9): > >> isar-bootstrap: Add routin to determine host arch > >> isar-bootstrap: Move common part to include > >> isar-bootstrap: Add host architecture support > >> isar-bootstrap-helper: Add parameter to set arch > >> buildchroot-cross: Initial implementation > >> classes/dpkg*: Relocate dependency from buildchroot > >> classes/dpkg*: Drop hardcoded buildchroot blobs > >> classes/dpkg-cross: Initial implementation > >> [FOR TESTING] libhello: Switch to cross compilation > >> > >> meta-isar/recipes-app/libhello/libhello.bb | 2 +- > >> meta/classes/dpkg-base.bbclass | 17 +- > >> meta/classes/dpkg-cross.bbclass | 15 ++ > >> meta/classes/dpkg-raw.bbclass | 7 +- > >> meta/classes/dpkg.bbclass | 7 +- > >> meta/classes/image.bbclass | 2 +- > >> meta/classes/isar-bootstrap-helper.bbclass | 13 +- > >> meta/conf/isar-bitbake.conf | 1 + > >> .../isar-bootstrap/isar-bootstrap-host.bb | 44 ++++ > >> .../isar-bootstrap/isar-bootstrap-target.bb | 44 ++++ > >> meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 259 > >> --------------------- .../recipes-core/isar-bootstrap/isar-bootstrap.inc > >> | 223 > >> ++++++++++++++++++ .../buildchroot/buildchroot-cross.bb > >> | 53 +++++ meta/recipes-devtools/buildchroot/buildchroot.bb | > >> 2 +- .../buildchroot/files/build-cross.sh | 29 +++ > >> 15 files changed, 443 insertions(+), 275 deletions(-) create mode > >> 100644 meta/classes/dpkg-cross.bbclass create mode 100644 > >> meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb create mode > >> 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb > >> delete mode 100644 > >> meta/recipes-core/isar-bootstrap/isar-bootstrap.bb create mode > >> 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc create > >> mode 100644 meta/recipes-devtools/buildchroot/buildchroot-cross.bb > >> create mode 100644 > >> meta/recipes-devtools/buildchroot/files/build-cross.sh > >