Skip to content

Strip the debug info from some libs to save space #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tools/copy-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down