From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 800433E0C70; Wed, 20 May 2026 17:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779296723; cv=none; b=q/EEMoglvx/e6Tumn0I/U0jkxQG4XlW5sf7ty28MtWLnzm01rwEjTZKnzPH3g/q2Unp6KMhV9WrqNt8m04zwlDRwRR20L8+uNY/eSuB29PBI893wGvIZbvZaD8OSTMR3gwulKv1LGLsidjUCfbsFV7wfCrv4G6PJeC+3Y8ZVPF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779296723; c=relaxed/simple; bh=FgURfTNWx3AMIdyDyVa+vIz/hYWdog3B6298yq7ZP/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Se/fvJTeNnxuoltfKFDvwwxC8HykRt89YZeCMUUMTtDnsF7X5jToy3SdzSsIU4JtNgBCmOPVPm8HxrP9fq5bvMnN7C32S1tRAhz1FXDZUKLrKqIjWMmqNFX8dvhZiYTQNOUH3k2zaOL8YdXdEX7gbiRc5J94ST1MkC4Ml1io6AE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MuJ9kCz+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MuJ9kCz+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4C6A1F000E9; Wed, 20 May 2026 17:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779296722; bh=Ljo+mf1Cu7tC4IYrNRrxBjkMWLNVHnnoV6he+8YYHkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MuJ9kCz+ihn0OkaUDe2Y6JWgC06qaSPN2DuMu1D5tUAyfq6zIcB5N1qmnZkGs3nO0 c6j9rQXDlaaQh1gCWYbDyzncqsYhs2PZdM6iwqMUNJ1nELxyewl3OOPZmbe+jFiumU YZPpbnF6ugiWORTFs4MExOgzKSqvuJJ+4nRMdrzw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mathias Krause , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Sasha Levin Subject: [PATCH 7.0 0870/1146] kbuild: builddeb - avoid recompiles for non-cross-compiles Date: Wed, 20 May 2026 18:18:40 +0200 Message-ID: <20260520162207.927543971@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mathias Krause [ Upstream commit 2452dcf4d740effff5aa71b7f6529ee8c04fd8f6 ] Commit e2c318225ac1 ("kbuild: deb-pkg: add pkg.linux-upstream.nokernelheaders build profile") changed how install-extmod-build gets called, making it always rebuild the host programs below scripts/ if HOSTCC wasn't specified with its full triplet on the make command line. That is, apparently, needed to fix up commit f1d87664b82a ("kbuild: cross-compile linux-headers package when possible") for cross-compiles. However, in the much more common case of non-cross-compile builds this will lead to unnecessary rebuilding of host tools including gcc plugins. This, in turn, will lead to a full kernel rebuild on the next 'make bindeb-pkg' which is unfortunate. Avoid that by only triggering the rebuild of host tools for actual cross-compile builds. Signed-off-by: Mathias Krause Fixes: e2c318225ac1 ("kbuild: deb-pkg: add pkg.linux-upstream.nokernelheaders build profile") Cc: Masahiro Yamada Reviewed-by: Nathan Chancellor Reviewed-by: Nicolas Schier Link: https://patch.msgid.link/20260402145116.1010901-1-minipli@grsecurity.net Signed-off-by: Nicolas Schier Signed-off-by: Sasha Levin --- scripts/package/builddeb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 3627ca227e5a5..ba1defc616524 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -139,7 +139,13 @@ install_kernel_headers () { pdir=debian/$1 version=${1#linux-headers-} - CC="${DEB_HOST_GNU_TYPE}-gcc" "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" + # Override $CC only for cross-compiles, to not unnecessarily rebuild + # scripts/ including plugins, which may lead to a full kernel rebuild. + if [ -n "${CROSS_COMPILE}" ]; then + CC="${DEB_HOST_GNU_TYPE}-gcc" "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" + else + "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" + fi mkdir -p $pdir/lib/modules/$version/ ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build -- 2.53.0