diff options
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r-- | scripts/Kbuild.include | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 53b7d47ce43a..dd8e2dde0b34 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -108,6 +108,11 @@ as-option = $(call try-run,\ | |||
108 | as-instr = $(call try-run,\ | 108 | as-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 | # __cc-option | ||
112 | # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) | ||
113 | __cc-option = $(call try-run,\ | ||
114 | $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4)) | ||
115 | |||
111 | # Do not attempt to build with gcc plugins during cc-option tests. | 116 | # 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.) | 117 | # (And this uses delayed resolution so the flags will be up to date.) |
113 | CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) | 118 | CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) |
@@ -115,8 +120,13 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) | |||
115 | # cc-option | 120 | # cc-option |
116 | # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) | 121 | # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) |
117 | 122 | ||
118 | cc-option = $(call try-run,\ | 123 | cc-option = $(call __cc-option, $(CC),\ |
119 | $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) | 124 | $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2)) |
125 | |||
126 | # hostcc-option | ||
127 | # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) | ||
128 | hostcc-option = $(call __cc-option, $(HOSTCC),\ | ||
129 | $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) | ||
120 | 130 | ||
121 | # cc-option-yn | 131 | # cc-option-yn |
122 | # Usage: flag := $(call cc-option-yn,-march=winchip-c6) | 132 | # Usage: flag := $(call cc-option-yn,-march=winchip-c6) |