Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp854370pxt; Thu, 5 Aug 2021 13:25:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU9COimN+lXUZtOj/s9IYz6h652/iiTTOeJZ9IabxE8XWLg0YRVSeM7b/sow9CpGi8RJ0n X-Received: by 2002:a92:cec5:: with SMTP id z5mr1779839ilq.226.1628195156521; Thu, 05 Aug 2021 13:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628195156; cv=none; d=google.com; s=arc-20160816; b=GkcN0JffP0Dk13oYgx5kr6gqJ1yLxPaVkhdaPRP1+vGmR3cX5nPNFxkJuOnJB0O891 KYf4hVNiArTQ9jYR3EDGVw9QDqQFvhR1ZBtVJzuj0+xvaH+BPljPSKaApV593vMLWvQQ q4UE7+JVKHtqGBTUHjMsFLiJ0Pad81z4GYQqelUVPwlzDvwZu/XwVY6jDKS4vQpU+weZ Dnl32O5joQYQNWdFrPMejbTwTdPM5OaAFciSSY6xCEWMwfGpgmAWIk2cs/VrZESxnEvG qv4Rjsl2PkA7pvluGQSch8XAwl8cQjYF1gWkWjmRKj7kMgtiwThyAa6LVgSULzZ//ndf Ghmg== 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=B2x6auZy1yOpqK/qUxjj6oGl/GoNZ7BrX2iVqBBt8Ww=; b=Ofzeewl2AYwR+YGe0t2IvZGKHKJRAPQJ3ZWmwmnlaH55G2DCJnMsuFaq2pFlbVHLqx NFI4m1ffygwd1IUaAMQ5u/InKTYVHwoo8nT5TA23Krr//TjM6vCTBJdsd85WVhdjdlaf fIhN5EQ/uevFmwHpuBsEwVOr2OyEcIs/uP42Xg50tnIpVH2Tt1xmut978TSx1mr7t2Ep NumAK5p66r8s0uCc5NsTGzDqgq+h9tcP6l0Ra7flVjlHLaR8sel7vgS6izBDFx4pu++4 6oCg4YayizDH9jjKx6Bv4m2urf2Q6W30w1Ky8R5vkYul4m05TOfxU339R8IfvmMH6vBK jO0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=s3FKo7e0; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si3575720jas.98.2021.08.05.13.25.43; Thu, 05 Aug 2021 13:25:56 -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=@google.com header.s=20161025 header.b=s3FKo7e0; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237209AbhHES3b (ORCPT + 99 others); Thu, 5 Aug 2021 14:29:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236102AbhHES3a (ORCPT ); Thu, 5 Aug 2021 14:29:30 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54A7C0613D5 for ; Thu, 5 Aug 2021 11:29:15 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id b21so8311043ljo.13 for ; Thu, 05 Aug 2021 11:29:15 -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=B2x6auZy1yOpqK/qUxjj6oGl/GoNZ7BrX2iVqBBt8Ww=; b=s3FKo7e0gW48IvH0lOX4Kcel4L00ZcKu2nFI66uWvjtQ8/rVQhYZPEbf79d0F8Uouv uk0W/wKOVOAsC0A1EJXlP0p0jCihTaty+C79VIp+YN5MwaOTs/9xzexUBEOh590f+HIF iwFt3MK6wBZjYWk+VbbwKxjhOEYpiNNYXy4u+PXsbJiOBuVInPk2hy49igFYzkF8WVFa Gm9EdHXBflVgYvKhPAgq5ajsf6CE/zuiuxLLOFt+OPa1fpWMD/S29zBNMp3UK/0bFT42 GEMXOFiBckGd6B64Zpg0ot0G6WU+72hyx3WSKw3YcoZJWqQiaSCIG8Bg9rQbBBNidWKp e1LQ== 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=B2x6auZy1yOpqK/qUxjj6oGl/GoNZ7BrX2iVqBBt8Ww=; b=tPhBJ6P0Qzf92vJG2eqUo1tHS+a++tvunueI/Z+otO5ki+vMqGO9zf4tpyLnAuWXxN 00Q7PVqxZG+li6C5Hnkw07UfQDBmEvFr3BDza35WEyzSvWPKdjUdPJczn3LSmzDhs6ML 7nmmxkZykJcVJf8Gdg+DOSfXW7NxCUttNqMY+3KNkdX8vFlqzqAtnHog8DK8cMBCSSBv jMPhEdFMtAY65u9RA8LRVtzeeiJajS7FY2OJLz1U74b0orvcwI8T8uh5mR9MRv5b68BN DDEGdAw2VG4bCF18TpxPefUIx7srQk+w6et9LNN1MS0ytdBmJi7ArEdzWc9CdYrDiEev eg2g== X-Gm-Message-State: AOAM533TyBuWaVlNsvVlSQhUn36mjKmRX1CoSFB0z3Cu+zNHkVAsv0gU v8TxR+G1B3FqHrw/8eVuR0N5i3dH28YyW9VBy31IZw== X-Received: by 2002:a2e:9ec1:: with SMTP id h1mr4044167ljk.0.1628188154005; Thu, 05 Aug 2021 11:29:14 -0700 (PDT) MIME-Version: 1.0 References: <20210802183910.1802120-1-ndesaulniers@google.com> <20210802183910.1802120-4-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 5 Aug 2021 11:29:03 -0700 Message-ID: Subject: Re: [PATCH v6 3/3] Documentation/llvm: update CROSS_COMPILE inferencing To: Masahiro Yamada Cc: Miguel Ojeda , Fangrui Song , Michal Marek , Arnd Bergmann , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Geert Uytterhoeven , Christoph Hellwig , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 5, 2021 at 11:27 AM Nick Desaulniers wrote: > > On Thu, Aug 5, 2021 at 6:58 AM Masahiro Yamada wrote: > > > > On Tue, Aug 3, 2021 at 3:39 AM 'Nick Desaulniers' via Clang Built > > Linux wrote: > > > diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst > > > index b18401d2ba82..f8a360958f4c 100644 > > > --- a/Documentation/kbuild/llvm.rst > > > +++ b/Documentation/kbuild/llvm.rst > > > @@ -63,6 +63,23 @@ They can be enabled individually. The full list of the parameters: :: > > > Currently, the integrated assembler is disabled by default. You can pass > > > ``LLVM_IAS=1`` to enable it. > > > > > > +Omitting CROSS_COMPILE > > > +---------------------- > > > + > > > +As explained above, ``CROSS_COMPILE`` is used to set ``--target=``. > > > + > > > +Unless ``LLVM_IAS=1`` is specified, ``CROSS_COMPILE`` is also used to derive > > > +``--prefix=`` to search for the GNU assembler and linker. > > > > > > Is there any place where we rely on --prefix > > to search for the linker? > > > > In general, the compiler stops after generating an object > > since it is passed with the -c option. > > The linking stage is separated. > > > > In the old days, VDSO was an exceptional case > > where $(CC) was used as the linker driver, but > > commit fe00e50b2db8c60e4ec90befad1f5bab8ca2c800 fixed it. > > See my previous reply to Fangrui. > https://lore.kernel.org/lkml/CAKwvOdnK=SUm1_--tcLRO3LVeXd_2Srfv2tsZCUW0uXXa1W_pg@mail.gmail.com/ > > To be more specific, I believe this is still a problem for ppc vdso. > https://github.com/ClangBuiltLinux/linux/issues/774 > > I had sent patches for that, but binutils 2.26 would crash (IIUC, > newer GNU binutils are ok). See this thread: > https://lore.kernel.org/lkml/b2066ccd-2b81-6032-08e3-41105b400f75@csgroup.eu/ > > So "we'd prefer the linker was used as the driver, but there's at > least one place I know of in the tree where that's not currently the > case." Also, I think the CC_CAN_LINK functionality also fits the bill. https://github.com/ClangBuiltLinux/linux/issues/1290 -- Thanks, ~Nick Desaulniers