aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/Kbuild.include10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 15b196fc2f49..179219845dfc 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -108,16 +108,20 @@ as-option = $(call try-run,\
108as-instr = $(call try-run,\ 108as-instr = $(call try-run,\
109 printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) 109 printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
110 110
111# Do not attempt to build with gcc plugins during cc-option tests.
112# (And this uses delayed resolution so the flags will be up to date.)
113CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
114
111# cc-option 115# cc-option
112# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) 116# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
113 117
114cc-option = $(call try-run,\ 118cc-option = $(call try-run,\
115 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) 119 $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
116 120
117# cc-option-yn 121# cc-option-yn
118# Usage: flag := $(call cc-option-yn,-march=winchip-c6) 122# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
119cc-option-yn = $(call try-run,\ 123cc-option-yn = $(call try-run,\
120 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) 124 $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
121 125
122# cc-option-align 126# cc-option-align
123# Prefix align with either -falign or -malign 127# Prefix align with either -falign or -malign
@@ -127,7 +131,7 @@ cc-option-align = $(subst -functions=0,,\
127# cc-disable-warning 131# cc-disable-warning
128# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) 132# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
129cc-disable-warning = $(call try-run,\ 133cc-disable-warning = $(call try-run,\
130 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) 134 $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
131 135
132# cc-name 136# cc-name
133# Expands to either gcc or clang 137# Expands to either gcc or clang