All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Alexander Lobakin <alobakin@pm.me>,
	Sami Tolvanen <samitolvanen@google.com>,
	Bill Wendling <morbo@google.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	George Burgess IV <gbiv@google.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Will Deacon <will@kernel.org>
Subject: [GIT PULL v2] clang-lto for v5.12-rc1
Date: Mon, 22 Feb 2021 15:11:19 -0800	[thread overview]
Message-ID: <202102221504.0418BE2D1@keescook> (raw)

Hi Linus,

Please pull this Clang Link Time Optimization series for v5.12-rc1.
This has been in linux-next for the entire last development cycle,
and is built on the work done preparing[0] for LTO by arm64 folks,
tracing folks, etc. This series includes the core changes as well as
the remaining pieces for arm64 (LTO has been the default build method on
Android for about 3 years now, as it is the prerequisite for the Control
Flow Integrity protections).

While x86 LTO enablement is done[1], it depends on some objtool
clean-ups[2], though it appears those actually have been in linux-next
(via tip/objtool/core), so it's possible that if that tree lands, I'll
send a "part 2" pull request for LTO that includes x86 support (though
I guess that depends on the length of the merge window).

For merge log posterity, and as detailed in commit dc5723b02e52 ("kbuild:
add support for Clang LTO"), here is the lt;dr to do an LTO build:

	make LLVM=1 LLVM_IAS=1 defconfig
	scripts/config -e LTO_CLANG_THIN
	make LLVM=1 LLVM_IAS=1

(To do a cross-compile of arm64, add "CROSS_COMPILE=aarch64-linux-gnu-"
and "ARCH=arm64" to the "make" command lines.)

Thanks!

-Kees

[0] https://git.kernel.org/linus/3c09ec59cdea5b132212d97154d625fd34e436dd
[1] https://github.com/samitolvanen/linux/commits/clang-lto
[2] https://lore.kernel.org/lkml/cover.1611263461.git.jpoimboe@redhat.com/

The following changes since commit e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62:

  Linux 5.11-rc2 (2021-01-03 15:55:30 -0800)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/clang-lto-v5.12-rc1

for you to fetch changes up to 2b8689520520175075ca97bc4eaf51ff3f7253aa:

  kbuild: prevent CC_FLAGS_LTO self-bloating on recursive rebuilds (2021-02-17 10:10:37 -0800)

----------------------------------------------------------------
clang-lto series for v5.12-rc1

- Clang LTO build infrastructure and arm64-specific enablement (Sami Tolvanen)
- Recursive build CC_FLAGS_LTO fix (Alexander Lobakin)

----------------------------------------------------------------
Alexander Lobakin (1):
      kbuild: prevent CC_FLAGS_LTO self-bloating on recursive rebuilds

Sami Tolvanen (16):
      tracing: move function tracer options to Kconfig
      kbuild: add support for Clang LTO
      kbuild: lto: fix module versioning
      kbuild: lto: limit inlining
      kbuild: lto: merge module sections
      kbuild: lto: add a default list of used symbols
      init: lto: ensure initcall ordering
      init: lto: fix PREL32 relocations
      PCI: Fix PREL32 relocations for LTO
      modpost: lto: strip .lto from module names
      scripts/mod: disable LTO for empty.c
      efi/libstub: disable LTO
      drivers/misc/lkdtm: disable LTO for rodata.o
      arm64: vdso: disable LTO
      arm64: disable recordmcount with DYNAMIC_FTRACE_WITH_REGS
      arm64: allow LTO to be selected

 .gitignore                            |   1 +
 Makefile                              |  45 ++++--
 arch/Kconfig                          |  90 ++++++++++++
 arch/arm64/Kconfig                    |   4 +
 arch/arm64/kernel/vdso/Makefile       |   3 +-
 drivers/firmware/efi/libstub/Makefile |   2 +
 drivers/misc/lkdtm/Makefile           |   1 +
 include/asm-generic/vmlinux.lds.h     |  11 +-
 include/linux/init.h                  |  79 ++++++++--
 include/linux/pci.h                   |  27 +++-
 init/Kconfig                          |   1 +
 kernel/trace/Kconfig                  |  16 ++
 scripts/Makefile.build                |  48 +++++-
 scripts/Makefile.lib                  |   6 +-
 scripts/Makefile.modfinal             |   9 +-
 scripts/Makefile.modpost              |  25 +++-
 scripts/generate_initcall_order.pl    | 270 ++++++++++++++++++++++++++++++++++
 scripts/link-vmlinux.sh               |  70 +++++++--
 scripts/lto-used-symbollist.txt       |   5 +
 scripts/mod/Makefile                  |   1 +
 scripts/mod/modpost.c                 |  16 +-
 scripts/mod/modpost.h                 |   9 ++
 scripts/mod/sumversion.c              |   6 +-
 scripts/module.lds.S                  |  24 +++
 24 files changed, 707 insertions(+), 62 deletions(-)
 create mode 100755 scripts/generate_initcall_order.pl
 create mode 100644 scripts/lto-used-symbollist.txt

-- 
Kees Cook

             reply	other threads:[~2021-02-22 23:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 23:11 Kees Cook [this message]
2021-02-23 17:49 ` [GIT PULL v2] clang-lto for v5.12-rc1 Linus Torvalds
2021-02-23 20:33   ` Linus Torvalds
2021-02-23 20:43     ` Kees Cook
2021-02-23 20:49     ` Alexander Lobakin
2021-02-24 16:04       ` Arnd Bergmann
2021-02-23 20:32 ` pr-tracker-bot

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=202102221504.0418BE2D1@keescook \
    --to=keescook@chromium.org \
    --cc=alobakin@pm.me \
    --cc=bhelgaas@google.com \
    --cc=gbiv@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.org \
    /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.