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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 B7596C07E96 for ; Thu, 8 Jul 2021 19:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9115A61925 for ; Thu, 8 Jul 2021 19:06:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbhGHTJF (ORCPT ); Thu, 8 Jul 2021 15:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhGHTJE (ORCPT ); Thu, 8 Jul 2021 15:09:04 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D339C06175F for ; Thu, 8 Jul 2021 12:06:22 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id x25so5519792lfu.13 for ; Thu, 08 Jul 2021 12:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6+ObdsFBNceXxQMGRQLsnrEHm6C0Lskp1Geuon+6uw8=; b=bq27k7ehTq6PP6GLXwIhD4/bRzbmj/DGO6KYwn7DSNlyDy5iuDsu54K4B885W1VYVb U8yXKixUGFYhcXFJk9eY0jQRsjzrEQe9T1yY/vZIf715+544XLHyZreWR/hh5MF9Hy/X yU0Y1TPJCIqQd5WtT0KsTKrcChaGafn5YOrPdpyjofJL05W3C4P+nQ4EQ1e3WIZ1SJfa 7b1VCG0oElp56PfW5ZIMFhSmIN0GnwUypgXmut3Q0g45NJ6w+S3fswk45z2j7ZEeOGNn G7yD9Yu/BUAlme72wrplZ2qss8ncByV8Ottx/mzLfLhWN0GcIAoDJmNikJSnDNKWLcjl a3WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6+ObdsFBNceXxQMGRQLsnrEHm6C0Lskp1Geuon+6uw8=; b=sBntnnfiex2/+YDFfxzTdq0B7Bwdo/IsF9wCRqvhr46XMgQBYyMh8gFHQCy1MAwDFB klw0BdNuPSljo88o07ClIyhvrXeYTgSLoLID7i3SOL+XUcDEFjrGV3diTxik+KqX7c+4 m1JXNsNGx4bC7cTAfXbSnxQz2t1f8kAHHUdKnJOZYrtCGX6ZjkO9xx4Nq0kqHKZshWq8 yCYDJDijJC9cgVKrqQfjSq61fPG/CGbHfotQToYDvyxEG0kIUmPP2cRkVW0Bha5PxsEr dUb7JnDVLf1SVoi9RV5xMGKurZgLflvCXxhF9JFIQsHYivD7alpuX+NmclKGPzo7AxWi kCvw== X-Gm-Message-State: AOAM5329Z/4oyLpVyyUFyZY//3uNxwbVydOF/AT6F50HGA3hXVYbc2jY BPuA2LfYs9hoLn+1K1/hnGOmnreZ8sArIXgILsJaEA== X-Google-Smtp-Source: ABdhPJz4LAL596K6alYRyJay2//b2wtiw4hkERI0ktoOb61Rp/LnXvF6gWSEZEvMbdZtMGvKakFM26BpcVZLdEswaGk= X-Received: by 2002:a19:5f04:: with SMTP id t4mr25643332lfb.297.1625771180373; Thu, 08 Jul 2021 12:06:20 -0700 (PDT) MIME-Version: 1.0 References: <20210707224310.1403944-1-ndesaulniers@google.com> <20210707224310.1403944-3-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 8 Jul 2021 12:06:09 -0700 Message-ID: Subject: Re: [PATCH 2/2] Makefile: drop CROSS_COMPILE for LLVM=1 LLVM_IAS=1 To: Arnd Bergmann Cc: Masahiro Yamada , Miguel Ojeda , Fangrui Song , Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 8, 2021 at 4:45 AM Arnd Bergmann wrote: > > On Thu, Jul 8, 2021 at 12:23 PM Masahiro Yamada wrote: > > On Thu, Jul 8, 2021 at 7:43 AM 'Nick Desaulniers' via Clang Built > > > > We must rely on this behavior of Clang because > > --target (which is contained in CLANG_FLAGS) > > must be specified before the Kconfig time. > > Then, a user can toggle CONFIG_64BIT any time > > from menuconfig etc. > > > > With this in mind, using $(ARCH) as if-else > > switches is pointless. > > $(SRCARCH) is the only meaningful input. > > > > > > else ifeq ($(ARCH),i386) > > CLANG_FLAGS += --target=i686-linux-gnu > > else ifeq ($(ARCH),x86) > > CLANG_FLAGS += --target=x86_64-linux-gnu > > else ifeq ($(ARCH),x86_64) > > CLANG_FLAGS += --target=x86_64-linux-gnu > > > > should be replaced with: > > > > else ifeq ($(SRCARCH),x86_64) > > CLANG_FLAGS += --target=x86_64-linux-gnu > > I think we usually only have to provide the architecture > name, as in "--target=x86_64", though for arm I get a > warning "clang: warning: unknown platform, assuming > -mfloat-abi=soft" unless I provide the full triple. Right, Fangrui also made that suggestion, but for that reason (the error for various architectures when using 2-component triples) I'd prefer to just always specify a full triple. I picked some to have a starting point; unless they NEED to change, I'll refrain from modifying them further. Technically, I think they can have 4 components, not sure why we still call them a "target triple." I guess I wouldn't be surprised if they can contain more than 4 components at this point. -- Thanks, ~Nick Desaulniers