From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.71 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796426496; b=A09C40JZcXeO6KAHhlyWhC+JTMx/HqMIscjf4fdNZOjUHsLOHRcIafvhBVOhyVaR+uD6 f/ibIpkxsbbTx435yopRFuNhOQhQRIOlj40G+kB750T8YpexATZO5/pt1HOk3MjRqLedj 1uVbNuTkvDRhsGmSkquryFBeLQffgzpPjZTEtEGj6orQhQCIlfPxctEmYX/urSUmHPOkJ z5KBIbAfuxf+JUFPNM+Qw260r78ycYPWLxjqfGm41kJMzir7sAfHih336CQweqJiOTxbZ L2KVyJoTBadVT+Dq4jZBiLevJCsQY/2Z4EkrawYhHovrKr0MK+1Ai9p7soPkwRj/1Yg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796426496; 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=abr8h5vLrmOJz5863TnJgeJ2C88D+pxWu5C3Cz5LE/Pqcrp+7S/mGhlIj1hVjf7mvVBB pcZ60k5rV0QDNXFS2aKXSMWsK8nXnneTW0mYF8wjUiq/Lcbv9L2SacUUXB8N0ey9uLcIV 8E9gifR0pl0uTCqFkblvlrxb+EFIxvKRMp0bl444ac0eHNi/8vHWJgKbvY+hRvjenwiKB yUeaWZ5Dt7K1JuYbjbI4nd3Ov40fkpbQBTNcf1ls8RqmtygeXORl1YSLY5OkyPom2BOeS 0LIx6n1UVtVRd5E3KhsFOrCUFBNra6hGZ55p0h+2C+WwN6P12F0BsWLRQj4EPbmG5lQ== 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.71 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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 4C0FF606A32C for ; Fri, 4 Dec 2026 23:21:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C0FF606A32C 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-f71.google.com with SMTP id 98e67ed59e1d1-3b58410c467so1752907a91.1 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=IUSPu/WGjXu7kYHSokJR17B7U070iiJ2DTjqJIzAod+ErJ12Iyxt9Q+a8nVlyb6+5j WFy0HhabGx9ZIyiQ+o68RDbz0mYOcj+0kElmzMaGCWGCcS+Wm3kNk/bWMjfm0ROCknne HMtwyl5lYyvMO/hxPzsSK2pRPwZDA7xzFC0Nuyk1Qi78KSjcSq5CBZ3MiwKKsTrisZtb 6NAqIoAFig6TPW+Zk86jyBjHk6fhy5R/aZkxv/3EXFjuXmz2LMJ1+9Gaji2XX7ojUjOH ET2bqLy0kmRzQ8q9JMdxwqklsGQ6NFTCsoFPG+s+FItn8jDsA0wmQTZiiYuPIuAKVLFA 6PFA== X-Forwarded-Encrypted: i=1; AL+hErHBsFFqpH3LD2lU+xd2CIxgkdeF71YyFyJ8bmbyWr66Qlgxu29D/eN0IpgEfqFubdhkZ8AOkyE=@vger.kernel.org X-Gm-Message-State: AB4q+uF85NXXFvfcyQwlZ6LcwkqDO7gWTxDrmMhFi0BU/J7P1+sHhiZ9 DDFJi8+0raUYKWuexFcAXFo0RZ0pfhRPTlEezh8wyJpST3vgElueinadXvwluzSJh5q3v2F6pw= = 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: stable@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