summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-10-20 20:09:12 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-10-23 11:55:19 +0200
commit910b10d79ab17dadadb318b60d336f495a35be78 (patch)
tree5105dbfb3e4823c75eb4dfaac2b3777738013bcb /scripts
parent8375004d1cb6d59ecdc36f02b9e5212588f31782 (diff)
downloadbarebox-910b10d79ab17dadadb318b60d336f495a35be78.tar.gz
barebox-910b10d79ab17dadadb318b60d336f495a35be78.tar.xz
decompress: xz: enable armthumb BCJ filter for Thumb-2 barebox
The XZ decompressor in barebox has BCJ filter support for THUMB, but like Linux, it's unused and instead the ARM BCJ filter is used. Fixing that lets us save a few kilobytes, which is especially useful for legacy configuration that fit a whole barebox into limited on-chip SRAM (and not only the prebootloader). For example, with this patch applied barebox-am33xx-beaglebone-mlo.img is shrinked 3K from 109236 to 106028 bytes. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231020180912.2914428-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/xz_wrap.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/xz_wrap.sh b/scripts/xz_wrap.sh
index 5b5f3adcff..a6373a7481 100755
--- a/scripts/xz_wrap.sh
+++ b/scripts/xz_wrap.sh
@@ -20,6 +20,10 @@ case $SRCARCH in
sparc) BCJ=--sparc ;;
esac
+if grep -q '^CONFIG_THUMB2_BAREBOX=y$' include/config/auto.conf; then
+ BCJ=--armthumb
+fi
+
# clear BCJ filter if unsupported
xz -H | grep -q -- $BCJ || BCJ=