From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6572049490740510720 X-Received: by 2002:a1c:15d4:: with SMTP id 203-v6mr332275wmv.31.1530296922981; Fri, 29 Jun 2018 11:28:42 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:ef02:: with SMTP id n2-v6ls576789wmh.3.canary-gmail; Fri, 29 Jun 2018 11:28:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfOSOFyUdNua8imIxjGYquQmylbzNwDlbSkFuzSEWNSFS8K5c/+BZ5bWnekhOMRRs0iut3Z X-Received: by 2002:a1c:300e:: with SMTP id w14-v6mr351392wmw.30.1530296922549; Fri, 29 Jun 2018 11:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530296922; cv=none; d=google.com; s=arc-20160816; b=ESeYxKCTxcfDoV3MZxo8RSaHYQLVywk0pi+GbuplxKuFAbngAfFLD5bCxfWoFrUGpc R8PsAxf98TFZq+abW3kY12fXE/qyJzM5QKv5YRDHEZivB2Pn4ttNmQO2hHie9JUZ9iDa QVYb7QDQVQquDkpMVD4XiTFlK7vQwUbtfLHoYmPr97JDEKJWeuUnMJuf4uVpecSbze5T lz5Ol+Gv++oiPP3ZL/6uS0OAA9oXCbNOviHPR+CYiAbt2fmE7QTlGalfuWlKcOqUm7rQ gZ2V36MaJ5djhWiIz6hD9SJ3lzo1u8XBgb1RUMcg64mywZYNtLQZB/FpcCLKWM7hslE2 sxMg== 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:from:references:to:subject:arc-authentication-results; bh=AbVbwLu+cEp1kkkPcKUtMdZcTMy6qhAZp3atB5AOYs8=; b=t1+/MsMcicZX4SPFemxX8e8YDK3t4sTMHujUsj6p0YVvJm5C54LGMmKRYkuqxUBKG4 Qjrbo6IzXq+JR2UF/k3wAeKAwIlJHXexZ04Ym7+bqAx4dGebTywHO97Y/nFgMQ4I6uiL MPoDTmdUGbZFUYfhg2xbWReCTbPjX+sOrpfj2LUAEkIZjxfpjB+CTuEhK2Wb9ht32PGi Kmr320Fu+bc71Qk7y/CWk07Drg3Y40+mv+kVfD7uC0EqYgG3YJmlXJCLXf8bAT8OT1g3 P+k8YKYjSHzMbLvetcSLFJRZvHkmyUyyYPQPduS/9u7njEh95uMl5uUL8WGJvdGJJoD5 WEEg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@web.de designates 212.227.15.3 as permitted sender) smtp.mailfrom=jan.kiszka@web.de Return-Path: Received: from mout.web.de (mout.web.de. [212.227.15.3]) by gmr-mx.google.com with ESMTPS id v25-v6si59052wmh.2.2018.06.29.11.28.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 11:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@web.de designates 212.227.15.3 as permitted sender) client-ip=212.227.15.3; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@web.de designates 212.227.15.3 as permitted sender) smtp.mailfrom=jan.kiszka@web.de Received: from [192.168.1.10] ([95.157.57.47]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LhyU6-1fuVBI0IxW-00nAHY; Fri, 29 Jun 2018 20:28:42 +0200 Subject: Re: [PATCH v2 00/12] Cross-compilation To: Alexander Smirnov , isar-users@googlegroups.com References: <20180628082810.3571-1-asmirnov@ilbers.de> From: Jan Kiszka Openpgp: preference=signencrypt Autocrypt: addr=jan.kiszka@web.de; prefer-encrypt=mutual; keydata= xsDhBEq0i8QRBAD2wOxlC9m/8t/vqjm1U9yQCT6OJ2Wbv/qys9DYM0CvcOTDMWQwmV1/VsZj KR5YgB5NPt+To7X6x5cjz15AGnx5Fb8Wnrq8EF9ZfHMwb7YMx1LdPYPDnXr37wE3XupFmkHB Mes4htyX7Dz8LvKDLn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zHx06RKZluFYpPF3DRduSMukdIJ2wmWCU+ohB+mYefe65JGjYQfHVs8mgYVFOPx bRea9VJACCMuspoZWpj43UdR1lLLyIUFYz+jqcPW7Hd/GTIw4N67pYl0dwPDmFd4ohJ5g4Zp q61toNysBGEuEm5GCcn0VmGtQpSYnR5cVm5b2yPz4bIuFOSuZUo/l7vitdY0iy0/wvKbBC+N K8JJBBgRAgAJBQJKtIvEAhsMAAoJEIrUrG965ecULvAAoKGvxs5T3IhyQT8I8sMsyAvCE4wH AJ46S16yab+OxNkvOeoOEX0EnHVHaA== Message-ID: <2cfafe36-f81b-8493-3ddc-f154194c7fbc@web.de> Date: Fri, 29 Jun 2018 20:28: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: <20180628082810.3571-1-asmirnov@ilbers.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pzqRFkT0lcgWCrY596KsEej3ZJivCVsJw" X-Provags-ID: V03:K1:HW+3jb75rbhXupqW5kSB1yOI8q9E3kgLP6JgrhQgQ69K1Vcw1fM r3ne+OEQR4BLAprBuQhc4wqzrZfgoZBkskc+kaOI0PkNJ40ZlwJr+0bal7zhjb8tzKnd6oG BP10bJ+UVue1sR7axAuKuggiMokNgyfcbh/jiJ1tuy7FD5Gar8dHnk9tbvhXWybzV0v+CBN ERljwPeXRSB++19S4UCgg== X-UI-Out-Filterresults: notjunk:1;V01:K0:oU4i1PDZC4E=:Mq5ZN/7MZrgxfg3WI+0qlL vHsb9Ve82GjEM84l1fwuENXv6YG62uS6Kag0ne0cgyaUs7Kkqpj4IEnDvcKFv37B1QtZgL7rn 39hiohAfKk2RO9iQbJKFlYgLiwzMguRx35IQ3Asg9Uzoqlw7urXsm1QLQbcYytZ92ytuYcBdB SpuJT6YwvVat5+2udykCIodRPdpJkouMmPmzTSAkEluRPoYkStr1EO9Wt9vsAMAzRVxqRn2OJ Mwro6pDylyxSo9sUzhgQKHfqEcfsmfoxCSDc68FGEPzEJj/GTjEdQ/iMwwWfNkrh8ODZKmeyv mAB2mkQsQHIg0rzWN/BLaNnmdyjqFc8mu1AbjBUOBU1P87863aPGbGwT317rMf3GAkmK04jVo KyCPcSE/95r6i0DsRzJmOkHNEJ23NzZruASBKFoDUFor4t1m1AXHq/17XYT9/7ddKIH6mNVt3 WuoyLxW3M3oIH6LpiGK99b4Pz/2DzmqmfoG2cRXaxvsO7vh9MtbDYNdXxJDRvWJXS7CPpvi0W xBMz8U6o85TGqplrpWAk9V5vRF4Zu1Ewgyb35CpXv06N1LXVVBZmAy4ZiaDeJRn+7sGxqC6B/ 1aTIHaHgmabLkRgUd+26FLYoALaCteT6kVHNQTnYaxmCwtH+MvsOiI061RZfRf/eQ8MyCewkW qhfb5ntstprchvDdxxyQJhM8KrK+uMHZqCYkORz20z9VyFTF9gp28q30nlHJIGeyd4UiCJ9BI PSCcMYNLhIYlqrzNs/ZEkBv+TXfqyQR1z7BPs+LERjoK7O8guWspDAKyEho= X-TUID: 8ObtkoVb1YRB This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pzqRFkT0lcgWCrY596KsEej3ZJivCVsJw Content-Type: multipart/mixed; boundary="abfSkJzxBSNjAOwo4qvEJjVHQ7PXIIbjE"; protected-headers="v1" From: Jan Kiszka To: Alexander Smirnov , isar-users@googlegroups.com Message-ID: <2cfafe36-f81b-8493-3ddc-f154194c7fbc@web.de> Subject: Re: [PATCH v2 00/12] Cross-compilation References: <20180628082810.3571-1-asmirnov@ilbers.de> In-Reply-To: <20180628082810.3571-1-asmirnov@ilbers.de> --abfSkJzxBSNjAOwo4qvEJjVHQ7PXIIbjE Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-06-28 10:27, Alexander Smirnov wrote: > Hi all, >=20 > [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 se= ries > has intersection with SDK one, so it should be rebased after SDK is app= lied > to next. Thanks! > [/NOTE] >=20 > here is the second version of cross-compilation support. > This version adds support for cross-compiling stretch-armhf target. >=20 > What's new here: > - Build dependencies are resolved automatically, so isar-image-base co= uld be > built using cross-compilation only (libhello, example-hello, example= -raw) > - Linux kernel could be also cross-compiled now for arm >=20 > 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 >=20 > 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 QEMU= >=20 > Issue: > 1. No support for jessie. The main issue here, that jessie doesn't have= > 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 se= em > to work incorrectly. If set both of them in deps list I got unexisti= ng > packages. Now I use --host-arch only and it works good. I want to ch= eck > this in buster and then probably ask Debian community reagrding this= > 3. i386 architecture for now is not considered as a target for cross > compilation > 4. Currently libhello and example-hello applications have hardcoded nat= ive > compilation (inherit dpkg). This should be reworked to depend on > ISAR_CROSS_COMPILE variable >=20 > Huh, no more ideas, let's start with this. I've started to play with this series (on top of next before the SDK series got merged). Setup: - https://github.com/siemens/jailhouse-images - KAS_TARGET=3Dmulticonfig:orangepi-zero-jailhouse:xradio ./build-images= =2Esh Findings: - Kernel build works - Module build does not yet. So I've hacked this in: ---8<--- diff --git a/meta/recipes-kernel/linux-module/files/debian/control b/meta= /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-k= ernel/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<--- 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. Still, modules don't built, we also need to feed in ARCH=3D to the build. Didn't hack that up so far. - This, well, interesting package I was able to "cross"-compile as well: https://github.com/siemens/jailhouse-images/blob/master/recipes-core/n= on-root-initramfs/non-root-initramfs_2018.05.bb It required the following change (beside "inherit dpkg-cross"): ---8<--- diff --git a/recipes-core/non-root-initramfs/files/debian/control b/recip= es-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:a= md64, bc Maintainer: Jan Kiszka =20 Package: non-root-initramfs ---8<--- 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. 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. Thanks, Jan --abfSkJzxBSNjAOwo4qvEJjVHQ7PXIIbjE-- --pzqRFkT0lcgWCrY596KsEej3ZJivCVsJw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTKX4wA9fvIVGYBbICK1KxveuXnFAUCWzZ6WQAKCRCK1KxveuXn FOEpAKDMf+8aorfjDB7bjSXI4D7NNZUCBACdG2tCBQziI8e8rNINT+VC+cjZves= =ks8d -----END PGP SIGNATURE----- --pzqRFkT0lcgWCrY596KsEej3ZJivCVsJw--