From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6572049490740510720 X-Received: by 2002:a50:fc04:: with SMTP id i4-v6mr3996982edr.10.1530349552530; Sat, 30 Jun 2018 02:05:52 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:d2d8:: with SMTP id k24-v6ls3493538edr.1.gmail; Sat, 30 Jun 2018 02:05:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcbzSwJPZJdUimRzrudGB45SpyTkAjwhrW7lR1xlq9wIgmWzU4BZDM2+uup6k3rP5ZAt6jK X-Received: by 2002:a50:fd14:: with SMTP id i20-v6mr3995120eds.9.1530349552076; Sat, 30 Jun 2018 02:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530349552; cv=none; d=google.com; s=arc-20160816; b=AxW6ZFSMTT/2pyfMQMQT3BBvYZo2MTNZoEzxmSL1fPnrX43CLTIa2lSFbA4xPUGHdh xJsyhcbBk0i+fkAoQKZljEGMcbzZxjq7tEJ31RqK/HwxvfuPR8jpvw6c+1BtOO+5/EYI XrVoeyeULAcEIBgfBEfb0rufuVaFfmlexVn/ZTadA1YFESJOQVYzbfEZku1xc2ke4rpO tHr3vnAnBUMjtrE3zVA75dT5cQ23MDiexpilG1lGQe0ThKRioTxx+m5cgSu/j7Hth7BI yMPH5rHD2kXohIL4xeOPVnvdmtcShvYDORdg7nN1LfU0xdmwEs3SaeQYFFqxE0MJtp0K Yj7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:mime-version:user-agent:date:message-id:autocrypt :openpgp:references:to:from:subject:arc-authentication-results; bh=mYSrQhubowHhH7qCsFcrApcXvVi5nU2l3o/tk/tPZd0=; b=gJwzDsDGCtL3MfpK1PlAFKoJOhojdHhCpwOlZP+Wutur2DLIiIPzhimDytKKYXmqIb 0j7N3Lqo43fETKAeTB8+KHVEu5sqWoPpQmwE6tKiIbTfBFwZwxc+K7tyB58PdKQKJI2w lAe0NxIc+SzwEfP9pPZd3XkKqfg8/0L8Ca2zkIGGegFv3OGDPPA5B/g51bHuOeJyl8yc kg98fyXC0T/INxNFTz+5t4a4xsTIO8jf21z3RTwH9LAVrLbLqOzD9kwO465DG9wka/yB 9F+JGD1e3RD9HKaM5GWZKVHoPLYjtuoYRdfemd9xsV7Z6xv7IyWTEbI3ITxLpJpwKfE1 Y9mg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@web.de designates 217.72.192.78 as permitted sender) smtp.mailfrom=jan.kiszka@web.de Return-Path: Received: from mout.web.de (mout.web.de. [217.72.192.78]) by gmr-mx.google.com with ESMTPS id x7-v6si515265edh.5.2018.06.30.02.05.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jun 2018 02:05:52 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@web.de designates 217.72.192.78 as permitted sender) client-ip=217.72.192.78; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@web.de designates 217.72.192.78 as permitted sender) smtp.mailfrom=jan.kiszka@web.de Received: from [192.168.1.10] ([95.157.57.47]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MgfJz-1fkP9c1iqN-00Nx7f; Sat, 30 Jun 2018 11:05:51 +0200 Subject: Re: [PATCH v2 00/12] Cross-compilation From: Jan Kiszka To: Alexander Smirnov , isar-users@googlegroups.com References: <20180628082810.3571-1-asmirnov@ilbers.de> <2cfafe36-f81b-8493-3ddc-f154194c7fbc@web.de> Openpgp: preference=signencrypt Autocrypt: addr=jan.kiszka@web.de; prefer-encrypt=mutual; keydata= xsDhBEq0i8QRBAD2wOxlC9m/8t/vqjm1U9yQCT6OJ2Wbv/qys9DYM0CvcOTDMWQwmV1/VsZj KR5YgB5NPt+To7X6x5cjz15AGnx5Fb8Wnrq8EF9ZfHMwb7YMx1LdPYPDnXr37wE3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4klh9QwgwFZxUBzOdI vttwzG1QkzHx06RKZluFYpPF3DRduSMukdIJ2wmWCU+ohB+mYefe65JGjYQfHVs8mgYVFOPx bRea9VJACCMuspoZWpj43UdR1lLLyIUFYz+jqcPW7Hd/GTIw4N67pYl0dwPDmFd4ohJ5g4Zp q61toNysBGEuEm5GCcn0VmGtQpSYnR5cVm5b2yPz4bIuFOSuZUo/l7vitdY0iy0/wvKbBC+N K8JJBBgRAgAJBQJKtIvEAhsMAAoJEIrUrG965ecULvAAoKGvxs5T3IhyQT8I8sMsyAvCE4wH AJ46S16yab+OxNkvOeoOEX0EnHVHaA== Message-ID: <3a2ba0b9-0461-991a-df26-c4b46437d7f8@web.de> Date: Sat, 30 Jun 2018 11:05:41 +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: <2cfafe36-f81b-8493-3ddc-f154194c7fbc@web.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2alF9X2YO2vLsLABw3pyJqFg2JqE2B6Qq" X-Provags-ID: V03:K1:bbmfDTECue/dfLIz9yqPftruxlO5ioGdbgDpmlugm7xCm8PvfWW wcA6Bl5BJOi2/SXGSFf2AV70mrRUrTm4P0CJqS0ppBFdxbKuc6J+OOm183wHohD4MZKR9OK YUgBnvRT9A9VeCKeIxVz5R9/oKjQTKbQYjsMeblYQv0QgHDcn287oyAwf0v5OM45Qrt6AxF YbEBOWkEs/Xu0/czlUTFA== X-UI-Out-Filterresults: notjunk:1;V01:K0:ywVrQBDW8KU=:EYrmqjLzM1kKBFMlE4GAzh fs4l295M7IahAXjnIP8f2M3XjIzmlcFnZbfebO8F5byBSOf09bCCCFKA4aYgab7wDJ933s16w BN0aQ/tZIjj47/AcAvlFKlZfFLJ23APyROpiygfNZLBIN1qbV5Wi+ZiIPtrdmle6/+UAXGVgi SpC4V1f5EgRoh0pm1BfXfEYmjn/wWKlHyNdHBZ73UVLBGKDvnwaC8oup28ta6zzGzbwbiBFnF rkyI06tPbiMkFKUJMdjA1mC5ttfEevcQoGWtAy7bDAiifqSDJMtrwvn8q2c3wqXxtp4Um/zrc +r+xHaGDYcUNLQPdH1uUfyJJ69YqfeV6XNbgYMtM8VMj7ji8cd2YpXcoZqolz4O0zPG4bUVBN nELMwitlTZblvZRrAw4JCQc0p5uNX0BOn2WhVRPyAiuYgZfcwIYpCjua6t9dnYW2tP61L/LbZ Lv5P4sde6Yn4TIl3rnJ+gEqXIU1ukzfZsX6wrlgA3GwOGD6B0myXX3pI6fZiniFU4geyvoWdT /W3EQ70hd3bgr96MkynZyZ1gsthPlkItWZ+GquCbWHAZSAbB87ao9JNpGUCcnFcNAzr4gSodg Si41BV6KGO478UOMW0zKUm7FnSKs0VMBf3j4IVHe4TJmUGUxd7OM1s0vEqJqSE2tbjlo9+G/j a+d8IRMDgCRKhUNfLytnYw5EPsyrGsDEFk6ZgS5HnAASTWl8cs2sxnrTr2karrqIdDgnZbgNd ByEcScWtqIADx/RAVtVl2dKVKGAZ7BEPmCMpKSJAOuJMJ+uLAeO54Uax2WI= X-TUID: qjR5Lo5EFTPL This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2alF9X2YO2vLsLABw3pyJqFg2JqE2B6Qq Content-Type: multipart/mixed; boundary="hzqf0R2RlGPZ2Z7o4KBcmZCvKUE2rd4tB"; protected-headers="v1" From: Jan Kiszka To: Alexander Smirnov , isar-users@googlegroups.com Message-ID: <3a2ba0b9-0461-991a-df26-c4b46437d7f8@web.de> Subject: Re: [PATCH v2 00/12] Cross-compilation References: <20180628082810.3571-1-asmirnov@ilbers.de> <2cfafe36-f81b-8493-3ddc-f154194c7fbc@web.de> In-Reply-To: <2cfafe36-f81b-8493-3ddc-f154194c7fbc@web.de> --hzqf0R2RlGPZ2Z7o4KBcmZCvKUE2rd4tB Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-06-29 20:28, Jan Kiszka wrote: > On 2018-06-28 10:27, Alexander Smirnov wrote: >> Hi all, >> >> [NOTE] >> Cover letter is too long, so I don't expect that you read it all. So= I'd >> like to start with this message to avoid possible question. :-) This s= eries >> has intersection with SDK one, so it should be rebased after SDK is ap= plied >> to next. Thanks! >> [/NOTE] >> >> here is the second version of cross-compilation support. >> This version adds support for cross-compiling stretch-armhf target. >> >> What's new here: >> - Build dependencies are resolved automatically, so isar-image-base c= ould be >> built using cross-compilation only (libhello, example-hello, exampl= e-raw) >> - Linux kernel could be also cross-compiled now for arm >> >> Test scenarios: >> 1. Build isar-image-base: >> - Set variable in local.conf ISAR_CROSS_COMPILE to "1" >> - Edit recipes: libhello and example-hello and replace >> "inherit dpkg" by "inherit dpkg-cross" >> - Build using "bitbake multiconfig:qemuarm-stretch:isar-image-base" >> - With cross-compilation the image is generated twice faster >> >> 2. Build arm kernel: >> - Set variable in local.conf ISAR_CROSS_COMPILE to "1" >> - There is no default arm config, so I derived the one from linux-cip= >> tree: "zx_config" and add it to recipe >> - Build it "bitbake multiconfig:qemuarm-stretch:linux-cip" >> - Aftewards I have the following packages: >> * linux-image-4.4.112-cip18_4.4.112-cip18-1_armhf.deb >> * linux-image-4.4.112-cip18-dbg_4.4.112-cip18-1_armhf.deb >> * linux-headers-4.4.112-cip18_4.4.112-cip18-1_armhf.deb >> - The compilation tooks me about 2-3 minutes. Much faster than in QEM= U >> >> Issue: >> 1. No support for jessie. The main issue here, that jessie doesn't hav= e >> armhf compiler in default apt. Official wiki asks you to use embian= >> apt to get it >> 2. mk-build-deps has two params: --host-arch, --cross-arch. But they s= eem >> to work incorrectly. If set both of them in deps list I got unexist= ing >> packages. Now I use --host-arch only and it works good. I want to c= heck >> this in buster and then probably ask Debian community reagrding thi= s >> 3. i386 architecture for now is not considered as a target for cross >> compilation >> 4. Currently libhello and example-hello applications have hardcoded na= tive >> compilation (inherit dpkg). This should be reworked to depend on >> ISAR_CROSS_COMPILE variable >> >> Huh, no more ideas, let's start with this. >=20 > I've started to play with this series (on top of next before the SDK > series got merged). >=20 > Setup: > - https://github.com/siemens/jailhouse-images > - KAS_TARGET=3Dmulticonfig:orangepi-zero-jailhouse:xradio ./build-imag= es.sh >=20 > Findings: > - Kernel build works > - Module build does not yet. So I've hacked this in: >=20 > ---8<--- > diff --git a/meta/recipes-kernel/linux-module/files/debian/control b/me= ta/recipes-kernel/linux-module/files/debian/control > index 1ee634c..e4af37e 100644 > --- a/meta/recipes-kernel/linux-module/files/debian/control > +++ b/meta/recipes-kernel/linux-module/files/debian/control > @@ -2,7 +2,7 @@ Source: @PN@ > Section: kernel > Priority: optional > Standards-Version: 3.9.6 > -Build-Depends: linux-headers-@KERNEL_NAME@ > +Build-Depends: linux-headers-@KERNEL_NAME@:amd64 > Maintainer: ISAR project > =20 > Package: @PN@ > diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes= -kernel/linux-module/module.inc > index 3075f44..86776c3 100644 > --- a/meta/recipes-kernel/linux-module/module.inc > +++ b/meta/recipes-kernel/linux-module/module.inc > @@ -15,7 +15,7 @@ SRC_URI +=3D "file://debian/" > =20 > AUTOLOAD ?=3D "0" > =20 > -inherit dpkg > +inherit dpkg-cross > =20 > dpkg_runbuild_prepend() { > cp -r ${WORKDIR}/debian ${S}/ > ---8<--- >=20 > An interesting pattern is that I had to add the host architecture to= > the cross-built kernel headers package, or it would not have been > found. This will be needed again below. >=20 > Still, modules don't built, we also need to feed in ARCH=3D target-arch> to the build. Didn't hack that up so far. >=20 > - This, well, interesting package I was able to "cross"-compile as > well: >=20 > https://github.com/siemens/jailhouse-images/blob/master/recipes-core= /non-root-initramfs/non-root-initramfs_2018.05.bb >=20 > It required the following change (beside "inherit dpkg-cross"): >=20 > ---8<--- > diff --git a/recipes-core/non-root-initramfs/files/debian/control b/rec= ipes-core/non-root-initramfs/files/debian/control > index b57ee83..f5eeef1 100644 > --- a/recipes-core/non-root-initramfs/files/debian/control > +++ b/recipes-core/non-root-initramfs/files/debian/control > @@ -2,7 +2,7 @@ Source: non-root-initramfs > Section: misc > Priority: optional > Standards-Version: 3.9.6 > -Build-Depends: build-essential, wget, cpio, unzip, rsync, python, bc > +Build-Depends: build-essential:amd64, wget, cpio, unzip, rsync, python= :amd64, bc > Maintainer: Jan Kiszka > =20 > Package: non-root-initramfs > ---8<--- >=20 > Again, dependency installation failed without explicit host arch > specification for the two packages, but this time they come from > upstream. Any idea why? Obviously, this hack breaks native > compilation now. >=20 > That said, I'm excited to see this nice progress. I suspect we will > quickly sort the issues above out as well, and then more recipes - and > the whole jailhouse-images - will be cross-buildable. >=20 And another finding: ISAR_CROSS_COMPILE has no impact on recipes when the inherit dpkg-cross. This seems to be because of the hard assignment in dpgk-cross.bbclass. But the logic should be: inherit dpkg -> not cross-compatible, only build natively inherit dpkg-cross -> can cross-compile, ISAR_CROSS_COMPILE decides Should be fixed for v3. Thanks Jan > Thanks, > Jan >=20 --hzqf0R2RlGPZ2Z7o4KBcmZCvKUE2rd4tB-- --2alF9X2YO2vLsLABw3pyJqFg2JqE2B6Qq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTKX4wA9fvIVGYBbICK1KxveuXnFAUCWzdH6AAKCRCK1KxveuXn FEkWAJ4uIcQVUqlDFuGtpG4h60mrEs02jQCfdalG0Z9FCTOFo7GcXZO7JNk7AbM= =CFiR -----END PGP SIGNATURE----- --2alF9X2YO2vLsLABw3pyJqFg2JqE2B6Qq--