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)
|
2016-04-06 05:34:54 +08:00
|
|
|
ifeq ($(CONFIG_X86_IAMCU),)
|
|
|
|
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
|
|
|
|
else
|
|
|
|
CC_M32 = -m32 -mmcu
|
|
|
|
KBUILD_CFLAGS += -mmcu
|
|
|
|
KBUILD_CPPFLAGS += -mmcu
|
|
|
|
endif
|
2015-08-24 10:01:07 +08:00
|
|
|
biarch := $(call cc-option,-m32)
|
2016-04-06 05:34:54 +08:00
|
|
|
dwarf2 := $(call cc-option,-gdwarf-2)
|
2015-08-24 10:01:07 +08:00
|
|
|
KBUILD_AFLAGS += $(biarch)
|
|
|
|
KBUILD_CFLAGS += $(biarch)
|
2016-04-06 05:34:54 +08:00
|
|
|
KBUILD_CFLAGS += $(dwarf2)
|
2015-08-24 10:01:07 +08:00
|
|
|
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
|
|
|
|
|
2016-04-03 21:37:43 +08:00
|
|
|
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
|
2015-08-23 23:22:40 +08:00
|
|
|
|
2016-01-13 20:49:42 +08:00
|
|
|
KBUILD_CXXFLAGS += $(cflags-y)
|
|
|
|
KBUILD_CFLAGS += $(cflags-y)
|
2015-08-23 23:22:40 +08:00
|
|
|
|
2016-05-26 23:32:04 +08:00
|
|
|
soc-cxxflags ?= $(soc-cflags)
|
|
|
|
soc-aflags ?= $(soc-cflags)
|
|
|
|
KBUILD_CFLAGS += $(soc-cflags)
|
|
|
|
KBUILD_CXXFLAGS += $(soc-cxxflags)
|
|
|
|
KBUILD_AFLAGS += $(soc-aflags)
|
|
|
|
|
2015-08-23 23:22:40 +08:00
|
|
|
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)) \
|
2016-05-05 22:55:39 +08:00
|
|
|
-nographic -vga none -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
|