From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.70 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796426497; b=F+IOFKyRMvtLTnpErKY1hTXqKleMmyvnfZhst5Mbj02Hl3xb+p4FBU00O/hM7Q3dWxv+ IPHDv3QQM58aWKS+DD4FyfMh3MP6mZaswhi8BaqJm7fX6nG12GKZE/LUmDZjRzXMqBcjr 5CGbsK+lPZi0flp7rNUtVKX42y72bQeJwIEk2OJ92ps3nbaf5C+u5M3kZmc6sCZ7Wk6Ic tRx48CM38+ee5NW1BCUTGrRbhtutwyXQHOmVvfcL+m1YUqMVdRH93XbnHdkvIIFH7rC+H 5JQRURicnA8R2/VutbwyOaEwuDYDOhOIYYGiiF9rJ8VqMI1is6RNe8wCmP5kZ38qmPA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796426497; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:Mime-Version: X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=+yTJDoJOqp8jdkghb9+wvZsjQmWWGR5VbSfCCIFtAbc=; b=VQihr3AaVRTisbU5YCawqN9vi+AN8Y83MtUpCV6LF/sDVe6Y68oBOnZsWsdbfQ7fUZl1 GXFByfWLb34GedWBvcY1DB+8qLg48xL1sjrriPylWnW+wg76yuqE+altsOVoox/zclsWA 54du9UHq7FpYWL1ZciTENwhUA1X9KExX8H1GQwT1ukSshT44nvjszAPWFJwK/O9arvywe xBD+2vyHx74rDgxuw3a8UtYW5KzWRbId+aOrOExLrwzrrJ/MxFH2wBmU+yAff/PwUNKoO Il5X5lU1ZWIMUkO8tUP+j3qT1pRjGfDlnLnegqRKaCpjfSbFIjP7dR6GrOD1+EM7lbA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--elsk.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=pcAfnoOu; arc=none smtp.remote-ip=209.85.216.70 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 504D2606A32D for ; Fri, 4 Dec 2026 23:21:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 504D2606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--elsk.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=pcAfnoOu Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3b4cd0f7abfso1881832a91.3 for ; Fri, 04 Dec 2026 15:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796426495; x=1797031295; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=+yTJDoJOqp8jdkghb9+wvZsjQmWWGR5VbSfCCIFtAbc=; b=pcAfnoOuRPkqiYtwdVmtAeqGyCSrusA0xvLu1qn0UQmC4IfivLNTb9523K9zA0CxXx nZwczOw+dmR+b9xixgmtBcFE4lVTfUFqccoLlH9OSvS8fdNIu/sjn/VMhnWSwLEneunt PvJC8L18FnewHzHFME/Ag7KTCGvYlCit62BkGo0+ak+RH0Kub1Zo6KqhggyZRJ18J7Li HEr9XPzFwG9WbWX4BRk0u4ixH9qKLYUvfzY0A5gzqYzmzk1OuArQl42K0ghZx9+Tbd+8 hxb/vA5mPVn/C/Y4DMHXtFh2d46TqAv3ZsHcXP1OPITQucUc6stySoXUz1i2vdrtia7n wKMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796426495; x=1797031295; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+yTJDoJOqp8jdkghb9+wvZsjQmWWGR5VbSfCCIFtAbc=; b=xVFpyovrs9JEhryA/a/LffC5c+4vKfevNNt4bMypGgwIwmBc1Sd+BXQdpgmvRbFB+F ZIvY+61OXvFp7IgYgjUcxdIEbyiTlqYko/wyaqHon4YjtkQ6k+lneyoFvoevoiN46jrY nF/o+zZUHF/yCwnUMysWffa8vEumcFhsIIpNcCI1ThxGsOaCIWukc+tSXy4TnQrenSpz VCTzsmuFTgIaSQz68kohRx7ZZGV/7RLdpw2EpCQ89J23OXdr+A8G4WGw1m5ESa5S+FzU Rh3r0q02G7xElzwJYdM7nJSGQCPcxtgYyXMyCHOraUDuucVu7RHr/OJxcFQOzyrkqecV X4DA== X-Forwarded-Encrypted: i=1; AL+hErFrFR1jeoYTMMvSFCNlA9XQ7I5U1k5UhopsAeHiZBZfSeZZtohDm4YpNTCmFEf0G87mMTGqkmprGoseu5k=@vger.kernel.org X-Gm-Message-State: AB4q+uE3RcaJ0Lp0WHCKhX9UNHdTo1ui+I/p+sazaepjjsEyzQcUx/zL mmGX3BQvGvmdZdMikeTjVJfLU9OdEZwazbKHkRist/v5HLfxtInGVRF+AAnwdHhyr5FWiPh55w= = X-Received: from pjsc6.prod.google.com ([2002:a17:90a:bf06:b0:3b0:944b:61fc]) (user=elsk job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4d8c:b0:3b4:9a2:9a2f with SMTP id 98e67ed59e1d1-3b5e0653970mr3210582a91.14.1796426495358; Fri, 04 Dec 2026 15:21:35 -0800 (PST) Date: Fri, 4 Dec 2026 23:21:02 +0000 X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261204232102.1380500-1-elsk@google.com> Subject: [PATCH] kbuild: avoid recursive make headers when HEADER_ARCH is set From: HONG Yifan To: Nathan Chancellor , Nicolas Schier Cc: "=?UTF-8?q?Thomas=20Wei=C3=9Fschuh?=" , Masahiro Yamada , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-kbuild@vger.kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, HONG Yifan Content-Type: text/plain; charset="UTF-8" When HEADER_ARCH is set (ARCH=um), the headers target spawns a recursive $(MAKE) -f $(srctree)/Makefile HEADER_ARCH= SRCARCH=$(HEADER_ARCH) headers. This re-runs $(version_h), scripts_unifdef, uapi-asm-generic, and archheaders a second time. Because headers is in no-dot-config-targets, the recursive sub-make skips include/config/auto.conf and drops CONFIG_WERROR flags (-Werror and -Wl,--fatal-warnings) from KBUILD_HOSTCFLAGS and KBUILD_HOSTLDFLAGS, causing scripts/unifdef to be recompiled on every prepare build with CONFIG_HEADERS_INSTALL=y and CONFIG_WERROR=y. During parallel builds, the recursive $(build)=scripts scripts/unifdef also races with the scripts target even when scripts depends on the outer scripts_unifdef. arch/um/Makefile's archheaders target already invokes ARCH=$(HEADER_ARCH) asm-generic archheaders, generating the required arch/$(HEADER_ARCH)/include/generated/uapi/ headers. Invoke $(hdr-inst) directly for include/uapi (passing SRCARCH for include/uapi/Kbuild) and arch/$(or $(HEADER_ARCH),$(SRCARCH))/include/uapi instead of recursing into top-level headers. Investigation, verification, and patch drafting were assisted by Gemini. Fixes: 268d191abc57 ("kbuild: implement CONFIG_HEADERS_INSTALL for Usermode Linux") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/CAABy=s2iGODbNUdjYFd3MHLsTWsoN3_L5=v4aTX_wW4C3n1_Rg@mail.gmail.com Signed-off-by: HONG Yifan --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5aac6f1b011e..d990a19e7839 100644 --- a/Makefile +++ b/Makefile @@ -1509,12 +1509,8 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj PHONY += headers headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders -ifdef HEADER_ARCH - $(Q)$(MAKE) -f $(srctree)/Makefile HEADER_ARCH= SRCARCH=$(HEADER_ARCH) headers -else - $(Q)$(MAKE) $(hdr-inst)=include/uapi - $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi -endif + $(Q)$(MAKE) $(hdr-inst)=include/uapi SRCARCH=$(or $(HEADER_ARCH),$(SRCARCH)) + $(Q)$(MAKE) $(hdr-inst)=arch/$(or $(HEADER_ARCH),$(SRCARCH))/include/uapi ifdef CONFIG_HEADERS_INSTALL prepare: headers base-commit: 63fdb511c27afcebce797e3db580b3534ddfa639 -- 2.56.1.915.g69d5ec7298-goog