summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/i386/Makefile4
-rw-r--r--arch/x86_64/Makefile5
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 82c38e1acc4d..4c8f1c06f572 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -56,6 +56,10 @@ cflags-$(CONFIG_X86_ELAN) += -march=i486
GCC_VERSION := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
cflags-$(CONFIG_REGPARM) += $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
+# Enable unit-at-a-time mode when possible. It shrinks the
+# kernel considerably.
+CFLAGS += $(call check_gcc,-funit-at-a-time,)
+
CFLAGS += $(cflags-y)
# Default subarch .c files
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 433c143b4045..b85a920ebe7f 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -56,7 +56,10 @@ CFLAGS += -Wno-sign-compare
ifneq ($(CONFIG_DEBUG_INFO),y)
CFLAGS += -fno-asynchronous-unwind-tables
endif
-#CFLAGS += $(call check_gcc,-funit-at-a-time,)
+
+# Enable unit-at-a-time mode when possible. It shrinks the
+# kernel considerably.
+CFLAGS += $(call check_gcc,-funit-at-a-time,)
head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o