aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d0901b46b4bf..a897c50db515 100644
--- a/Makefile
+++ b/Makefile
@@ -621,6 +621,9 @@ else
621KBUILD_CFLAGS += -O2 621KBUILD_CFLAGS += -O2
622endif 622endif
623 623
624# Tell gcc to never replace conditional load with a non-conditional one
625KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
626
624ifdef CONFIG_READABLE_ASM 627ifdef CONFIG_READABLE_ASM
625# Disable optimizations that make assembler listings hard to read. 628# Disable optimizations that make assembler listings hard to read.
626# reorder blocks reorders the control in the function 629# reorder blocks reorders the control in the function
@@ -636,6 +639,22 @@ KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
636endif 639endif
637 640
638# Handle stack protector mode. 641# Handle stack protector mode.
642#
643# Since kbuild can potentially perform two passes (first with the old
644# .config values and then with updated .config values), we cannot error out
645# if a desired compiler option is unsupported. If we were to error, kbuild
646# could never get to the second pass and actually notice that we changed
647# the option to something that was supported.
648#
649# Additionally, we don't want to fallback and/or silently change which compiler
650# flags will be used, since that leads to producing kernels with different
651# security feature characteristics depending on the compiler used. ("But I
652# selected CC_STACKPROTECTOR_STRONG! Why did it build with _REGULAR?!")
653#
654# The middle ground is to warn here so that the failed option is obvious, but
655# to let the build fail with bad compiler flags so that we can't produce a
656# kernel when there is a CONFIG and compiler mismatch.
657#
639ifdef CONFIG_CC_STACKPROTECTOR_REGULAR 658ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
640 stackp-flag := -fstack-protector 659 stackp-flag := -fstack-protector
641 ifeq ($(call cc-option, $(stackp-flag)),) 660 ifeq ($(call cc-option, $(stackp-flag)),)