diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2016-09-22 08:54:29 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-09-28 06:20:44 +0200 |
commit | 1a13de6df9bf998a0b6d9bfa4255cfc711ea8f0f (patch) | |
tree | 4c90cba3d521a7d764868ff6fe58b273fe15b76d /arch/powerpc/boot/Makefile | |
parent | selftests/powerpc: Compile selftests against headers without AT_HWCAP2 (diff) | |
download | linux-1a13de6df9bf998a0b6d9bfa4255cfc711ea8f0f.tar.xz linux-1a13de6df9bf998a0b6d9bfa4255cfc711ea8f0f.zip |
powerpc/boot: Add sed script
The powerpc boot wrapper is potentially compiled with a separate
toolchain and/or toolchain flags than the rest of the kernel. The usual
case is a 64-bit big endian kernel builds a 32-bit big endian wrapper.
The main problem with this is that the wrapper does not have access to
the kernel headers (without a lot of gross hacks). To get around this
the required headers are copied into the build directory via several sed
scripts which rewrite problematic includes. This patch moves these
fixups out of the makefile into a separate .sed script file to clean up
makefile slightly.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[mpe: Reword first paragraph of change log a little]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r-- | arch/powerpc/boot/Makefile | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index df0fd406aed1..7d6768253caa 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -125,23 +125,17 @@ obj-wlib := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-wlib)))) obj-plat := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-plat)))) obj-plat: $(libfdt) -quiet_cmd_copy_zlib = COPY $@ - cmd_copy_zlib = sed "s@__used@@;s@<linux/\([^>]*\).*@\"\1\"@" $< > $@ - -quiet_cmd_copy_zlibheader = COPY $@ - cmd_copy_zlibheader = sed "s@<linux/\([^>]*\).*@\"\1\"@" $< > $@ -# stddef.h for NULL -quiet_cmd_copy_zliblinuxheader = COPY $@ - cmd_copy_zliblinuxheader = sed "s@<linux/string.h>@\"string.h\"@;s@<linux/kernel.h>@<stddef.h>@;s@<linux/\([^>]*\).*@\"\1\"@" $< > $@ +quiet_cmd_copy_kern_src = COPY $@ + cmd_copy_kern_src = sed -f $(srctree)/arch/powerpc/boot/fixup-headers.sed $< > $@ $(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/% - $(call cmd,copy_zlib) + $(call cmd,copy_kern_src) $(addprefix $(obj)/,$(zlibheader)): $(obj)/%: $(srctree)/lib/zlib_inflate/% - $(call cmd,copy_zlibheader) + $(call cmd,copy_kern_src) $(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/% - $(call cmd,copy_zliblinuxheader) + $(call cmd,copy_kern_src) quiet_cmd_copy_libfdt = COPY $@ cmd_copy_libfdt = cp $< $@ |