Skip to content

Commit 082c36f

Browse files
authored
Strip the debug info from some libs to save space (#180)
bt, esp-tflite-micro and openthread
1 parent 35b5b52 commit 082c36f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: tools/copy-libs.sh

+14
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ PIO_LD_FLAGS=""
7171
PIO_LD_FUNCS=""
7272
PIO_LD_SCRIPTS=""
7373

74+
TOOLCHAIN_PREFIX=""
75+
if [ "$IS_XTENSA" = "y" ]; then
76+
TOOLCHAIN="xtensa-$IDF_TARGET-elf"
77+
else
78+
TOOLCHAIN="riscv32-esp-elf"
79+
fi
80+
7481
#collect includes, defines and c-flags
7582
str=`cat build/compile_commands.json | grep arduino-lib-builder-gcc.c | grep command | cut -d':' -f2 | cut -d',' -f1`
7683
str="${str:2:${#str}-1}" #remove leading space and quotes
@@ -523,6 +530,13 @@ for item; do
523530
done
524531
done
525532

533+
for lib in "openthread" "espressif__esp-tflite-micro" "bt"; do
534+
if [ -f "$AR_SDK/lib/lib$lib.a" ]; then
535+
echo "Stripping $AR_SDK/lib/lib$lib.a"
536+
"$TOOLCHAIN-strip" -g "$AR_SDK/lib/lib$lib.a"
537+
fi
538+
done
539+
526540
# Handle Mem Variants
527541
mkdir -p "$AR_SDK/$MEMCONF/include"
528542
mv "$PWD/build/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h"

0 commit comments

Comments
 (0)