@@ -108,16 +108,20 @@ as-option = $(call try-run,\
108
108
as-instr = $(call try-run,\
109
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.)
113
+ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
114
+
111
115
# cc-option
112
116
# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
113
117
114
118
cc-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
121
# cc-option-yn
118
122
# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
119
123
cc-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
126
# cc-option-align
123
127
# Prefix align with either -falign or -malign
@@ -127,7 +131,7 @@ cc-option-align = $(subst -functions=0,,\
127
131
# cc-disable-warning
128
132
# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
129
133
cc-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
136
# cc-name
133
137
# Expands to either gcc or clang
0 commit comments