ppc32: Use $(addprefix ...) on arch/ppc/boot/lib/
PATCH 1/1 ppc32: Use $(addprefix ...) on arch/ppc/boot/lib/
The following makes arch/ppc/boot/lib/Makefile use $(addprefix ...) to get lib/zlib_inflate/ source code. Previously we were manually setting the dependancy and invoking cc_o_c. Worse, we were invoking the cmd version, not the rule version and thus when MODVERSIONS=y, we wouldn't do the .tmp_foo.o -> foo.o rename, and thus the compile would break. Using $(addprefix ...) gets us using the standard rules again (and is shorter to boot).
arch/ppc/boot/lib/Makefile +3 -13
@@ -4,18 +4,8 @@ CFLAGS_kbd.o += -Idrivers/char -$(obj)/infblock.o: lib/zlib_inflate/infblock.c - $(call cmd,cc_o_c) -$(obj)/infcodes.o: lib/zlib_inflate/infcodes.c - $(call cmd,cc_o_c) -$(obj)/inffast.o: lib/zlib_inflate/inffast.c - $(call cmd,cc_o_c) -$(obj)/inflate.o: lib/zlib_inflate/inflate.c - $(call cmd,cc_o_c) -$(obj)/inftrees.o: lib/zlib_inflate/inftrees.c - $(call cmd,cc_o_c) -$(obj)/infutil.o: lib/zlib_inflate/infutil.c - $(call cmd,cc_o_c) +INFLATE = $(addprefix ../../../../lib/zlib_inflate/, infblock.o \ + infcodes.o inffast.o inflate.o inftrees.o infutil.o) -lib-y := infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o div64.o +lib-y := $(INFLATE) div64.o lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 7 lines · Tom Rini
The following makes
arch/ppc/boot/lib/Makefileuse $(addprefix ...) to getlib/zlib_inflate/source code. Previously we were manually setting the dependancy and invokingcc_o_c. Worse, we were invoking the cmd version, not the rule version and thus when MODVERSIONS=y, we wouldn't do the .tmp_foo.o -> foo.o rename, and thus the compile would break. Using $(addprefix ...) gets us using the standard rules again (and is shorter to boot).
Your patch was pending my comments - sorry.
Why not:
lib-y := $(addprefix lib/zlib_inflate/,infblock.o infcodes.o inffast.o \
inflate.o inftrees.o infutil.o)
lib-y += div64.o
lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
No need to use that ugly relative path.
I do not like this way of selectng .o files. It will so obviously break the build with make -j if there is no synchronisation point. vmlinux provide this synchronisation point in this case. But in this particular case I see no better alternative.
Sam
Quoted 12 lines · Sam Ravnborg
Quoted 7 lines · Tom Rini
The following makes
arch/ppc/boot/lib/Makefileuse $(addprefix ...) to getlib/zlib_inflate/source code. Previously we were manually setting the dependancy and invokingcc_o_c. Worse, we were invoking the cmd version, not the rule version and thus when MODVERSIONS=y, we wouldn't do the .tmp_foo.o -> foo.o rename, and thus the compile would break. Using $(addprefix ...) gets us using the standard rules again (and is shorter to boot).Your patch was pending my comments - sorry.
Quoted 8 lines
Why not:
lib-y := $(addprefix
lib/zlib_inflate/,infblock.oinfcodes.o inffast.o \
inflate.o inftrees.o infutil.o)
lib-y += div64.o
lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.oNo need to use that ugly relative path.
If that works, OK. The example Al Viro pointed me at was arch/arm/boot/compressed/Makefile.
Quoted 4 lines
I do not like this way of selectng .o files. It will so obviously break the build with make -j if there is no synchronisation point. vmlinux provide this synchronisation point in this case. But in this particular case I see no better alternative.
How hard would it be make some sort of synchronisation point? I know SuSE folks who always build with -j5.
arch/ppc/boot/lib/Makefile +3 -14
@@ -4,18 +4,7 @@ CFLAGS_kbd.o += -Idrivers/char -$(obj)/infblock.o: lib/zlib_inflate/infblock.c - $(call cmd,cc_o_c) -$(obj)/infcodes.o: lib/zlib_inflate/infcodes.c - $(call cmd,cc_o_c) -$(obj)/inffast.o: lib/zlib_inflate/inffast.c - $(call cmd,cc_o_c) -$(obj)/inflate.o: lib/zlib_inflate/inflate.c - $(call cmd,cc_o_c) -$(obj)/inftrees.o: lib/zlib_inflate/inftrees.c - $(call cmd,cc_o_c) -$(obj)/infutil.o: lib/zlib_inflate/infutil.c - $(call cmd,cc_o_c) - -lib-y := infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o div64.o +lib-y := $(addprefix lib/zlib_inflate/,infblock.o infcodes.o inffast.o \ + inflate.o inftrees.o infutil.o) +lib-y += div64.o lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
[ Resubmitting as this is still missing and thus zImage/et al fail when MODVERSIONS=y ]
Quoted 12 lines · Sam Ravnborg
Quoted 7 lines · Tom Rini
The following makes
arch/ppc/boot/lib/Makefileuse $(addprefix ...) to getlib/zlib_inflate/source code. Previously we were manually setting the dependancy and invokingcc_o_c. Worse, we were invoking the cmd version, not the rule version and thus when MODVERSIONS=y, we wouldn't do the .tmp_foo.o -> foo.o rename, and thus the compile would break. Using $(addprefix ...) gets us using the standard rules again (and is shorter to boot).Your patch was pending my comments - sorry.
Quoted 8 lines
Why not:
lib-y := $(addprefix
lib/zlib_inflate/,infblock.oinfcodes.o inffast.o \
inflate.o inftrees.o infutil.o)
lib-y += div64.o
lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.oNo need to use that ugly relative path.
If that works, OK. The example Al Viro pointed me at was arch/arm/boot/compressed/Makefile.
Quoted 4 lines
I do not like this way of selectng .o files. It will so obviously break the build with make -j if there is no synchronisation point. vmlinux provide this synchronisation point in this case. But in this particular case I see no better alternative.
How hard would it be make some sort of synchronisation point? I know SuSE folks who always build with -j5.
Switch arch/ppc/boot/lib/Makefile to $(addprefix ...) for zlib_inflate
arch/ppc/boot/lib/Makefile +3 -14
@@ -4,18 +4,7 @@ CFLAGS_kbd.o += -Idrivers/char -$(obj)/infblock.o: lib/zlib_inflate/infblock.c - $(call cmd,cc_o_c) -$(obj)/infcodes.o: lib/zlib_inflate/infcodes.c - $(call cmd,cc_o_c) -$(obj)/inffast.o: lib/zlib_inflate/inffast.c - $(call cmd,cc_o_c) -$(obj)/inflate.o: lib/zlib_inflate/inflate.c - $(call cmd,cc_o_c) -$(obj)/inftrees.o: lib/zlib_inflate/inftrees.c - $(call cmd,cc_o_c) -$(obj)/infutil.o: lib/zlib_inflate/infutil.c - $(call cmd,cc_o_c) - -lib-y := infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o div64.o +lib-y := $(addprefix lib/zlib_inflate/,infblock.o infcodes.o inffast.o \ + inflate.o inftrees.o infutil.o) +lib-y += div64.o lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 2 lines · Tom Rini
How hard would it be make some sort of synchronisation point? I know SuSE folks who always build with -j5.
This particular usage in ppc has vmlinux is synchronisation point - this way it is guaranteed that lib/zlib_inflate/ is not visited twice concurrently.
So this will not break SuSE "make -j 5" builds.
And current kernel compile fine with make -j 32 (only report the last couple of months was me re-introducing a warning - already fixed).
Only issue seems to be file-stamps with no more than one second resolution - this may result in rebuild in second run - because some .o have equal timestamps.
Sam