summaryrefslogtreecommitdiff
path: root/include/linux/compiler-gcc.h
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2017-08-16 17:47:40 -0700
committerGreg Hackmann <ghackmann@google.com>2017-10-09 14:00:14 -0700
commita61090a6d556ce3a8024b4b084bd7b41ffd2908e (patch)
treedce38c87364097bde38cee5bfb15eeaafe9af786 /include/linux/compiler-gcc.h
parent2f2860a504a30a7645c6a0ec06767c5c7677a4ea (diff)
UPSTREAM: x86/build: Fix stack alignment for CLang
Commit: d77698df39a5 ("x86/build: Specify stack alignment for clang") intended to use the same stack alignment for clang as with gcc. The two compilers use different options to configure the stack alignment (gcc: -mpreferred-stack-boundary=n, clang: -mstack-alignment=n). The above commit assumes that the clang option uses the same parameter type as gcc, i.e. that the alignment is specified as 2^n. However clang interprets the value of this option literally to use an alignment of n, in consequence the stack remains misaligned. Change the values used with -mstack-alignment to be the actual alignment instead of a power of two. cc-option isn't used here with the typical pattern of KBUILD_CFLAGS += $(call cc-option ...). The reason is that older gcc versions don't support the -mpreferred-stack-boundary option, since cc-option doesn't verify whether the alternative option is valid it would incorrectly select the clang option -mstack-alignment.. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Bernhard.Rosenkranzer@linaro.org Cc: Greg Hackmann <ghackmann@google.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Michael Davidson <md@google.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephen Hines <srhines@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: dianders@chromium.org Link: http://lkml.kernel.org/r/20170817004740.170588-1-mka@chromium.org Signed-off-by: Ingo Molnar <mingo@kernel.org> (cherry picked from commit 8f91869766c00622b2eaa8ee567db4f333b78c1a) Signed-off-by: Greg Hackmann <ghackmann@google.com> Change-Id: I7991bfed754f5ac10ac8b383c20ec89d56b2afc0
Diffstat (limited to 'include/linux/compiler-gcc.h')
0 files changed, 0 insertions, 0 deletions