aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-11-16 12:46:21 -0800
committerFelix Fietkau <nbd@nbd.name>2021-11-16 22:02:45 +0100
commitdb34b93331e91bdb2cbc15d17632aaaab7217a6d (patch)
tree5c2a610d3cf7ad7a033c64c28494f1c31bfd9510 /scripts
parent0c249ab07645489088c9010bb528b637356aa052 (diff)
downloadupstream-db34b93331e91bdb2cbc15d17632aaaab7217a6d.tar.gz
upstream-db34b93331e91bdb2cbc15d17632aaaab7217a6d.tar.bz2
upstream-db34b93331e91bdb2cbc15d17632aaaab7217a6d.zip
toolchain: add a version that can be bumped to force toolchain/target rebuild
This can be used to ensure that the compiled code is up to date, when something important changes in the toolchain. A recent example of this is the gcc 11 fix for a code miscompilation issue Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-toolchain-clean.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/check-toolchain-clean.sh b/scripts/check-toolchain-clean.sh
new file mode 100755
index 0000000000..af24e740b7
--- /dev/null
+++ b/scripts/check-toolchain-clean.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+eval `grep CONFIG_GCC_VERSION .config`
+CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)"
+touch .toolchain_build_ver
+[ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$(cat .toolchain_build_ver)" ] && exit 0
+echo "Toolchain build version changed, running make targetclean"
+make targetclean
+echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver
+exit 0