2015-08-23 23:22:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
PERF_OPT=$(if $(filter -Os,$(KBUILD_CFLAGS)),,y)
|
|
|
|
|
|
|
|
cflags-y += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,)
|
2015-09-24 03:54:28 +08:00
|
|
|
ifeq ($(PERF_OPT),y)
|
|
|
|
cflags-y += -DPERF_OPT
|
|
|
|
else
|
2015-08-24 10:01:07 +08:00
|
|
|
PREFERRED_STACK_BOUNDARY = y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(COMPILER),clang)
|
|
|
|
biarch := $(call cc-option,-m32)
|
|
|
|
KBUILD_AFLAGS += $(biarch)
|
|
|
|
KBUILD_CFLAGS += $(biarch)
|
|
|
|
else
|
|
|
|
cflags-$(PREFERRED_STACK_BOUNDARY) += $(call cc-option,-mpreferred-stack-boundary=2)
|
2015-09-24 03:54:28 +08:00
|
|
|
endif
|
2015-08-23 23:22:40 +08:00
|
|
|
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
|
|
|
|
|
|
|
|
|
2015-09-24 00:19:20 +08:00
|
|
|
ifneq ($(CONFIG_SSE_FP_MATH),y)
|
|
|
|
cflags-y += -mno-sse
|
2015-08-23 23:22:40 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
arch-$(CONFIG_CPU_ATOM) += $(call cc-option,-march=atom) \
|
|
|
|
$(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
|
|
|
|
arch-$(CONFIG_CPU_MINUTEIA) += $(call cc-option,-march=pentium)
|
|
|
|
|
2015-10-11 19:22:22 +08:00
|
|
|
ifeq ($(CONFIG_STACK_CANARIES),y)
|
|
|
|
cflags-y += $(call cc-option,-fstack-protector-all,)
|
|
|
|
else
|
|
|
|
cflags-y += $(call cc-option,-fno-stack-protector,)
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2015-08-23 23:22:40 +08:00
|
|
|
KBUILD_CFLAGS += $(cflags-y) $(arch-y)
|
|
|
|
KBUILD_AFLAGS += $(arch-y)
|
|
|
|
|
|
|
|
|
|
|
|
QEMU_BIOS ?= /usr/share/qemu
|
|
|
|
QEMU_CPU_TYPE_x86 = qemu32
|
2015-10-02 03:30:04 +08:00
|
|
|
QEMU_X86_NO_REBOOT_y =
|
|
|
|
QEMU_X86_NO_REBOOT_ = -no-reboot
|
2015-08-23 23:22:40 +08:00
|
|
|
QEMU_FLAGS_x86 = -m 32 -cpu $(QEMU_CPU_TYPE_x86) \
|
2015-10-02 03:30:04 +08:00
|
|
|
$(QEMU_X86_NO_REBOOT_$(CONFIG_REBOOT)) \
|
|
|
|
-nographic -display none -net none \
|
2015-08-23 23:22:40 +08:00
|
|
|
-clock dynticks -no-acpi -balloon none \
|
|
|
|
-L $(QEMU_BIOS) -bios bios.bin \
|
|
|
|
-machine type=pc-0.14
|
|
|
|
QEMU_x86 = qemu-system-i386
|
|
|
|
|
|
|
|
export QEMU_FLAGS_x86 QEMU_x86 QEMU_CPU_TYPE_x86
|