Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6363987pxv; Thu, 29 Jul 2021 12:41:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygz7RpxwpDYF1NOWecxVExTMc0ZrS3AsIVScJv005z92tfZP1pl6C6x1uJWN266AOQLBeD X-Received: by 2002:a6b:f40a:: with SMTP id i10mr5386629iog.139.1627587690932; Thu, 29 Jul 2021 12:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627587690; cv=none; d=google.com; s=arc-20160816; b=UnGMHKfRn4X1izKs7VVzXAS+06JWuT0PAnEUvHwVMcOMLjUNbN5v1ARIlY3Qsnlj8E kInWIMZivJ4NTfQOKk7bgNhHmKoO79D6NLOC4xzI26xvHKRx/m2uXQwxPElL7kV01wdz UW+M9i0jHip5zObYo7a3jZzt5sbwFg6N0YCwjebfq9jLmPc2NiH4yFk3VbznPq3lNHPd 5fS8BAhKedrJhJu/bTtk1DXn8Ks7PrhdJrcTy+0L9s3nQqZLfHgmMZg0sIHeiW0wgkfx KTA/bibc690GQMOauZeyOd1nSEXgZu/aVoBBoxyIQxKagozEo1gEQnN2CX0x0Ymr8TAa MvuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=d9AkDv4pVlg40oFvlekoXnqSgpFzLdMzgAbTcToONYg=; b=IWOkz5oaBBA4zCD0dbUFhZt7+ChnMOASHgcIH+ASvKh/viiDHntyVWnL0JAq7jdb7Q BIl4qGX51PNfI2f39Xd4zbVtxp0tl7FhBfdOx9OyWevBMSJuGbD95AECJL8NbEChK6t3 0vLDpGL4rT7RJuZMBXctvF72MTvjB48Lgq+P0DabhS6fsxesH0p4K23ceIelaee2JhOI CWUGC9wcm+2COK5hikL2JAGTsZOEQHIEWhjdIAHvUOb1r82SYD3n4CLXcWncrk8fzHxP lbeuHq6TqKxMlrJFBcEZHH2ULxKKukmWKU5nEtZMs49LTbxZxHk3onwqg34I8PMqfPH+ iHdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XsUrIiOl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si4747002iot.89.2021.07.29.12.41.17; Thu, 29 Jul 2021 12:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XsUrIiOl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229773AbhG2Tkg (ORCPT + 99 others); Thu, 29 Jul 2021 15:40:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbhG2Tkf (ORCPT ); Thu, 29 Jul 2021 15:40:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9282760E94; Thu, 29 Jul 2021 19:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627587631; bh=/Yw1ltAAMBiNHrqDZqFgdBiPKvkkzx4e1WN53FOS1jk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XsUrIiOl/y3BXS1pX9J0o4LR32Zzbi3NrUmWLtuHlVZQyITfP91oW59NELbfvClji 4ysyqHwsqLPGrEJaAIxh1STsgg37BsYYD2crK1ULSUID+vHno/whxNZDaSRe24GhEn xgLnZLLVzGqjDHyYKK9ERbU79tZljF0PqX52/CkPBvpEyMJ0Ic+QQCz62Gnq4kJd/a 6Wr4GeqC8EHuzYsajiDRlfXXm2SQjIJ427Ln0+CGdsLhPvtsb3o0yBGBVp2U2krK4i Czua671ql/MlDtUwavgbBhnJJLPjPDLMEkvYAzuZkAdZTXKYUSSHIGK5gqXUQonQDZ w2qBC+xE3lEig== Received: by mail-wr1-f44.google.com with SMTP id j2so8243756wrx.9; Thu, 29 Jul 2021 12:40:31 -0700 (PDT) X-Gm-Message-State: AOAM533CMswBY7h1GBbbc0u0uEMhkmXlj0fYn7njAANHqV1QmJaul8/3 awM/K5CKMuDy3EwpWcsepT8bWNAX/e2j1LA88OY= X-Received: by 2002:adf:e107:: with SMTP id t7mr6536342wrz.165.1627587630094; Thu, 29 Jul 2021 12:40:30 -0700 (PDT) MIME-Version: 1.0 References: <20210729165039.23896-1-ndesaulniers@google.com> <20210729165039.23896-3-ndesaulniers@google.com> In-Reply-To: <20210729165039.23896-3-ndesaulniers@google.com> From: Arnd Bergmann Date: Thu, 29 Jul 2021 21:40:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] Makefile: infer CROSS_COMPILE from SRCARCH for CC=clang LLVM_IAS=1 To: Nick Desaulniers Cc: Masahiro Yamada , Miguel Ojeda , Fangrui Song , Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Geert Uytterhoeven , Christoph Hellwig , Linus Torvalds , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 29, 2021 at 6:50 PM 'Nick Desaulniers' via Clang Built Linux wrote: > > We get constant feedback that the command line invocation of make is too > long. CROSS_COMPILE is helpful when a toolchain has a prefix of the > target triple, or is an absolute path outside of $PATH, but it's mostly > redundant for a given SRCARCH. SRCARCH itself is derived from ARCH > (normalized for a few different targets). > > If CROSS_COMPILE is not set, simply set --target= for CLANG_FLAGS, > KBUILD_CFLAGS, and KBUILD_AFLAGS based on $SRCARCH. > > Previously, we'd cross compile via: > $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make LLVM=1 LLVM_IAS=1 > Now: > $ ARCH=arm64 make LLVM=1 LLVM_IAS=1 > > For native builds (not involving cross compilation) we now explicitly > specify a target triple rather than rely on the implicit host triple. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1399 > Suggested-by: Arnd Bergmann > Suggested-by: Nathan Chancellor > Suggested-by: Masahiro Yamada > Signed-off-by: Nick Desaulniers Looks good to me, Acked-by: Arnd Bergmann > +else > +$(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang) > +endif # SRCARCH > +endif # LLVM_IAS Now in theory I suppose we could just have the fallback use --target="$(SRCARCH)-linux-gnu" to avoid having to change this for every new architecture. I think in most cases, this would just work, even though a lot of the one you listed have different patterns. Arnd