From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=51.159.59.229 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796481216; b=Bvfzkyzyj/RPqNC82t0RvXf/hjmfSSpOLNgkaSuGw2yoYRne7m+90LmY2Gfu6nMGIJUx EX26cV18MGFFuCIGllOBJJ8qOyHDWTXaKcM9vSBJ/IbbwDrxIzmABSvWex2lPKhcLdXQW 9EBhW+sYTPrXclZlaw7AOo2CxVyEEworbNkqnDXFVLcxMOCbOcgGjnElvTVece9y65q/K 96BgopKa6mLTxp36xJEC3oq3jh6rvzuhoDSFM4s8WkeBKr9c0fVuQUcujAZw4PcB8Zg0W EtOOzCjjRiHmdATrd3OoHtibm1gyyUC56ntPiWbP45JN1izU/OvDSqaPWXrmMFUamzw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796481216; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=dw4UDVdzew+ukY3p0kWDL19QyAIzHR4L6GksJYVQCic=; b=K+fUv2QLR2HspJdvtO4LlRSdVQR17K1ehi+tf0fVQFexOblDZMWjqptHJLmG21Crfyx9 QwHKRZC/UJiwiI7muIORFRbvr5rEZiooKQX3h09p0K3fVXv002Owm9hYE5JzoQkajUNo4 eg69Cx/KysvzKS+ivYvwuG5Q4kdrfcMgNKlnSOVxfxtFrmrUdr9Omard40dqGBCowX5lM i2tM0SFj6JlmcZlBCMGdJG+3Yyo54s6jPiIEVQvY5YmuhvOGFhen8vU5enFhRISpivNCn UrG4q6No3uULXea7Zh7p55OPflVP+fNXTDsypFlmhfFCG0pZB1++UaWkvM/wRDdj9jA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass header.d=1wt.eu header.i=@1wt.eu header.a=rsa-sha256 header.s=mail header.b=vxPeQfpk; arc=none smtp.remote-ip=51.159.59.229 Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA682606A32F for ; Sat, 5 Dec 2026 14:33:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EA682606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.a=rsa-sha256 header.s=mail header.b=vxPeQfpk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1796481214; bh=dw4UDVdzew+ukY3p0kWDL19QyAIzHR4L6GksJYVQCic=; h=From:Message-ID:From; b=vxPeQfpkt+b/3Bk7K5QhE3w8+XzBRqaDKUgjhmE4d30OcB56v4wveQJ8YTPkDzpVm s//wNSHv4Ley/7UrgIwqH43y8XIxwMz8/sZH/j+8Yqlsb/+CBGHWb95GfzgBquKigv kmfPinRBZXT8jDmfymSdOPLtBwGPViQ63gR9ZSFs= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id 2EB0EC000B; Sat, 05 Dec 2026 15:33:34 +0100 (CET) Date: Sat, 5 Dec 2026 15:33:33 +0100 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: linux-kernel@vger.kernel.org, Danish Khateeb Subject: Re: [PATCH v2 1/4] tools/nolibc: derive clang target flags from ARCH if CROSS_COMPILE is not set Message-ID: References: <20261202-nolibc-fcntl-v2-0-651ff5781baa@weissschuh.net> <20261202-nolibc-fcntl-v2-1-651ff5781baa@weissschuh.net> 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 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261202-nolibc-fcntl-v2-1-651ff5781baa@weissschuh.net> On Wed, Dec 02, 2026 at 08:29:46AM +0100, Thomas Weißschuh wrote: > The clang --target= flags are important to make sure that the UAPI > headers match the clang's architecture. If they don't match the > header test compilation may fail spuriously. > > Currently the --target= flags are only derived from the CROSS_COMPILE > variable. This variable may not be set for native builds or for native > LLVM builds. Currently this works by chance. > > Fall back to ARCH to determine the --target= flags if CROSS_COMPILE > was not set. ARCH is always set. > > Signed-off-by: Thomas Weißschuh > --- > tools/include/nolibc/Makefile | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile > index 0880be0f6ef5..20160f3f9547 100644 > --- a/tools/include/nolibc/Makefile > +++ b/tools/include/nolibc/Makefile > @@ -122,6 +122,14 @@ headers_standalone: headers > CFLAGS_s390 := -m64 > CFLAGS := $(CFLAGS_$(ARCH)) > > +ifneq ($(LLVM),) > +ifeq ($(CLANG_CROSS_FLAGS),) > +SRCARCH := $(ARCH) > +include $(srctree)/scripts/Makefile.clang > +CLANG_CROSS_FLAGS := --target=$(CLANG_TARGET_FLAGS) > +endif > +endif > + > headers_check: headers_standalone > $(Q)for header in $(filter-out crt.h std.h,$(all_files)); do \ > $(CC) $(CFLAGS) $(CLANG_CROSS_FLAGS) -Wall -Werror -nostdinc -fsyntax-only -x c /dev/null \ OK! Reviewed-by: Willy Tarreau Thanks, Willy