]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
x86/build: Mostly disable '-maccumulate-outgoing-args'
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 16 Mar 2017 19:31:33 +0000 (14:31 -0500)
committerIngo Molnar <mingo@kernel.org>
Thu, 30 Mar 2017 09:53:04 +0000 (11:53 +0200)
commit3f135e57a4f76d24ae8d8a490314331f0ced40c5
tree92ce586380d684ae6a1c187a90ece60af72b026d
parenta46f60d76004965e5669dbf3fc21ef3bc3632eb4
x86/build: Mostly disable '-maccumulate-outgoing-args'

The GCC '-maccumulate-outgoing-args' flag is enabled for most configs,
mostly because of issues which are no longer relevant.  For most
configs, and with most recent versions of GCC, it's no longer needed.

Clarify which cases need it, and only enable it for those cases.  Also
produce a compile-time error for the ftrace graph + mcount + '-Os' case,
which will otherwise cause runtime failures.

The main benefit of '-maccumulate-outgoing-args' is that it prevents an
ugly prologue for functions which have aligned stacks.  But removing the
option also has some benefits: more readable argument saves, smaller
text size, and (presumably) slightly improved performance.

Here are the object size savings for 32-bit and 64-bit defconfig
kernels:

      text    data     bss      dec     hex filename
  10006710 3543328 1773568 15323606  e9d1d6 vmlinux.x86-32.before
   9706358 3547424 1773568 15027350  e54c96 vmlinux.x86-32.after

      text    data     bss      dec     hex filename
  10652105 4537576  843776 16033457  f4a6b1 vmlinux.x86-64.before
  10639629 4537576  843776 16020981  f475f5 vmlinux.x86-64.after

That comes out to a 3% text size improvement on x86-32 and a 0.1% text
size improvement on x86-64.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andrew Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170316193133.zrj6gug53766m6nn@treble
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/Makefile
arch/x86/Makefile_32.cpu
arch/x86/kernel/ftrace.c
scripts/Kbuild.include