From 59db8a039475a80078c6773fccca95ce9551148c Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 30 May 2024 13:19:12 +0300 Subject: [PATCH] Strip the debug info from some libs to save space bt, esp-tflite-micro and openthread --- tools/copy-libs.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/copy-libs.sh b/tools/copy-libs.sh index 828b3032f..8ee2276dd 100755 --- a/tools/copy-libs.sh +++ b/tools/copy-libs.sh @@ -71,6 +71,13 @@ PIO_LD_FLAGS="" PIO_LD_FUNCS="" PIO_LD_SCRIPTS="" +TOOLCHAIN_PREFIX="" +if [ "$IS_XTENSA" = "y" ]; then + TOOLCHAIN="xtensa-$IDF_TARGET-elf" +else + TOOLCHAIN="riscv32-esp-elf" +fi + #collect includes, defines and c-flags str=`cat build/compile_commands.json | grep arduino-lib-builder-gcc.c | grep command | cut -d':' -f2 | cut -d',' -f1` str="${str:2:${#str}-1}" #remove leading space and quotes @@ -523,6 +530,13 @@ for item; do done done +for lib in "openthread" "espressif__esp-tflite-micro" "bt"; do + if [ -f "$AR_SDK/lib/lib$lib.a" ]; then + echo "Stripping $AR_SDK/lib/lib$lib.a" + "$TOOLCHAIN-strip" -g "$AR_SDK/lib/lib$lib.a" + fi +done + # Handle Mem Variants mkdir -p "$AR_SDK/$MEMCONF/include" mv "$PWD/build/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h"