[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQGUe0h2ti6_u5=y9KUrNStESdd=D=8K3NOiE08tt022w@mail.gmail.com>
Date: Fri, 5 Apr 2019 19:16:50 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Kees Cook <keescook@...omium.org>,
clang-built-linux@...glegroups.com,
Nathan Chancellor <natechancellor@...il.com>,
Michal Marek <michal.lkml@...kovi.net>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] Makefile: lld: tell clang to use lld
On Tue, Apr 2, 2019 at 4:09 PM Nick Desaulniers <ndesaulniers@...gle.com> 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: https://github.com/ClangBuiltLinux/linux/issues/342
> Link: https://github.com/ClangBuiltLinux/linux/issues/366
> Link: https://github.com/ClangBuiltLinux/linux/issues/357
> Suggested-by: Nathan Chancellor <natechancellor@...il.com>
> Suggested-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
> ---
> 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:
https://lore.kernel.org/patchwork/patch/1057685/
--
Best Regards
Masahiro Yamada
Download attachment "0001-ARM-vdso-use-LD-instead-of-CC-to-link-VDSO.patch" of type "application/x-patch" (2724 bytes)
Download attachment "0002-arm64-vdso-use-LD-instead-of-CC-to-link-VDSO.patch" of type "application/x-patch" (2443 bytes)
Powered by blists - more mailing lists