linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Kees Cook <keescook@chromium.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Nicholas Piggin <npiggin@gmail.com>,
	Vasily Gorbik <gor@linux.ibm.com>, Adrian Reber <adrian@lisas.de>,
	Richard Guy Briggs <rgb@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] init/Kconfig: add config support for detecting linker
Date: Tue, 12 Feb 2019 00:08:43 +0900	[thread overview]
Message-ID: <CAK7LNAS=hcVtG952t4bNyJMx1_byAeaFHj06P6KmFvTjh4ZQxA@mail.gmail.com> (raw)
In-Reply-To: <20190208054147.GB9647@archlinux-ryzen>

On Fri, Feb 8, 2019 at 2:42 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Thu, Feb 07, 2019 at 07:57:20PM -0500, Mathieu Desnoyers wrote:
> >
> > ----- ndesaulniers@google.com wrote:
> > > Similar to how we differentiate between CONFIG_CC_IS_GCC and
> > > CONFIG_CC_IS_CLANG, add CONFIG_LD_IS_BFD, CONFIG_LD_IS_GOLD, and
> > > CONFIG_LD_IS_LLD.
> > >
> > > This simiplifies patches to Makefiles that need to do different things
> > > for different linkers.
> >
>
> Hi Mathieu,
>
> > What guarantees that the linker used for e.g. make defconfig is the same linker used for make ?
> >
> > Is it required with this patch ?
> >
>
> The build system ensures that the compiler (and after this patch, the
> linker) config values are correct before compiling (and prompting the
> user for the new choices that are available to them in that case).
>
> For example:
>
> $ make ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- defconfig
> ...
>
> $ rg "CONFIG_CC_IS|CONFIG_LD_IS" .config
> 10:CONFIG_CC_IS_CLANG=y
> 12:CONFIG_LD_IS_BFD=y
>
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LD=ld.lld
> scripts/kconfig/conf  --syncconfig Kconfig
> *
> * Restart config...
> *
> *
> * General architecture-dependent options
> *
> Kprobes (KPROBES) [N/y/?] n
> Optimize very unlikely/likely branches (JUMP_LABEL) [N/y/?] (NEW)
> Stack Protector buffer overflow detection (STACKPROTECTOR) [Y/n/?] y
>   Strong Stack Protector (STACKPROTECTOR_STRONG) [Y/n/?] y
> Use a virtually-mapped stack (VMAP_STACK) [Y/n/?] y
> Perform full reference count validation at the expense of speed (REFCOUNT_FULL) [Y/?] y
> *
> * GCC plugins
> *
> GCC plugins (GCC_PLUGINS) [N/y/?] (NEW)
> ...
>
> $ rg "CONFIG_CC_IS|CONFIG_LD_IS" .config
> 9:CONFIG_CC_IS_GCC=y
> 13:CONFIG_LD_IS_LLD=y
>
> > How does it work in a cross compile environment ?
> >
>
> Since $(LD) is defined based on $(CROSS_COMPILE), it should work fine.
> I tested it with both arm64 and x86_64 and CONFIG_LD_IS_BFD gets
> set by default and I can see CONFIG_LD_IS_GOLD get set with both
> LD=aarch64-linux-gnu-ld.gold and LD=ld.gold.
>
> If I misunderstood the questions or my explanation wasn't correct,
> please let me know!




With this patch,

include/config/auto.conf.cmd will include the following:

ifneq "$(LD)" "ld"
include/config/auto.conf: FORCE
endif


When $(LD) is changed, Kconfig will be re-run.






--
Best Regards
Masahiro Yamada

  reply	other threads:[~2019-02-11 15:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-07 22:01 [PATCH 1/4] init/Kconfig: add config support for detecting linker ndesaulniers
2019-02-07 22:01 ` [PATCH 2/4] Makefile: clang: choose GCC_TOOLCHAIN_DIR not on LD ndesaulniers
2019-02-08  5:45   ` Nathan Chancellor
2019-02-07 22:01 ` [PATCH 3/4] Makefile: lld: tell clang to use lld ndesaulniers
2019-02-08  5:50   ` Nathan Chancellor
2019-02-08 17:27     ` Nick Desaulniers
2019-02-08 17:45       ` Nathan Chancellor
2019-02-11 15:32       ` Masahiro Yamada
2019-02-11 16:05         ` Sedat Dilek
2019-02-11 19:30           ` Nick Desaulniers
2019-02-11 19:27         ` Nick Desaulniers
2019-02-11 19:26     ` Nick Desaulniers
2019-02-07 22:01 ` [PATCH 4/4] Makefile: lld: set -O2 linker flag when linking with LLD ndesaulniers
2019-02-08  6:07   ` Nathan Chancellor
2019-02-08  0:48 ` [PATCH 1/4] init/Kconfig: add config support for detecting linker Kees Cook
2019-02-08  0:57 ` Mathieu Desnoyers
2019-02-08  5:41   ` Nathan Chancellor
2019-02-11 15:08     ` Masahiro Yamada [this message]
2019-02-08  5:14 ` Nathan Chancellor
2019-02-08 14:06 Sedat Dilek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNAS=hcVtG952t4bNyJMx1_byAeaFHj06P6KmFvTjh4ZQxA@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=adrian@lisas.de \
    --cc=akpm@linux-foundation.org \
    --cc=gor@linux.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=rgb@redhat.com \
    --cc=samitolvanen@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).