From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from e2i55.smtp2go.com (e2i55.smtp2go.com [103.2.140.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46B041BD004 for ; Wed, 23 Oct 2024 15:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.2.140.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697940; cv=none; b=q3M9NIBpZbDNidhYmLbALTMwkdS36rHWF9Mf9ePqnqqmDn3Fk3A+8Uwmhx7A6+t5dRTZI1LN+/PAPh9/FC2UGoWhfT+Kox1oSmbNsCfnmvi8JwHieyN9sW4Nwz6sh8w5A5LHbT6DFogT4qcPvb5BSP+TfabYakSIcZ7PsYMSTT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697940; c=relaxed/simple; bh=TArXztQb+MkM8RiEqijx7IT5RomzWnTWUWB7pS0l0KU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VZ6eKcsTsQ8FI6gksk/6GOl0xNS4bE0uqq43tzOvlMwrNJFg4fq8bxfTf9DIgQAzfcgkUsIDCGyvI4ldQJEPUN6r64nm3i9BbsOTvTbkfec1qg9t3clAiw7JC+JAtzHZfjfJ2TyaQnQ3zh5ZX3C8kOCGDumbrAZbqkpotwsgsxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fjasle.eu; spf=pass smtp.mailfrom=em1174286.fjasle.eu; dkim=fail (0-bit key) header.d=smtpservice.net header.i=@smtpservice.net header.b=ZdvyEUIJ reason="unknown key version"; dkim=pass (2048-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b=QL+66uJz; dkim=pass (1024-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b=gEcH7T0T; arc=none smtp.client-ip=103.2.140.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fjasle.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=em1174286.fjasle.eu Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="unknown key version" (0-bit key) header.d=smtpservice.net header.i=@smtpservice.net header.b="ZdvyEUIJ"; dkim=pass (2048-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b="QL+66uJz"; dkim=pass (1024-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b="gEcH7T0T" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=mp6320.a1-4.dyn; x=1729698835; h=Feedback-ID: X-Smtpcorp-Track:Message-ID:Subject:To:From:Date:Reply-To:Sender: List-Unsubscribe:List-Unsubscribe-Post; bh=PGordEIR45jrNlNrTNYlWgRJv5GwdV7ZsRzwl31sT1s=; b=ZdvyEUIJjKL4Y8JV58zbyPBiCg ZDf6QCgVjTTIChh4bZVgzY3KUsMMFW6WiVy++rZG70rl4jhYqvBJ5TiJK40VIZQ558LmjBAkOl5js 1s6eVTlSlfTsaMciivK1khbnperZ+SRSbiuvnNd4c6ybhDOWN3LeMBDuG7UWoajN1sGu+sqjrVZx7 pb2uSZ4NuzAiQvs/SKGh0RKgFmT4VzHYed1UETWnXAGZQTkNiDxIMqLfLtTY1Uqc0M4lT4uetVy1H gUU9jlRD5GySySTI/6UTGPDUEatV3Q6xxN3H7b2kp9ebnEQG8Kr4ScM1PSB5HSuyrgnFTvhwlEVQ2 T7REtbqg==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fjasle.eu; i=@fjasle.eu; q=dns/txt; s=s1174286; t=1729697935; h=from : subject : to : message-id : date; bh=PGordEIR45jrNlNrTNYlWgRJv5GwdV7ZsRzwl31sT1s=; b=QL+66uJzJbh2+q1wPEungrLnjnVSx0gWCEFmcaNhvyb/GW4LVqAxGEMbRE2ci/02BqRer aTlVSfZRCjqfMVe3JQ3BgOeonYLm5G3u0JMzy7KzZyyGo938qnHwuvEb1VlCWJkX4erSQVX 1MqlGrC7a35wHFto0RQyJI/XHnlUIB/Xia/XTSPFydkChpwYShaK3INR6gxzACTgeQn0ykt 7Cdv7b7Z6p9HKRonS98nkZbPLURejf9LPBWyy/If4K3nW0/umSlcT/AISD99YxL8lx/BER5 1oKGH4lFJdudA7G5bNCbiAIUbdn5FdaA4ztNyBMNgNezVkfvoKZmF+r7G2yg== Received: from [10.176.58.103] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2-S2G) (envelope-from ) id 1t3dR5-cp4XYB-N4; Wed, 23 Oct 2024 15:38:12 +0000 Received: from [10.85.249.164] (helo=leknes.fjasle.eu) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97.1-S2G) (envelope-from ) id 1t3dR4-4o5NDgrnm55-q8BV; Wed, 23 Oct 2024 15:38:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fjasle.eu; s=mail; t=1729697888; bh=TArXztQb+MkM8RiEqijx7IT5RomzWnTWUWB7pS0l0KU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gEcH7T0TYi7Qysti88+ZUXIfIOMyb9BHFoq5nSXCUOKYI0uVGFhK2z48N8Pfy31W9 QhIE/JrdSelmEz4hXq5mbBUvIziHeAzoKiXB8GqSEMdlKSW85YZnX17oZXxwHciQqY JCXEsIrtvGdCMGRG1Yq/uEn3ModBzfiSSV294JxQ= Received: by leknes.fjasle.eu (Postfix, from userid 1000) id 2EC8C3D2A2; Wed, 23 Oct 2024 17:38:08 +0200 (CEST) Date: Wed, 23 Oct 2024 17:38:08 +0200 From: Nicolas Schier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Ben Hutchings , Ron Economos , Bill Wendling , Justin Stitt , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 2/3] kbuild: deb-pkg: add pkg.linux-upstream.nokernelheaders build profile Message-ID: References: <20241022181703.1710116-1-masahiroy@kernel.org> <20241022181703.1710116-2-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241022181703.1710116-2-masahiroy@kernel.org> X-Smtpcorp-Track: occRcLyzTVyx.plzMq-S6cPFX.utDMCg3bKPG Feedback-ID: 1174286m:1174286a9YXZ7r:1174286sX19qKHJLT X-Report-Abuse: Please forward a copy of this message, including all headers, to On Wed, Oct 23, 2024 at 03:16:58AM +0900 Masahiro Yamada wrote: > Since commit f1d87664b82a ("kbuild: cross-compile linux-headers package > when possible"), 'make bindeb-pkg' may attempt to cross-compile the > linux-headers package, but it fails under certain circumstances. > > For example, when CONFIG_MODULE_SIG_FORMAT is enabled on Debian, the > following command fails: > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bindeb-pkg > [ snip ] > Rebuilding host programs with aarch64-linux-gnu-gcc... > HOSTCC debian/linux-headers-6.12.0-rc4/usr/src/linux-headers-6.12.0-rc4/scripts/kallsyms > HOSTCC debian/linux-headers-6.12.0-rc4/usr/src/linux-headers-6.12.0-rc4/scripts/sorttable > HOSTCC debian/linux-headers-6.12.0-rc4/usr/src/linux-headers-6.12.0-rc4/scripts/asn1_compiler > HOSTCC debian/linux-headers-6.12.0-rc4/usr/src/linux-headers-6.12.0-rc4/scripts/sign-file > In file included from /usr/include/openssl/opensslv.h:109, > from debian/linux-headers-6.12.0-rc4/usr/src/linux-headers-6.12.0-rc4/scripts/sign-file.c:25: > /usr/include/openssl/macros.h:14:10: fatal error: openssl/opensslconf.h: No such file or directory > 14 | #include > | ^~~~~~~~~~~~~~~~~~~~~~~ > compilation terminated. > > This commit adds a new profile, pkg.linux-upstream.nokernelheaders, to > guard the linux-headers package. > > There are two options to fix the above issue. > > [option 1] Set the pkg.linux-upstream.nokernelheaders build profile > > $ DEB_BUILD_PROFILES=pkg.linux-upstream.nokernelheaders \ > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bindeb-pkg > > This skips the building of the linux-headers package. > > [option 2] Install the necessary build dependencies > > If you want to cross-compile the linux-headers package, you need to > install additional packages. This is a one-time installation step. > > For example, on Debian, the packages necessary for cross-compiling it > to arm64 can be installed with the following commands: > > # dpkg --add-architecture arm64 > # apt update > # apt install gcc-aarch64-linux-gnu libssl-dev:arm64 > > Fixes: f1d87664b82a ("kbuild: cross-compile linux-headers package when possible") > Reported-by: Ron Economos > Closes: https://lore.kernel.org/all/b3d4f49e-7ddb-29ba-0967-689232329b53@w6rz.net/ > Signed-off-by: Masahiro Yamada > --- > > scripts/package/builddeb | 2 +- > scripts/package/install-extmod-build | 6 ++---- > scripts/package/mkdebian | 9 ++++++++- > 3 files changed, 11 insertions(+), 6 deletions(-) Nice solution and thanks for also documenting option 2. Reviewed-by: Nicolas Schier