X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile;h=455fd484b20edb92a0c916c1be3cc7adffc6cfa4;hb=32665f2bbfed2e325d37236d9b0071a11a69124e;hp=b8b7f74696b4094de39ba65839de236edd5e643e;hpb=561a60f025f7b173830c4a2d51f5725bd2094ddf;p=firefly-linux-kernel-4.4.55.git diff --git a/Makefile b/Makefile index b8b7f74696b4..455fd484b20e 100644 --- a/Makefile +++ b/Makefile @@ -595,10 +595,24 @@ ifneq ($(CONFIG_FRAME_WARN),0) KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN}) endif -# Force gcc to behave correct even for buggy distributions -ifndef CONFIG_CC_STACKPROTECTOR -KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) +# Handle stack protector mode. +ifdef CONFIG_CC_STACKPROTECTOR_REGULAR + stackp-flag := -fstack-protector + ifeq ($(call cc-option, $(stackp-flag)),) + $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \ + -fstack-protector not supported by compiler)) + endif +else ifdef CONFIG_CC_STACKPROTECTOR_STRONG + stackp-flag := -fstack-protector-strong + ifeq ($(call cc-option, $(stackp-flag)),) + $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \ + -fstack-protector-strong not supported by compiler) + endif +else + # Force off for distro compilers that enable stack protector by default. + stackp-flag := $(call cc-option, -fno-stack-protector) endif +KBUILD_CFLAGS += $(stackp-flag) # This warning generated too much noise in a regular build. # Use make W=1 to enable this warning (see scripts/Makefile.build)