94
94
# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
96
96
as-option = $(call try-run,\
97
$(CC) $(KBUILD_CFLAGS) $(1) -c -xassembler /dev/null -o "$$TMP",$(1),$(2))
97
$(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2))
100
100
# Usage: cflags-y += $(call as-instr,instr,option1,option2)
102
102
as-instr = $(call try-run,\
103
/bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
103
/bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
106
106
# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
108
108
cc-option = $(call try-run,\
109
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2))
109
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
112
112
# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
113
113
cc-option-yn = $(call try-run,\
114
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n)
114
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
116
116
# cc-option-align
117
117
# Prefix align with either -falign or -malign
121
121
# cc-disable-warning
122
122
# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
123
123
cc-disable-warning = $(call try-run,\
124
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -xc /dev/null -o "$$TMP",-Wno-$(strip $(1)))
124
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
127
127
# Usage gcc-ver := $(call cc-version)
140
140
# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
141
141
cc-ldoption = $(call try-run,\
142
$(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2))
142
$(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
145
145
# Usage: LDFLAGS += $(call ld-option, -X)