diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -621,6 +621,9 @@ else | |||
621 | KBUILD_CFLAGS += -O2 | 621 | KBUILD_CFLAGS += -O2 |
622 | endif | 622 | endif |
623 | 623 | ||
624 | # Tell gcc to never replace conditional load with a non-conditional one | ||
625 | KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) | ||
626 | |||
624 | ifdef CONFIG_READABLE_ASM | 627 | ifdef 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}) | |||
636 | endif | 639 | endif |
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 | # | ||
639 | ifdef CONFIG_CC_STACKPROTECTOR_REGULAR | 658 | ifdef 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)),) |