Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4647614rwl; Mon, 3 Apr 2023 07:50:25 -0700 (PDT) X-Google-Smtp-Source: AKy350a4YIV84j2ICdiZYzEeAILv/5AlJAjtLGbglgQQVAICQXtodS7va3T7B1acfoAjx9y/JG6A X-Received: by 2002:aa7:d44c:0:b0:502:52dd:57a2 with SMTP id q12-20020aa7d44c000000b0050252dd57a2mr19371720edr.24.1680533425020; Mon, 03 Apr 2023 07:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680533425; cv=none; d=google.com; s=arc-20160816; b=jHcx6VnSbXm7BeJn1BYpd5G0q1x2Pd/vji+K6bEP7lGtzfBA0pXbFdn99X2Yk7os5m aUyzmE6Rh6pmCnum48msHcs/oVjgshkG3A6rhwaQ33rrw/kQW9Pp/F0RP36MwqNgkF1Y txy+t4k829lAHEJPLwnEzTdMJ1+sH/sLYFG1f8naqtFwZ9IDG4AY/LNl0ypLpZ56J+CX /JvGMENICc7ot7dwVbL067u1qFBepGCXcTY++6kT79mgQw1HkjSo8kaTPpXIsnsrW9cN UF1am9BhsN0pAt39OtJ1MVeU9oLkSG85znEj6K3EGUkJIWUSHrJ9TSSe+/sHL2BEgkTD gJJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W8S+I5WV/DUugaTabXLZYyhCH7jHzq8V/0joijte8Lo=; b=OPKOvj+XZbGlWRoaKI82hQvDcxbyDmHGkqYV7/NrOiO2So5YTq8+gIyfwWZoyzvtYe NtgdSXxIGRdp47Q8lwHm9YF04hxag2dwRaQMo6n3sWNW7zf+qXUvjG+iFUnAVeVMRBTd Hi2Cd66XKdxwDq29M7LdSwnsNvuKACIeqQKBe8uMapP9kp8AwGd9yixeiFX+40UwhZP2 cBZJIyZ6pKXyfphFQpa69kpjaWqrd9SJBvMAtRZtG4f+IzIbhQRdk6vmIorOxyWX/nYj EmmhBxRtkN6S/itPd5hKYIZI6W+ygQFCMIHFSfrzqJGAsYRxfrb7Ygmr3HJwphyMye/M bkXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mQcv7fpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy36-20020a1709069f2400b0094823286610si3858661ejc.620.2023.04.03.07.49.59; Mon, 03 Apr 2023 07:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mQcv7fpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234173AbjDCOt2 (ORCPT + 99 others); Mon, 3 Apr 2023 10:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234021AbjDCOtM (ORCPT ); Mon, 3 Apr 2023 10:49:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CD2929066; Mon, 3 Apr 2023 07:48:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB3EE61AC1; Mon, 3 Apr 2023 14:48:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A87B9C433EF; Mon, 3 Apr 2023 14:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680533281; bh=zkc/nP67akDuNsbOZzMSQGZOjO7R1abCnH7seOXz224=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mQcv7fpEp/XLXHVw9beM+Y0yFOf8DK/VBzBKESdNgC1rd2Ol9f57uxJV6m4/BvWtS sWDM/YOn30RcwBdb64sOCDeDmjelSo+auLcb4LvsNSMM4uBJzv6EPSKWO3EoRjSYVw eTaCha+6az0nyeQ5FqBbIL5apUhW+BqbJg8fr6aLrB0dtWqpd0a7x4Uvu+4rBp5PmA CIRWuybasgjZTrBxHS3QgjkC7rml99JepMie/umMNwQOZErGVcqR4PIF6uKBRJ747T FJtvvvv0Li8x1y99+Qmw2Sicsll7Dui9LFvSuQffpDlWuR2PDpMU037XhK/cSAxaNB FHZHw/2n05Ylw== Date: Mon, 3 Apr 2023 07:47:58 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Nick Desaulniers , Tom Rix , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Fangrui Song , Nicolas Schier Subject: Re: [PATCH] kbuild: clang: do not use CROSS_COMPILE for target triple Message-ID: <20230403144758.GA3460665@dev-arch.thelio-3990X> References: <20230401170117.1580840-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230401170117.1580840-1-masahiroy@kernel.org> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 02, 2023 at 02:01:17AM +0900, Masahiro Yamada wrote: > The target triple is overridden by the user-supplied CROSS_COMPILE, > but I do not see a good reason to support it. Users can use a new > architecture without adding CLANG_TARGET_FLAGS_*, but that would be > a rare case. > > Use the hard-coded and deterministic target triple all the time. > > Signed-off-by: Masahiro Yamada I know of one bug where the value of '--target' matters: https://github.com/ClangBuiltLinux/linux/issues/1244 This was fixed in LLVM 12.0.0. We are not testing this in our CI though, so we would not get bit by this (we could bump the minimum supported version of LLVM to 12.0.0 for this, we have talked recently about doing it for other reasons). I guess I cannot really think of a good reason not to do this aside from that; the target triple should only affect code generation, rather than tool selection (i.e., this does not take away the ability to use a custom set of binutils with clang). However, Nick is currently OOO and I would like his opinion voiced before we commit to this. Consider this a tentative: Acked-by: Nathan Chancellor > --- > > scripts/Makefile.clang | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang > index 70b354fa1cb4..9076cc939e87 100644 > --- a/scripts/Makefile.clang > +++ b/scripts/Makefile.clang > @@ -13,15 +13,11 @@ CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu > CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH)) > CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH)) > > -ifeq ($(CROSS_COMPILE),) > ifeq ($(CLANG_TARGET_FLAGS),) > -$(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang) > +$(error add '--target=' option to scripts/Makefile.clang) > else > CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS) > -endif # CLANG_TARGET_FLAGS > -else > -CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) > -endif # CROSS_COMPILE > +endif > > ifeq ($(LLVM_IAS),0) > CLANG_FLAGS += -fno-integrated-as > -- > 2.37.2 >