x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTK
authorJosh Triplett <josh@joshtriplett.org>
Mon, 10 Mar 2014 20:26:10 +0000 (13:26 -0700)
committerJosh Triplett <josh@joshtriplett.org>
Sun, 17 Aug 2014 21:58:24 +0000 (14:58 -0700)
All the code in early_serial_console.c gets compiled out if
!CONFIG_EARLY_PRINTK, but early_serial_console.o itself still gets
compiled in.  Eliminate it from the compile entirely in that case.

This does not change the generated code at all, in either case.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
arch/x86/boot/compressed/Makefile
arch/x86/boot/compressed/early_serial_console.c

index 3b9b00c68fd8d4d53fad3c710e70c46ffb331896..20db5b3609de54f594b2039abf82d17d27ab1737 100644 (file)
@@ -27,9 +27,10 @@ hostprogs-y  := mkpiggy
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
 
 vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \
-       $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \
+       $(obj)/string.o $(obj)/cmdline.o \
        $(obj)/piggy.o $(obj)/cpuflags.o
 
+vmlinux-objs-$(CONFIG_EARLY_PRINTK) += $(obj)/early_serial_console.o
 vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o
 
 $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
index d3d003cb5481cdcabe0b5c5369bad920838b8d8f..261e81fb95826d0264c8ad3148f6259cc0c3f51d 100644 (file)
@@ -1,9 +1,5 @@
 #include "misc.h"
 
-#ifdef CONFIG_EARLY_PRINTK
-
 int early_serial_base;
 
 #include "../early_serial_console.c"
-
-#endif