aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2015-02-21 14:29:53 +0000
committerMichael Brown <mcb30@ipxe.org>2015-02-25 14:06:13 +0000
commit5350b65a3ce727f20e9d9fa7b9c2c0af52cfb7bd (patch)
treeda203cb65fc868590ca5395ae1795aabe88d3c85 /src/Makefile.housekeeping
parent3e04f0791e614772f3ffe3663e4c8da71e2bc981 (diff)
downloadipxe-5350b65a3ce727f20e9d9fa7b9c2c0af52cfb7bd.tar.gz
[zbin] Use LZMA compression
LZMA provides significantly better compression (by ~15%) than the current NRV2B algorithm. We use a raw LZMA stream (aka LZMA1) to avoid the need for code to parse the LZMA2 block headers. We use parameters {lc=2,lp=0,pb=0} to reduce the stack space required by the decompressor to acceptable levels (around 8kB). Using lc=3 or pb=2 would give marginally better compression, but at the cost of substantially increasing the required stack space. The build process now requires the liblzma headers to be present on the build system, since we do not include a copy of an LZMA compressor within the iPXE source tree. The decompressor is written from scratch (based on XZ Embedded) and is entirely self-contained within the iPXE source. The branch-call-jump (BCJ) filter used to improve the compressibility is specific to iPXE. We choose not to use liblzma's built-in BCJ filter since the algorithm is complex and undocumented. Our BCJ filter achieves approximately the same results (on typical iPXE binaries) with a substantially simpler algorithm. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index bb2b0cb47..274945ae5 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -1220,15 +1220,12 @@ endif # defined(BIN)
#
# The compression utilities
#
-$(NRV2B) : util/nrv2b.c $(MAKEDEPS)
- $(QM)$(ECHO) " [HOSTCC] $@"
- $(Q)$(HOST_CC) $(HOST_CFLAGS) -DENCODE -DDECODE -DMAIN -DVERBOSE \
- -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $<
-CLEANUP += $(NRV2B)
-$(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
+ZBIN_LDFLAGS := -llzma
+
+$(ZBIN) : util/zbin.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
- $(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ $<
+ $(Q)$(HOST_CC) $(HOST_CFLAGS) $< $(ZBIN_LDFLAGS) -o $@
CLEANUP += $(ZBIN)
###############################################################################