linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [GIT PULL] clang-lto for v5.12-rc1
@ 2021-02-16 22:48 Alexander Lobakin
  2021-02-17 18:08 ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Lobakin @ 2021-02-16 22:48 UTC (permalink / raw)
  To: Kees Cook
  Cc: Alexander Lobakin, Linus Torvalds, linux-kernel, Bill Wendling,
	Bjorn Helgaas, George Burgess IV, Nick Desaulniers,
	Sami Tolvanen, Steven Rostedt, Will Deacon

From: Kees Cook <keescook@chromium.org>
Date: Tue, 16 Feb 2021 12:34:37 -0800

> 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 support is done[1], there is still some
> on-going clean-up work happening for objtool[2] that should hopefully
> land by the v5.13 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 112b6a8e038d793d016e330f53acb9383ac504b3:
> 
>   arm64: allow LTO to be selected (2021-01-14 08:21:10 -0800)
> 
> ----------------------------------------------------------------
> clang-lto for v5.12-rc1
> 
> Provide build infrastructure for arm64 Clang LTO.
> 
> ----------------------------------------------------------------
> 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

Seems like you forgot the fix from [0], didn't you?

>  .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
> 

[0] https://lore.kernel.org/lkml/20210121184544.659998-1-alobakin@pm.me

Al


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] clang-lto for v5.12-rc1
  2021-02-16 22:48 [GIT PULL] clang-lto for v5.12-rc1 Alexander Lobakin
@ 2021-02-17 18:08 ` Kees Cook
  2021-02-22 21:59   ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2021-02-17 18:08 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: Linus Torvalds, linux-kernel, Bill Wendling, Bjorn Helgaas,
	George Burgess IV, Nick Desaulniers, Sami Tolvanen,
	Steven Rostedt, Will Deacon

On Tue, Feb 16, 2021 at 10:48:10PM +0000, Alexander Lobakin wrote:
> From: Kees Cook <keescook@chromium.org>
> Date: Tue, 16 Feb 2021 12:34:37 -0800
> 
> > 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 support is done[1], there is still some
> > on-going clean-up work happening for objtool[2] that should hopefully
> > land by the v5.13 merge window.
> 
[...]
> 
> Seems like you forgot the fix from [0], didn't you?
> 
[...]
> 
> [0] https://lore.kernel.org/lkml/20210121184544.659998-1-alobakin@pm.me

Ah yes, sorry for overlooking that. I can send a follow-up PR. AIUI,
it's usually better for Linus's workflow for me to build on sent PRs
instead of resending. (But given the merge window disruption, we'll see
what happens!)

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] clang-lto for v5.12-rc1
  2021-02-17 18:08 ` Kees Cook
@ 2021-02-22 21:59   ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2021-02-22 21:59 UTC (permalink / raw)
  To: Kees Cook
  Cc: Alexander Lobakin, Linux Kernel Mailing List, Bill Wendling,
	Bjorn Helgaas, George Burgess IV, Nick Desaulniers,
	Sami Tolvanen, Steven Rostedt, Will Deacon

On Wed, Feb 17, 2021 at 10:08 AM Kees Cook <keescook@chromium.org> wrote:
>
> Ah yes, sorry for overlooking that. I can send a follow-up PR. AIUI,
> it's usually better for Linus's workflow for me to build on sent PRs
> instead of resending. (But given the merge window disruption, we'll see
> what happens!)

Since I'm only now getting around to looking at the stuff that wasn't
obvious, can you just add the fix and send a new pull request for the
fixed version?

Power seems fine, I got internet back on today too (I was working by
tethering off my phone over the weekend), so I should be all back to
normal.

              Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] clang-lto for v5.12-rc1
  2021-02-16 20:34 Kees Cook
@ 2021-02-23 20:32 ` pr-tracker-bot
  0 siblings, 0 replies; 5+ messages in thread
From: pr-tracker-bot @ 2021-02-23 20:32 UTC (permalink / raw)
  To: Kees Cook
  Cc: Linus Torvalds, linux-kernel, Bill Wendling, Bjorn Helgaas,
	George Burgess IV, Kees Cook, Nick Desaulniers, Sami Tolvanen,
	Steven Rostedt, Will Deacon

The pull request you sent on Tue, 16 Feb 2021 12:34:37 -0800:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/2b8689520520175075ca97bc4eaf51ff3f7253aa

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [GIT PULL] clang-lto for v5.12-rc1
@ 2021-02-16 20:34 Kees Cook
  2021-02-23 20:32 ` pr-tracker-bot
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2021-02-16 20:34 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Bill Wendling, Bjorn Helgaas, George Burgess IV,
	Kees Cook, Nick Desaulniers, Sami Tolvanen, Steven Rostedt,
	Will Deacon

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 support is done[1], there is still some
on-going clean-up work happening for objtool[2] that should hopefully
land by the v5.13 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 112b6a8e038d793d016e330f53acb9383ac504b3:

  arm64: allow LTO to be selected (2021-01-14 08:21:10 -0800)

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

Provide build infrastructure for arm64 Clang LTO.

----------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-23 20:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 22:48 [GIT PULL] clang-lto for v5.12-rc1 Alexander Lobakin
2021-02-17 18:08 ` Kees Cook
2021-02-22 21:59   ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2021-02-16 20:34 Kees Cook
2021-02-23 20:32 ` pr-tracker-bot

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).