Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: corebootv3-better_dependencies/util/lzma/Makefile =================================================================== --- corebootv3-better_dependencies/util/lzma/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/lzma/Makefile (Arbeitskopie) @@ -23,13 +23,13 @@ LZMA_OBJ += $(obj)/util/lzma/OutBuffer.o $(obj)/util/lzma/Alloc.o LZMA_OBJ += $(obj)/util/lzma/CRC.o
-$(obj)/util/lzma/lzma: lzmadir $(LZMA_OBJ) $(obj)/util/lzma/minilzma.o +$(obj)/util/lzma/lzma: $(obj)/util/lzma/ $(LZMA_OBJ) $(obj)/util/lzma/minilzma.o $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $(LZMA_OBJ) $(obj)/util/lzma/minilzma.o
$(obj)/util/lzma/lzma-compress.o: $(src)/util/lzma/minilzma.cc $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c -DCOMPACT $<
-lzmadir: +$(obj)/util/lzma/: $(Q)printf " BUILD LZMA\n" $(Q)mkdir -p $(obj)/util/lzma/
Index: corebootv3-better_dependencies/util/nrv2b/Makefile =================================================================== --- corebootv3-better_dependencies/util/nrv2b/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/nrv2b/Makefile (Arbeitskopie) @@ -19,15 +19,15 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ##
-$(obj)/util/nrv2b/nrv2b: nrv2bdir $(src)/util/nrv2b/nrv2b.c +$(obj)/util/nrv2b/nrv2b: $(obj)/util/nrv2b/ $(src)/util/nrv2b/nrv2b.c $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(HOSTCC) $(HOSTCFLAGS) -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $(src)/util/nrv2b/nrv2b.c
-$(obj)/util/nrv2b/nrv2b-compress.o: nrv2bdir $(src)/util/nrv2b/nrv2b.c +$(obj)/util/nrv2b/nrv2b-compress.o: $(obj)/util/nrv2b/ $(src)/util/nrv2b/nrv2b.c $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(HOSTCC) $(HOSTCFLAGS) -DENCODE -DDECODE -DVERBOSE -DCOMPACT -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -c -o $@ $(src)/util/nrv2b/nrv2b.c
-nrv2bdir: +$(obj)/util/nrv2b/: $(Q)printf " BUILD NRV2B\n" $(Q)mkdir -p $(obj)/util/nrv2b/
Index: corebootv3-better_dependencies/util/options/Makefile =================================================================== --- corebootv3-better_dependencies/util/options/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/options/Makefile (Arbeitskopie) @@ -21,11 +21,11 @@
OPTIONS_OBJ := $(obj)/util/options/build_opt_tbl.o
-$(obj)/util/options/build_opt_tbl: optionsdir $(OPTIONS_OBJ) +$(obj)/util/options/build_opt_tbl: $(obj)/util/options/ $(OPTIONS_OBJ) $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ $(OPTIONS_OBJ)
-optionsdir: +$(obj)/util/options/: $(Q)mkdir -p $(obj)/util/options/
$(obj)/util/options/%.o: $(src)/util/options/%.c Index: corebootv3-better_dependencies/util/lar/Makefile =================================================================== --- corebootv3-better_dependencies/util/lar/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/lar/Makefile (Arbeitskopie) @@ -19,16 +19,17 @@ ## LAROBJ := lar.o stream.o lib.o
-LARDIR := lardir +LARDIR := $(obj)/util/lar
COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o -LARDIR += lzmadir +LARDIR += $(obj)/util/lzma/
COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o -LARDIR += nrv2bdir +LARDIR += $(obj)/util/nrv2b/
LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ)) -lardir: + +$(obj)/util/lar: $(Q)printf " BUILD LAR\n" $(Q)mkdir -p $(obj)/util/lar
On Thu, Nov 6, 2008 at 7:02 AM, Carl-Daniel Hailfinger < c-d.hailfinger.devel.2006@gmx.net> wrote:
Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Myles Watson mylesgw@gmail.com
Very nice.
Thanks, Myles
Carl-Daniel Hailfinger wrote:
Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Stefan Reinauer stepan@coresystems.de
-nrv2bdir: +$(obj)/util/nrv2b/: -optionsdir: +$(obj)/util/options/:
-LARDIR := lardir +LARDIR := $(obj)/util/lar
Is it on purpose that all the other directories have a / at the end but $(obj)/util/lar has none?
On Thu, Nov 6, 2008 at 2:46 PM, Stefan Reinauer stepan@coresystems.de wrote:
+LARDIR := $(obj)/util/lar
Is it on purpose that all the other directories have a / at the end but $(obj)/util/lar has none?
If yes, please educate us about that purpose, I'm puzzled.
On 06.11.2008 14:46, Stefan Reinauer wrote:
Carl-Daniel Hailfinger wrote:
Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Stefan Reinauer stepan@coresystems.de
Thanks, committed in r984.
-nrv2bdir: +$(obj)/util/nrv2b/: -optionsdir: +$(obj)/util/options/:
-LARDIR := lardir +LARDIR := $(obj)/util/lar
Is it on purpose that all the other directories have a / at the end but $(obj)/util/lar has none?
No, it was a simple typo. Thanks for spotting it.
Regards, Carl-Daniel
On 06.11.2008 14:59, Carl-Daniel Hailfinger wrote:
On 06.11.2008 14:46, Stefan Reinauer wrote:
Carl-Daniel Hailfinger wrote:
Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Stefan Reinauer stepan@coresystems.de
Thanks, committed in r984.
I wanted to clean this up further, but I'm hitting a big dependency bug. Try this patch and watch make explode:
Index: util/lar/Makefile =================================================================== --- util/lar/Makefile (Revision 984) +++ util/lar/Makefile (Arbeitskopie) @@ -22,10 +22,8 @@ LARDIR := $(obj)/util/lar/
COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o -LARDIR += $(obj)/util/lzma/
COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o -LARDIR += $(obj)/util/nrv2b/
LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ))
HOSTCC build/util/lar/lib.o HOSTCXX build/util/lzma/LZMAEncoder.o Assembler messages: Fatal error: can't create /sources/tmptrees/corebootv3-better_dependencies/build/util/lzma/LZMAEncoder.o: No such file or directory make: *** [/sources/tmptrees/corebootv3-better_dependencies/build/util/lzma/LZMAEncoder.o] Fehler 1
The obvious bug is that build/util/lzma/LZMAEncoder.o does not depend on build/util/lzma/ and that means compilation has no target directory. As long as make is not run in parallel mode, you will not see the bug in svn HEAD because make first creates build/util/lzma/ and then compiles files there. Once you run in parallel mode, it is entirely possible that the directory creation happens after the compile attempt and stuff will explode even with current svn HEAD.
Fixing this would require us to add build/util/lzma/ as a dependency to every lzma object in util/lzma/Makefile. And that's the point where I ask about better solutions.
Regards, Carl-Daniel
Carl-Daniel Hailfinger wrote:
On 06.11.2008 14:59, Carl-Daniel Hailfinger wrote:
On 06.11.2008 14:46, Stefan Reinauer wrote:
Carl-Daniel Hailfinger wrote:
Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Stefan Reinauer stepan@coresystems.de
Thanks, committed in r984.
I wanted to clean this up further, but I'm hitting a big dependency bug. Try this patch and watch make explode:
Index: util/lar/Makefile
--- util/lar/Makefile (Revision 984) +++ util/lar/Makefile (Arbeitskopie) @@ -22,10 +22,8 @@ LARDIR := $(obj)/util/lar/
COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o -LARDIR += $(obj)/util/lzma/
COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o -LARDIR += $(obj)/util/nrv2b/
LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ))
Fixing this would require us to add build/util/lzma/ as a dependency to every lzma object in util/lzma/Makefile. And that's the point where I ask about better solutions.
I think leaving it as it is sounds like a better solution already ;-)
On 06.11.2008 15:29, Stefan Reinauer wrote:
Carl-Daniel Hailfinger wrote:
On 06.11.2008 14:59, Carl-Daniel Hailfinger wrote:
On 06.11.2008 14:46, Stefan Reinauer wrote:
Carl-Daniel Hailfinger wrote:
Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Stefan Reinauer stepan@coresystems.de
Thanks, committed in r984.
I wanted to clean this up further, but I'm hitting a big dependency bug. Try this patch and watch make explode:
Index: util/lar/Makefile
--- util/lar/Makefile (Revision 984) +++ util/lar/Makefile (Arbeitskopie) @@ -22,10 +22,8 @@ LARDIR := $(obj)/util/lar/
COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o -LARDIR += $(obj)/util/lzma/
COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o -LARDIR += $(obj)/util/nrv2b/
LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ))
Fixing this would require us to add build/util/lzma/ as a dependency to every lzma object in util/lzma/Makefile. And that's the point where I ask about better solutions.
I think leaving it as it is sounds like a better solution already ;-)
The lzma dependencies are already broken (since the initial commit in r157) and parallel make is going to trip on them. My test patch above just makes this visible on singlethreaded make. Of course we can declare parallel make as unusable in v3 (like it is in v2, see the spurious breakage there), but I'd prefer to do this the right way.
Regards, Carl-Daniel