From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6755821036247187456 X-Received: by 2002:a17:906:f109:: with SMTP id gv9mr7361183ejb.196.1573197733620; Thu, 07 Nov 2019 23:22:13 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:6a4f:: with SMTP id n15ls1434316ejs.0.gmail; Thu, 07 Nov 2019 23:22:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzJGAcCQc29Qpn8ifpfwuOS7lJvip8832Jr+4EB2672QNXIRVFkOZzPS7RUY+0WRmZPlTfG X-Received: by 2002:a17:906:f15:: with SMTP id z21mr7259546eji.119.1573197732972; Thu, 07 Nov 2019 23:22:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573197732; cv=none; d=google.com; s=arc-20160816; b=jL7TD8TGHqB6tWKDMkwj2LilzBVahJwWGbpisYub2l75Su6qD2NP+UfkY9JZV0KMtp neWcdVw5nskqQP3AGz0TZ/cGcKMCFphX/mhL5VfFpNGzYVKA2gy5qIfA7AZh9onWA6mK Tkj1sOEtaMqSciAvIKwurL5uSWF0PeKwKIkdj0pM+HAYRg1TAMKCODL4VCqMXJKneL4E /EJzRelx7wWJoZlMu04fZ3P466MvllWDYHw74045qnOZNaI76WZPeOfVgHyyxZAj3M/i ldcEMlnliujl55qP9zALT7sLTasJ2wtghFdYCK10DcaUOqqUC8h+ls6rEGiFAZLZ4YCR /ldQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject; bh=BCyLz+YnBwY//ZwsI2Kvzz8A8TOdjoygJPP/muQrIZM=; b=lygLPcGyAhIINFPQLi3nBuIDUkSr5JftZ5N5p7LQprR+NgP7E8O8wxFLgMqVMsy28t OPamCWWQWZC7Dihszc+ODFGWMLGjhfKmZnVe58jXvtiMMAcEmZfGm0DLaXAUjdy9YkVV 3d7dkYSR65k6rg8Ty2RzNvz0erIqn043a3/jStVkibyXmdLfCthWApnD/ZsFToBA+wJH 4JzUNFFLAcxbRczhxmuUPzNIijA5E8man3X7+CniMcRwuHgTypschrkAqRedibrq8kuM UvcW5RLxKhoezTdTbaX0/usZKngyB1/FJTWW0IFFVbcTGIfsjsDWlffpCP0exRk7HNpY 41qA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id l37si442867edc.2.2019.11.07.23.22.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2019 23:22:12 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id xA87MC32029517 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Nov 2019 08:22:12 +0100 Received: from [167.87.14.235] ([167.87.14.235]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id xA87MBrG020859; Fri, 8 Nov 2019 08:22:11 +0100 Subject: Re: [PATCH L-C v3 6/7] buildchroot-host: install qemu-static to support hybrid cross-compiles From: Jan Kiszka To: Cedric Hombourger , isar-users@googlegroups.com References: <1573118604-909-1-git-send-email-Cedric_Hombourger@mentor.com> <1573196839-1143-1-git-send-email-Cedric_Hombourger@mentor.com> <1573196839-1143-7-git-send-email-Cedric_Hombourger@mentor.com> <28a6ef09-18f0-8e82-c464-2d2d530718b2@siemens.com> Message-ID: <5d5193de-de14-9cc9-0eea-b5881581ea91@siemens.com> Date: Fri, 8 Nov 2019 08:22:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <28a6ef09-18f0-8e82-c464-2d2d530718b2@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: n5wVDXunv1P9 On 08.11.19 08:14, [ext] Jan Kiszka wrote: > On 08.11.19 08:07, 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. >> >> 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 >> +} >> > > You didn't address my comment on this one. I doubt it's the right approach. > IOW: When we cross-compile linux-headers, the output is for the host architecture only, not for the target. If the resulting package suggest something different, that must be fixed. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux