From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB7E2C433E2 for ; Tue, 21 Jul 2020 10:40:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1B7420729 for ; Tue, 21 Jul 2020 10:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595328031; bh=RLAiszxm7YKYD7+EHsCYHjKnN+1Av4e0xQzdiTs9q0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=u347gAy92W6zuFiT5SkHGibRoaukyeGy3LcFBA2mI1nTYF2GGckoBC3TpravWWl5w P2WMSRGykPUiYV2MJnlfKfIpcdJExRN2Y0ut/w782fn00/eIiqgH/BccpTM3EyoKEh YkSyuT14pvK4lK6wOV09x4anBhsLYDHjtsvyQzqM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729323AbgGUKka (ORCPT ); Tue, 21 Jul 2020 06:40:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:59356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726484AbgGUKk1 (ORCPT ); Tue, 21 Jul 2020 06:40:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42B0D2065F; Tue, 21 Jul 2020 10:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595328027; bh=RLAiszxm7YKYD7+EHsCYHjKnN+1Av4e0xQzdiTs9q0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xWdL9ZvXiFUKGCmoJe12ReYnQpw8kj/8gBQT6+GsIzKOq0duxkJxb1oFC/MLWFG1I KZQD2GB3Igb7xP1+VAvrACwgfNmQm++p9TIKCa8n/RdkwcNxhW3BHZY4HJsZTYSiR2 Ln0CvV76QZQabEzTTDgNtS+kT2E3aVT4Wq45omME= Date: Tue, 21 Jul 2020 12:40:35 +0200 From: Greg KH To: Fangrui Song Cc: Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, stable@vger.kernel.org, Jian Cai , Bill Wendling , Manoj Gupta , Nathan Chancellor , Nick Desaulniers Subject: Re: [PATCH v2] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation Message-ID: <20200721104035.GC1676612@kroah.com> References: <20200721041940.4029552-1-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200721041940.4029552-1-maskray@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 20, 2020 at 09:19:38PM -0700, Fangrui Song wrote: > When CROSS_COMPILE is set (e.g. aarch64-linux-gnu-), if > $(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-elfedit, > GCC_TOOLCHAIN_DIR will be set to /usr/bin/. --prefix= will be set to > /usr/bin/ and Clang as of 11 will search for both > $(prefix)aarch64-linux-gnu-$needle and $(prefix)$needle. > > GCC searchs for $(prefix)aarch64-linux-gnu/$version/$needle, > $(prefix)aarch64-linux-gnu/$needle and $(prefix)$needle. In practice, > $(prefix)aarch64-linux-gnu/$needle rarely contains executables. > > To better model how GCC's -B/--prefix takes in effect in practice, newer > Clang (since > https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90) > only searches for $(prefix)$needle. Currently it will find /usr/bin/as > instead of /usr/bin/aarch64-linux-gnu-as. > > Set --prefix= to $(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE) > (/usr/bin/aarch64-linux-gnu-) so that newer Clang can find the > appropriate cross compiling GNU as (when -no-integrated-as is in > effect). > > Reported-by: Nathan Chancellor > Signed-off-by: Fangrui Song > Reviewed-by: Nathan Chancellor > Tested-by: Nathan Chancellor > Tested-by: Nick Desaulniers > Link: https://github.com/ClangBuiltLinux/linux/issues/1099 > --- > Changes in v2: > * Updated description to add tags and the llvm-project commit link. > * Fixed a typo. This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.