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=1796426497; b=PLRTAm8Gt049Zarm5K724+UcW9r9ZEi/6+O5y1m1cAX2p2CAD3CgrrDp5QuuNpRT9AZP ftkXqU/oTScPOiRgM0Qv/yYjYKBkAHkczBVlhnEgQj3QixjN+PcJEBahQD8KZSbD215/4 EjRBfj9b/tW78ftS3kn1aC8fR4s7VILtjILgNav3bn9SGM6grvIx2zmmJhieoJb/m8RX9 PSkr4kMYvrrowZYBx8qW0bqWBomMV0WQtlLhsyGAwjM7YWL5lxG6Zl7WLcBQ6pSy9OSYZ Zdc+tgF3bRvIVZ8/KsWHJE54zxwjqmcrj94qiY0Ign/98XYwNA4O4HT2e2QDwIp08PQ== 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=3J2AwTt1QJ755uBMRaHzyOO7iwz5oLVMchW3l3ZN0D6WfK7nhms2XMi+c/BTcxxctQRp X8rBCX8HKk4J6Tp+XzS0ki8+w31aWNH3VBc1N0yOY/YGuth39zCSXyLRYQmGY2neBuNyl 7xFfHEPUgXJCa1e+kbyt7Rkd+tfPt7bwq3OkmDUpYcGdWvt00TBnv7wfFevTYiE1I2Wo8 SkSyBcHz/v2JIOr9Ve6gLKbePf+Ae7VgHXS7Mz/xQdZ8JZk/6lne9zXpReKd7MDI1lz83 PSMtnbyrFQz5eRxaUE3kWhM2a0MgmTMZlt8Cs3noxavQYE/ekFgmaXahg/ed1a+x+Hg== 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 4C06A606A322 for ; Fri, 4 Dec 2026 23:21:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C06A606A322 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-3b45655b428so2058092a91.0 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=O0rLY1l/+poKW389HuKFB+14P1iwUOlITIqcPVxVud2e95+6TV0nD6H/tNXYrMzA9B yPnA//U89xzff6GbgIcc1DLvoL0FTYTxEkL0Z5At5xlgErg744CLm+MHLHNmGy5DYtZx cxKFsoDIajkqRdOVInBVmKNgAbqHq7txPKw22AA/S+a+4yagIY1wjVVwgP7tPXArGDBR DLuIQWn5RUehVMY+0SIQ+dV0GF3+KAc5a2gmOOuJmUoIjjCZBMb/lLLhgFo/v3ULLpc0 xNyc25wY7EDdP+e4LpfZnPxK5jT53/lqxzxPzkfPEKy4al4H4yKzlbNWgp0vRrcWRA0f Z5dw== X-Forwarded-Encrypted: i=1; AL+hErFdlbriir21IBKN2CWlKf6JqL40TzM0VtOFdlVfOHo6Y0XxweSec+CBd/VsWjgEOEopTBXsOgrLFGf0e38=@vger.kernel.org X-Gm-Message-State: AB4q+uE5yClugTNi354hBQmEHigeuRDJ1L4RW9uO33mbj29Xwiz5ZHx+ ZoNbFM5JOFQ/ZTyvKr6pyAsalSiPZCXqcKKrDyvxgGQSEeeKn0KwD+/2570XSVXrt4PVX/+VuQ= = 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-kernel@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