All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Sami Tolvanen <samitolvanen@google.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Greg Hackmann <ghackmann@google.com>,
	Kees Cook <keescook@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH 01/15] kbuild: add ld-name macro and support for GNU gold
Date: Fri, 3 Nov 2017 11:24:18 -0700	[thread overview]
Message-ID: <CAKwvOdkRj9RdmmsRu+q6ntwD8ZVidAH7L+nGuzf7xEPuVap-Vw@mail.gmail.com> (raw)
In-Reply-To: <20171103171203.107569-2-samitolvanen@google.com>

+ Kbuild mailing list and maintainers

The use of these ternary like operations will need to be expanded if
additional compilers come along (less likely), or additional linkers
(more likely, we are looking into lld right now) but we can cross that
bridge when we get there.

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

On Fri, Nov 3, 2017 at 10:11 AM, Sami Tolvanen <samitolvanen@google.com> wrote:
> GNU gold may require different flags than GNU ld. Add a macro for
> detecting the linker and conditionally add gold specific flags from
> LDFLAGS_GOLD.
>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
>  Makefile               | 5 +++++
>  scripts/Kbuild.include | 4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 3a8868ee967e..59980d5a03d0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -826,6 +826,11 @@ include scripts/Makefile.kasan
>  include scripts/Makefile.extrawarn
>  include scripts/Makefile.ubsan
>
> +# Add any flags specific to ld.gold
> +ifeq ($(ld-name),gold)
> +LDFLAGS                += $(LDFLAGS_GOLD)
> +endif
> +
>  # Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
>  # last assignments
>  KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index 9ffd3dda3889..584d6cecd7c0 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -172,6 +172,10 @@ ld-option = $(call try-run,\
>  # Important: no spaces around options
>  ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
>
> +# ld-name
> +# Expands to either bfd or gold
> +ld-name = $(shell $(LD) -v 2>&1 | grep -q "GNU gold" && echo gold || echo bfd)
> +
>  # ld-version
>  # Note this is mainly for HJ Lu's 3 number binutil versions
>  ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
> --
> 2.15.0.403.gc27cc4dac6-goog
>



-- 
Thanks,
~Nick Desaulniers

WARNING: multiple messages have this Message-ID (diff)
From: ndesaulniers@google.com (Nick Desaulniers)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/15] kbuild: add ld-name macro and support for GNU gold
Date: Fri, 3 Nov 2017 11:24:18 -0700	[thread overview]
Message-ID: <CAKwvOdkRj9RdmmsRu+q6ntwD8ZVidAH7L+nGuzf7xEPuVap-Vw@mail.gmail.com> (raw)
In-Reply-To: <20171103171203.107569-2-samitolvanen@google.com>

+ Kbuild mailing list and maintainers

The use of these ternary like operations will need to be expanded if
additional compilers come along (less likely), or additional linkers
(more likely, we are looking into lld right now) but we can cross that
bridge when we get there.

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

On Fri, Nov 3, 2017 at 10:11 AM, Sami Tolvanen <samitolvanen@google.com> wrote:
> GNU gold may require different flags than GNU ld. Add a macro for
> detecting the linker and conditionally add gold specific flags from
> LDFLAGS_GOLD.
>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
>  Makefile               | 5 +++++
>  scripts/Kbuild.include | 4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 3a8868ee967e..59980d5a03d0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -826,6 +826,11 @@ include scripts/Makefile.kasan
>  include scripts/Makefile.extrawarn
>  include scripts/Makefile.ubsan
>
> +# Add any flags specific to ld.gold
> +ifeq ($(ld-name),gold)
> +LDFLAGS                += $(LDFLAGS_GOLD)
> +endif
> +
>  # Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
>  # last assignments
>  KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index 9ffd3dda3889..584d6cecd7c0 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -172,6 +172,10 @@ ld-option = $(call try-run,\
>  # Important: no spaces around options
>  ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
>
> +# ld-name
> +# Expands to either bfd or gold
> +ld-name = $(shell $(LD) -v 2>&1 | grep -q "GNU gold" && echo gold || echo bfd)
> +
>  # ld-version
>  # Note this is mainly for HJ Lu's 3 number binutil versions
>  ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
> --
> 2.15.0.403.gc27cc4dac6-goog
>



-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2017-11-03 18:24 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 17:11 [PATCH 00/15] Add support for clang LTO Sami Tolvanen
2017-11-03 17:11 ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 01/15] kbuild: add ld-name macro and support for GNU gold Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 18:24   ` Nick Desaulniers [this message]
2017-11-03 18:24     ` Nick Desaulniers
2017-11-03 17:11 ` [PATCH 02/15] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with " Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 03/15] kbuild: add support for clang LTO Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 04/15] kbuild: fix dynamic ftrace with " Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 05/15] scripts/mod: disable LTO for empty.c Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 06/15] efi/libstub: disable clang LTO Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 20:10   ` Ard Biesheuvel
2017-11-03 20:10     ` Ard Biesheuvel
2017-11-03 17:11 ` [PATCH 06/15] efi/libstub: disable LTO Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 07/15] arm64: use -mno-implicit-float instead of -mgeneral-regs-only Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:50   ` Nick Desaulniers
2017-11-03 17:50     ` Nick Desaulniers
2017-11-03 18:02   ` Mark Rutland
2017-11-03 18:02     ` Mark Rutland
2017-11-03 18:20     ` Nick Desaulniers
2017-11-03 18:20       ` Nick Desaulniers
2017-11-03 18:31   ` Mark Rutland
2017-11-03 18:31     ` Mark Rutland
2017-11-03 18:52     ` Mark Rutland
2017-11-03 18:52       ` Mark Rutland
2017-11-03 19:06       ` Kees Cook
2017-11-03 19:06         ` Kees Cook
2017-11-03 20:18         ` Sami Tolvanen
2017-11-03 20:18           ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 08/15] arm64: don't pass -maarch64linux to GNU gold Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 20:41   ` Yury Norov
2017-11-03 20:41     ` Yury Norov
2017-11-06 16:56     ` Sami Tolvanen
2017-11-06 16:56       ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 09/15] arm64: keep .altinstructions and .altinstr_replacement Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 18:40   ` Nick Desaulniers
2017-11-03 18:40     ` Nick Desaulniers
2017-11-03 17:11 ` [PATCH 10/15] arm64: disable ARM64_ERRATUM_843419 for clang LTO Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 20:13   ` Ard Biesheuvel
2017-11-03 20:13     ` Ard Biesheuvel
2017-11-09 18:54     ` Sami Tolvanen
2017-11-09 18:54       ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 11/15] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 11/15] arm64: fix mrs_s/msr_s macros for clang LTO Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 12/15] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:11 ` [PATCH 12/15] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold Sami Tolvanen
2017-11-03 17:11   ` Sami Tolvanen
2017-11-03 17:12 ` [PATCH 13/15] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS Sami Tolvanen
2017-11-03 17:12   ` Sami Tolvanen
2017-11-03 20:09   ` Ard Biesheuvel
2017-11-03 20:09     ` Ard Biesheuvel
2017-11-03 20:29     ` Sami Tolvanen
2017-11-03 20:29       ` Sami Tolvanen
2017-11-03 17:12 ` [PATCH 13/15] arm64: fix mrs_s/msr_s macros for clang LTO Sami Tolvanen
2017-11-03 17:12   ` Sami Tolvanen
2017-11-03 17:53   ` Nick Desaulniers
2017-11-03 17:53     ` Nick Desaulniers
2017-11-03 18:06     ` Mark Rutland
2017-11-03 18:06       ` Mark Rutland
2017-11-03 18:15       ` Nick Desaulniers
2017-11-03 18:15         ` Nick Desaulniers
2017-11-03 18:38   ` Mark Rutland
2017-11-03 18:38     ` Mark Rutland
2017-11-08  9:25   ` Yury Norov
2017-11-08  9:25     ` Yury Norov
2017-11-09  0:02     ` Andi Kleen
2017-11-09  0:02       ` Andi Kleen
2017-11-09  4:48       ` Maxim Kuvyrkov
2017-11-09  4:48         ` Maxim Kuvyrkov
2017-11-09 16:51         ` Sami Tolvanen
2017-11-09 16:51           ` Sami Tolvanen
2017-11-09 16:50       ` Sami Tolvanen
2017-11-09 16:50         ` Sami Tolvanen
2017-11-09 16:45     ` Sami Tolvanen
2017-11-09 16:45       ` Sami Tolvanen
2017-11-03 17:12 ` [PATCH 14/15] arm64: crypto: disable LTO for aes-ce-cipher.c Sami Tolvanen
2017-11-03 17:12   ` Sami Tolvanen
2017-11-03 20:10   ` Ard Biesheuvel
2017-11-03 20:10     ` Ard Biesheuvel
2017-11-03 17:12 ` [PATCH 15/15] arm64: select ARCH_SUPPORTS_CLANG_LTO Sami Tolvanen
2017-11-03 17:12   ` Sami Tolvanen
2017-11-03 17:51 ` [PATCH 00/15] Add support for clang LTO Mark Rutland
2017-11-03 17:51   ` Mark Rutland
2017-11-03 18:07   ` Nick Desaulniers
2017-11-03 18:07     ` Nick Desaulniers
2017-11-03 18:29     ` Mark Rutland
2017-11-03 18:29       ` Mark Rutland
2017-11-03 18:36       ` Nick Desaulniers
2017-11-03 18:36         ` Nick Desaulniers
2017-11-03 18:49         ` Mark Rutland
2017-11-03 18:49           ` Mark Rutland
2017-11-03 18:07   ` Matthias Kaehlcke
2017-11-03 18:07     ` Matthias Kaehlcke
2017-11-03 18:09   ` Mark Rutland
2017-11-03 18:09     ` Mark Rutland
2017-11-03 18:11     ` Nick Desaulniers
2017-11-03 18:11       ` Nick Desaulniers
2017-11-03 19:26       ` Mark Rutland
2017-11-03 19:26         ` Mark Rutland
2017-11-03 19:56         ` Sami Tolvanen
2017-11-03 19:56           ` Sami Tolvanen
2017-11-04  2:13           ` Mark Rutland
2017-11-04  2:13             ` Mark Rutland
2017-11-09 10:54             ` AKASHI Takahiro
2017-11-09 10:54               ` AKASHI Takahiro
2017-11-09 11:03               ` Marc Zyngier
2017-11-09 11:03                 ` Marc Zyngier
2017-11-09 16:31               ` Sami Tolvanen
2017-11-09 16:31                 ` Sami Tolvanen
2017-11-03 20:23         ` Ard Biesheuvel
2017-11-03 20:23           ` Ard Biesheuvel
2017-11-03 18:22   ` Sami Tolvanen
2017-11-03 18:22     ` Sami Tolvanen

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=CAKwvOdkRj9RdmmsRu+q6ntwD8ZVidAH7L+nGuzf7xEPuVap-Vw@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=ghackmann@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mka@chromium.org \
    --cc=samitolvanen@google.com \
    --cc=yamada.masahiro@socionext.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.