diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-05 06:01:44 -0400 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-07-09 23:20:44 -0400 |
| commit | 4ba7f80f42563903b0e26d30175808db7d07e664 (patch) | |
| tree | 133045a186314d895acaa67f8fa9398535b79cf1 | |
| parent | 9e005b761e7ad153dcf40a6cba1d681fe0830ac6 (diff) | |
powerpc/boot: pass CONFIG options in a simpler and more robust way
Commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper")
was wrong, but commit e41b93a6be57 ("powerpc/boot: Fix build failures
with -j 1") was also wrong.
The correct dependency is:
$(obj)/serial.o: $(obj)/autoconf.h
However, I do not see the reason why we need to copy autoconf.h to
arch/power/boot/. Nor do I see consistency in the way of passing
CONFIG options.
decompress.c references CONFIG_KERNEL_GZIP and CONFIG_KERNEL_XZ, which
are passed via the command line.
serial.c includes autoconf.h to reference a couple of CONFIG options,
but this is fragile because we often forget to include "autoconf.h"
from source files.
In fact, it is already broken.
ppc_asm.h references CONFIG_PPC_8xx, but utils.S is not given any way
to access CONFIG options. So, CONFIG_PPC_8xx is never defined here.
Pass $(LINUXINCLUDE) to make sure CONFIG options are accessible from
all .c and .S files in arch/powerpc/boot/.
I also removed the -traditional flag to make include/linux/kconfig.h
work. This flag makes the preprocessor imitate the behavior of the
pre-standard C compiler, but I do not understand why it is necessary.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190705100144.28785-2-yamada.masahiro@socionext.com
| -rw-r--r-- | arch/powerpc/boot/.gitignore | 2 | ||||
| -rw-r--r-- | arch/powerpc/boot/Makefile | 16 | ||||
| -rw-r--r-- | arch/powerpc/boot/serial.c | 1 |
3 files changed, 3 insertions, 16 deletions
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore index 32034a0cc554..6610665fcf5e 100644 --- a/arch/powerpc/boot/.gitignore +++ b/arch/powerpc/boot/.gitignore | |||
| @@ -44,5 +44,3 @@ fdt_sw.c | |||
| 44 | fdt_wip.c | 44 | fdt_wip.c |
| 45 | libfdt.h | 45 | libfdt.h |
| 46 | libfdt_internal.h | 46 | libfdt_internal.h |
| 47 | autoconf.h | ||
| 48 | |||
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 36fb51a9329f..6841bd52738b 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
| @@ -20,11 +20,6 @@ | |||
| 20 | 20 | ||
| 21 | all: $(obj)/zImage | 21 | all: $(obj)/zImage |
| 22 | 22 | ||
| 23 | compress-$(CONFIG_KERNEL_GZIP) := CONFIG_KERNEL_GZIP | ||
| 24 | compress-$(CONFIG_KERNEL_XZ) := CONFIG_KERNEL_XZ | ||
| 25 | compress-$(CONFIG_KERNEL_LZMA) := CONFIG_KERNEL_LZMA | ||
| 26 | compress-$(CONFIG_KERNEL_LZO) := CONFIG_KERNEL_LZO | ||
| 27 | |||
| 28 | ifdef CROSS32_COMPILE | 23 | ifdef CROSS32_COMPILE |
| 29 | BOOTCC := $(CROSS32_COMPILE)gcc | 24 | BOOTCC := $(CROSS32_COMPILE)gcc |
| 30 | BOOTAR := $(CROSS32_COMPILE)ar | 25 | BOOTAR := $(CROSS32_COMPILE)ar |
| @@ -36,7 +31,7 @@ endif | |||
| 36 | BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | 31 | BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ |
| 37 | -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ | 32 | -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ |
| 38 | -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ | 33 | -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ |
| 39 | -D$(compress-y) | 34 | $(LINUXINCLUDE) |
| 40 | 35 | ||
| 41 | ifdef CONFIG_PPC64_BOOT_WRAPPER | 36 | ifdef CONFIG_PPC64_BOOT_WRAPPER |
| 42 | BOOTCFLAGS += -m64 | 37 | BOOTCFLAGS += -m64 |
| @@ -53,7 +48,7 @@ BOOTCFLAGS += -mlittle-endian | |||
| 53 | BOOTCFLAGS += $(call cc-option,-mabi=elfv2) | 48 | BOOTCFLAGS += $(call cc-option,-mabi=elfv2) |
| 54 | endif | 49 | endif |
| 55 | 50 | ||
| 56 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc | 51 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc |
| 57 | 52 | ||
| 58 | BOOTARFLAGS := -cr$(KBUILD_ARFLAGS) | 53 | BOOTARFLAGS := -cr$(KBUILD_ARFLAGS) |
| 59 | 54 | ||
| @@ -204,14 +199,9 @@ $(obj)/empty.c: | |||
| 204 | $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S | 199 | $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S |
| 205 | $(Q)cp $< $@ | 200 | $(Q)cp $< $@ |
| 206 | 201 | ||
| 207 | $(srctree)/$(src)/serial.c: $(obj)/autoconf.h | ||
| 208 | |||
| 209 | $(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/% | ||
| 210 | $(Q)cp $< $@ | ||
| 211 | |||
| 212 | clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \ | 202 | clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \ |
| 213 | $(zlib-decomp-) $(libfdt) $(libfdtheader) \ | 203 | $(zlib-decomp-) $(libfdt) $(libfdtheader) \ |
| 214 | autoconf.h empty.c zImage.coff.lds zImage.ps3.lds zImage.lds | 204 | empty.c zImage.coff.lds zImage.ps3.lds zImage.lds |
| 215 | 205 | ||
| 216 | quiet_cmd_bootcc = BOOTCC $@ | 206 | quiet_cmd_bootcc = BOOTCC $@ |
| 217 | cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< | 207 | cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< |
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index b0491b8c0199..9457863147f9 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include "stdio.h" | 18 | #include "stdio.h" |
| 19 | #include "io.h" | 19 | #include "io.h" |
| 20 | #include "ops.h" | 20 | #include "ops.h" |
| 21 | #include "autoconf.h" | ||
| 22 | 21 | ||
| 23 | static int serial_open(void) | 22 | static int serial_open(void) |
| 24 | { | 23 | { |
