[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3] Makefile: lld: tell clang to use lld
On Tue, Apr 2, 2019 at 4:09 PM Nick Desaulniers <> wrote:
> This is needed because clang doesn't select which linker to use based on
> $LD but rather -fuse-ld={bfd,gold,lld,<absolute path to linker>}. This
> is problematic especially for cc-ldoption, which checks for linker flag
> support via invoking the compiler, rather than the linker.
> Select the linker via absolute path from $PATH via `which`. This allows
> you to build with:
> $ make LD=ld.lld
> $ make LD=ld.lld-8
> $ make LD=/path/to/ld.lld
> Add -Qunused-arguments to KBUILD_CPPFLAGS when using LLD, as otherwise
> Clang likes to complain about -fuse-lld= being unused when compiling but
> not linking (-c) such as when cc-option is used.
> Link:
> Link:
> Link:
> Suggested-by: Nathan Chancellor <>
> Suggested-by: Masahiro Yamada <>
> Signed-off-by: Nick Desaulniers <>
> ---
> Changes V2->V3:
> * Use absolute path based on `which $LD` as per Masahiro.

This is not what I suggested. I wanted to say:
"You cannot do this for GCC, so do not do it at all".

I want to propose alternative solution.
Please check the attached patches.

To apply 0002, you need the following as a prerequisite:

Best Regards
Masahiro Yamada
[unhandled content-type:application/x-patch][unhandled content-type:application/x-patch]
 \ /
  Last update: 2019-04-05 12:19    [W:0.070 / U:3.728 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site