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=-13.4 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,URIBL_BLOCKED,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 94110C07E95 for ; Fri, 2 Jul 2021 18:29:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 762D4613E7 for ; Fri, 2 Jul 2021 18:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhGBScR (ORCPT ); Fri, 2 Jul 2021 14:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbhGBScQ (ORCPT ); Fri, 2 Jul 2021 14:32:16 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E179C061762 for ; Fri, 2 Jul 2021 11:29:44 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id u25so14475091ljj.11 for ; Fri, 02 Jul 2021 11:29:44 -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=Uke8QP8jDT0ISFCLZ021BNSpKYLqzZN1MQPfd1lmORs=; b=Go8dlU4pYH27zAulQl0JEeWem+aLHmXx6lAAGJ5RX5Th1L0JIkmbQVShEOdiuVEDNe w5McMXyT7OkESj6bjNOMryjuUhU2GQF+fPvFWY1eHUaIvxmaNLXDsD/pbV7HRZAgw30w y6+fbNTxPudDQKN5uoia56HylE+fS2vPHOr9iOOoKN1rpFYdxoM4U5gNOZ2ze+F3C4v3 9uC36SUCTgF+fD9Pkiz1s1vxUBCuIxF6x87F2z2W3jLZQjRdBrfV+Rw4pt6Tme03aX9E rH8yBm5gt/MbY1wQbj8f3CFMaWe8B6zwgsv7SVQybImoBY3Qtq2/TrhFk/xWza2nK/Mr pQVg== 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=Uke8QP8jDT0ISFCLZ021BNSpKYLqzZN1MQPfd1lmORs=; b=oftC4BgOPJWGwnDWTh8TAjFjQMaTAIlwmI/aTlyzWHfwqadQsliuLmssqSpcu/o1yi u2M6BZAgkpY9f5CerlJmhhvciOFaWvO1gIsje9Ja+5VaI7l7qkJJ6TcwgRpWS5+0meui A4RWcPVCPwlitg7L08qUmFZTrRAEi3EPQVVzp9AJe6mjCyOq6W0NplvL4+9l2chuo8sL QrYTWH9dce5FtB+kickNjIIh6nuhNN0JH7X1veYJdYW6annDqH+3LKjUAWvmMXwc5IGZ Bp9GpxPq6ZAqoRvDDOfrpHx9S0bot3nWkWSSaD/g/pM/Vran4FBSDhM/B9RpJWztReSR xRlg== X-Gm-Message-State: AOAM532j99zo5rA2OSpOaeuCHQpyxPK3wCRLOEOOpHZ3DwztVIh1dtFi vldFB6rdk39JydJkSxwy/Kj5A1+kbyvOt3dpeVoiwQ== X-Google-Smtp-Source: ABdhPJxo8xGnK3pq7PzatyX9aih8j04svJoEYfDiTkNvI1T83vRxvgJmwble7AKeQKXSG9W6O1uph3cP81m14NAYgdI= X-Received: by 2002:a2e:5c03:: with SMTP id q3mr574881ljb.233.1625250582245; Fri, 02 Jul 2021 11:29:42 -0700 (PDT) MIME-Version: 1.0 References: <20210701235505.1792711-1-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 2 Jul 2021 11:29:31 -0700 Message-ID: Subject: Re: [PATCH] arm64: drop CROSS_COMPILE for LLVM=1 LLVM_IAS=1 To: Arnd Bergmann , Masahiro Yamada Cc: Catalin Marinas , Will Deacon , Fangrui Song , Nathan Chancellor , Linux ARM , Linux Kernel Mailing List , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 2, 2021 at 4:59 AM Arnd Bergmann wrote: > > On Fri, Jul 2, 2021 at 1:55 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > > +ifneq ($(LLVM),) > > +ifneq ($(LLVM_IAS),) > > +ifeq ($(CROSS_COMPILE),) > > +CLANG_TARGET :=--target=aarch64-linux > > +CLANG_FLAGS += $(CLANG_TARGET) > > +KBUILD_CFLAGS += $(CLANG_TARGET) > > +KBUILD_AFLAGS += $(CLANG_TARGET) > > +endif > > +endif > > +endif > > I think only the "CLANG_TARGET :=--target=aarch64-linux" line should > go into the > per-architecture Makefile. It doesn't hurt to just set that > unconditionally here, > and then change the CLANG_FLAGS logic in the top-level Makefile to use this > in place of $(notdir $(CROSS_COMPILE:%-=%)). I don't think we can do that. Based on the order the arch/ specific Makefiles are included, if we don't eagerly add --target to the KBUILD_{C|A}FLAGS, then cc-option, as-option, and as-instr macros (defined in scripts/Makefile.compiler) checks in per arch/ Makefiles may fail erroneously because --target was not set for KBUILD_{C|A}FLAGS yet. Another issue is the order of operations between the top level Makefile and the per arch/ Makefiles. The `notdir` block you reference occurs earlier than the per-arch includes: 609 TENTATIVE_CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) ... 648 include $(srctree)/arch/$(SRCARCH)/Makefile We would need the opposite order to do what you describe. Reordering these would effectively be a revert of commit ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile") which I'm not sure we want to do. But maybe there's another way I'm not seeing yet? -- Thanks, ~Nick Desaulniers 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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 5D986C07E95 for ; Fri, 2 Jul 2021 18:31:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16C4B613F1 for ; Fri, 2 Jul 2021 18:31:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16C4B613F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dbLOFAF5dhliYo6UVcqjvktr8f7tfdZpZpXA4N90wWQ=; b=N/r/1gfVIgGdT2 YBiB4ghU+1nNjbBKvBsUKkmNvTnNjv2cdAXPboMBn7SqwnE52MSFm3c+pIDfe9KU7zLOW+QvesKbb anPwTuswY9KJUfa3cq2xiSXK73X6w5H+lb74kIwr0A29eLuLeIHgvnDeyBppPVRbC7u/VKEQOsK2j gG7y0juO/Dc6PeDDseLNsk5VK7yMw+4gqFgdxIRVv5UMaP5GGjkGoq5HuiChgZ31sBAol8/S3h1l5 xuoMIPhuFpu9qWtxsgbwIsHwvjTV1a/DfBTIcN95hs6ezSvA4337B0KTYZOJyhnuL/MjFEO+YyjFC I0CKd3t922wSTrg3X6oQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzNv9-003lG4-HW; Fri, 02 Jul 2021 18:29:47 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzNv6-003lFk-D9 for linux-arm-kernel@lists.infradead.org; Fri, 02 Jul 2021 18:29:45 +0000 Received: by mail-lj1-x235.google.com with SMTP id l18so971936ljb.10 for ; Fri, 02 Jul 2021 11:29:43 -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=Uke8QP8jDT0ISFCLZ021BNSpKYLqzZN1MQPfd1lmORs=; b=Go8dlU4pYH27zAulQl0JEeWem+aLHmXx6lAAGJ5RX5Th1L0JIkmbQVShEOdiuVEDNe w5McMXyT7OkESj6bjNOMryjuUhU2GQF+fPvFWY1eHUaIvxmaNLXDsD/pbV7HRZAgw30w y6+fbNTxPudDQKN5uoia56HylE+fS2vPHOr9iOOoKN1rpFYdxoM4U5gNOZ2ze+F3C4v3 9uC36SUCTgF+fD9Pkiz1s1vxUBCuIxF6x87F2z2W3jLZQjRdBrfV+Rw4pt6Tme03aX9E rH8yBm5gt/MbY1wQbj8f3CFMaWe8B6zwgsv7SVQybImoBY3Qtq2/TrhFk/xWza2nK/Mr pQVg== 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=Uke8QP8jDT0ISFCLZ021BNSpKYLqzZN1MQPfd1lmORs=; b=lCoS2FrtKaFSmoh5tfRUNQ8hNadlSWOQy1yUzKTq7kA2c5t2TH0+PWAALmd9HONVjN YY53af2xfGIpSz+/eZJqmDscl3yAf3qiIyo8DaJmtTz01qJoqbSt3rO5U5WFsnpTNMBm ybZ4jEjSZgOE3+U3xe8h0aojTsN4EdrkUxEDd7SPGTF+rdiELrbqfVgps+xUjPSedMBS iwlWY/QKo8u4IJ1YlY4S0XbMzXjRLPb1I7GwMbbnAS32taobKAvatqLHu1/mke+el+tx 082qUsGmbtayucL3/B4K7HiwumN+lpVHx9qLsPxqLkaFuHAcfl80pB2NidZ+n09/se9z Rqjw== X-Gm-Message-State: AOAM530FLl1HSp9Bo+QqWS5fjZC2Ab6RaJVme1Spvtor3sTBoYKh/BMC HPOaQOFdHNt8VK90/QxqphBcIDkj9bB1UqcXTn3M5g== X-Google-Smtp-Source: ABdhPJxo8xGnK3pq7PzatyX9aih8j04svJoEYfDiTkNvI1T83vRxvgJmwble7AKeQKXSG9W6O1uph3cP81m14NAYgdI= X-Received: by 2002:a2e:5c03:: with SMTP id q3mr574881ljb.233.1625250582245; Fri, 02 Jul 2021 11:29:42 -0700 (PDT) MIME-Version: 1.0 References: <20210701235505.1792711-1-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 2 Jul 2021 11:29:31 -0700 Message-ID: Subject: Re: [PATCH] arm64: drop CROSS_COMPILE for LLVM=1 LLVM_IAS=1 To: Arnd Bergmann , Masahiro Yamada Cc: Catalin Marinas , Will Deacon , Fangrui Song , Nathan Chancellor , Linux ARM , Linux Kernel Mailing List , clang-built-linux X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_112944_508239_69B4976B X-CRM114-Status: GOOD ( 17.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 2, 2021 at 4:59 AM Arnd Bergmann wrote: > > On Fri, Jul 2, 2021 at 1:55 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > > +ifneq ($(LLVM),) > > +ifneq ($(LLVM_IAS),) > > +ifeq ($(CROSS_COMPILE),) > > +CLANG_TARGET :=--target=aarch64-linux > > +CLANG_FLAGS += $(CLANG_TARGET) > > +KBUILD_CFLAGS += $(CLANG_TARGET) > > +KBUILD_AFLAGS += $(CLANG_TARGET) > > +endif > > +endif > > +endif > > I think only the "CLANG_TARGET :=--target=aarch64-linux" line should > go into the > per-architecture Makefile. It doesn't hurt to just set that > unconditionally here, > and then change the CLANG_FLAGS logic in the top-level Makefile to use this > in place of $(notdir $(CROSS_COMPILE:%-=%)). I don't think we can do that. Based on the order the arch/ specific Makefiles are included, if we don't eagerly add --target to the KBUILD_{C|A}FLAGS, then cc-option, as-option, and as-instr macros (defined in scripts/Makefile.compiler) checks in per arch/ Makefiles may fail erroneously because --target was not set for KBUILD_{C|A}FLAGS yet. Another issue is the order of operations between the top level Makefile and the per arch/ Makefiles. The `notdir` block you reference occurs earlier than the per-arch includes: 609 TENTATIVE_CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) ... 648 include $(srctree)/arch/$(SRCARCH)/Makefile We would need the opposite order to do what you describe. Reordering these would effectively be a revert of commit ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile") which I'm not sure we want to do. But maybe there's another way I'm not seeing yet? -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel