From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6755821036247187456 X-Received: by 2002:a6b:7c09:: with SMTP id m9mr1067078iok.139.1572966068904; Tue, 05 Nov 2019 07:01:08 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:3552:: with SMTP id c79ls3742050ila.12.gmail; Tue, 05 Nov 2019 07:01:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyb6bUqQ+OGnI5gSLpgUX8Cxq/gNsQQO7YGKGqFZYXfgKDeQgkAHqEnWA588EADwucS1pTu X-Received: by 2002:a92:7e18:: with SMTP id z24mr14541675ilc.276.1572966067173; Tue, 05 Nov 2019 07:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572966067; cv=none; d=google.com; s=arc-20160816; b=IjYNe3e49z6q2Wr8pMSkDQsdckThagVCUoz2i3/C0rQqY8cnE4OWJ/R55ECCKtj8fY jAo/WUIMRnLbnsTv9dzcbhETmqael1duy0r6E0K3LppA+Kzf5JmfDHqGQfpqjvF21taw 1Jj1TTrYEXgB4AIlS/mOdVsW13t3WZszA9YSNmoL+L7IXod4J6evdJzLZfWM6SA4xeie LJcngb1dcjlszkpy5oWzdw5LPygTODe+kfCYCRwPZ1MIs2ITE6kSvddSmcxEdHDPvkdN hXa97cAW6+NZRBewntOtTsD1OgNNHVjwSKjF7eymvi7u0fsh2FLJGHB8VsHBdl338NHU S0Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject:ironport-sdr :ironport-sdr; bh=qlBfHjAOPQSceLXMbJhhm5qY60EtSxsrrRjOAZ/H2/c=; b=Ugy/4T9QuSprcDzQBhzDsOK8zIg8LdYEU7aKaTb7olXOjSeOSvZd60cYJNR8ZDjGtT H821XtgBhxeg7y7efnAOf8GAVdz8bI0/qjTzZxrHrtbIzvW7VrianpfuiUTNYlel7H54 5VjRBNxfcCWW/Vzg8DSrE6CJn9Ogc0RaZH5gU0HIGWUegoBxsjUqw9gxpZFy1p06ZS5+ +tQXZPf++UPUuIpXScOKeyonkOvwWbeO8yJsbdjFbYcGdBt0MOhtBSpxX+enIXnnpsJU nzVXMDi2e0yegX+ex9Ucm5Wuuar+V9jT6tw8PxS8HmZVi6Xbpb/yE3SZmBaU6ceI9yyI lpJg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id h7si805989iof.1.2019.11.05.07.01.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Nov 2019 07:01:06 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com IronPort-SDR: /2SBEgxtHvLB0XT0eBQv7b3vjYzJhATGQ7bGHC9vIsPCaTUz/1HFqB5jpgf4NdOp6ThaRcbCq1 WJJwTaeUhrMy8i+ZKFKszIkXs3521N39SDJhkE0nCicN51T/85bVLSkeF+pCpG8NtwXRs95A8N +6OpajRgtfe2RYpqiRMvlMJ3maPvr63u29Kfp0UgM3IkNId+48+zkgp2aPTly7cxOolDPkHHXB MDnTw+ghEyRf0sQvR6jyRgSUS0KJHfp+vwub8wN7jBNAWgfrF3BNCnDiq/9qtfrpByJPBoaNXl WGk= X-IronPort-AV: E=Sophos;i="5.68,271,1569312000"; d="scan'208";a="42821060" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 05 Nov 2019 07:01:02 -0800 IronPort-SDR: V2egr0XPC1SLWBHjZPdcwfvTNTNDGAIPjUQ207T9lu9o/GQmvRkd58d662kai0Wq+I5BRDgT30 wDwoPkPj9wMLA+mkRZa/2DK6hC/7UkkIIkuF/LcgnwwAvrZBDRrB9LHMbg3CTc+BAEfG/KIEXZ ZiV1MAzaTGzsOlk+i4odAMeodxHhJHdcpan/9jDuBhK+MpqWbLEYvetETqyboHVKwwXNLxQNCG 8O0o8aHAJNM+fnF6YwBUz7UGmQhXPetSANyR7iA2j9NiNgjVftrAc9urn9u/byP+zsgJOQX/46 ElQ= Subject: Re: [PATCH 6/7] buildchroot-host: install qemu-static to support hybrid cross-compiles To: Jan Kiszka , References: <1572962145-318-1-git-send-email-Cedric_Hombourger@mentor.com> <1572962258-367-1-git-send-email-Cedric_Hombourger@mentor.com> <1572962258-367-2-git-send-email-Cedric_Hombourger@mentor.com> From: Cedric Hombourger Message-ID: <9247cf11-0071-6004-1635-de1cd6ccf74f@mentor.com> Date: Tue, 5 Nov 2019 16:00:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Return-Path: cedric_hombourger@mentor.com X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: QODVJxgjF4E+ On 11/5/2019 3:52 PM, Jan Kiszka wrote: > On 05.11.19 14:57, Cedric Hombourger wrote: >> The Linux kernel has great support for cross-compiling the kernel image >> and modules. There is however no support/mechanism for cross-compiling the >> build tools from its "scripts" directory. While HOSTCC may be set to use >> our cross-compiler, the kernel build infrasture would then try to run >> foreign-arch binaries such as fixdep. The easiest and least intrusive way >> to support this is to enable execution of such binaries via binfmt/qemu >> like we do in the buildchroot-target environment. > What's the use case? Or why didn't we hit this issue so far? when building with the kernel builddeb script, the linux-headers package will include scripts/basic/fixdep compiled for amd64 even though your target architecture is e.g. armhf this went unnoticed because the kernel does not use debhelper and therefore does not benefit from the extra checks/stuff that it does while migrating to custom build/packaging scripts using debhelper, that packaging mistake caused dpkg-buildpackage to fail so things worked before by luck and also because nobody is actually doing on target development/builds (on non x86 machines that is). it is however desirable to have our linux-headers package for arch x (e.g. arm64) include arm64 binaries and not amd64 hope that makes more sense now > Jan > >> Signed-off-by: Cedric Hombourger >> --- >> meta/recipes-devtools/buildchroot/buildchroot-host.bb | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/meta/recipes-devtools/buildchroot/buildchroot-host.bb b/meta/recipes-devtools/buildchroot/buildchroot-host.bb >> index 408ad39..2e76acb 100644 >> --- a/meta/recipes-devtools/buildchroot/buildchroot-host.bb >> +++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb >> @@ -15,3 +15,9 @@ BUILDCHROOT_PREINSTALL ?= " \ >> ${BUILDCHROOT_PREINSTALL_COMMON} \ >> libc6:${DISTRO_ARCH} \ >> crossbuild-essential-${DISTRO_ARCH}" >> + >> +buildchroot_install_files_append() { >> + if [ -e '/usr/bin/qemu-${QEMU_ARCH}-static' ]; then >> + sudo cp '/usr/bin/qemu-${QEMU_ARCH}-static' '${BUILDCHROOT_DIR}/usr/bin/qemu-${QEMU_ARCH}-static' >> + fi >> +} >>