Skip to content

Commit fba0bf6

Browse files
authored
strip binary files
1 parent d998d16 commit fba0bf6

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

configs/defconfig.esp32h2

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ CONFIG_RTC_CLK_CAL_CYCLES=576
4343
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set
4444
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304
4545

46-
#
47-
# PPP
48-
#
49-
CONFIG_LWIP_PPP_SUPPORT=y
50-
CONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT=y
51-
CONFIG_LWIP_PPP_PAP_SUPPORT=y
52-
CONFIG_LWIP_PPP_ENABLE_IPV6=n
46+
#
47+
# PPP
48+
#
49+
CONFIG_LWIP_PPP_SUPPORT=y
50+
CONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT=y
51+
CONFIG_LWIP_PPP_PAP_SUPPORT=y
52+
CONFIG_LWIP_PPP_ENABLE_IPV6=n

tools/copy-libs.sh

+20-2
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
@@ -402,13 +409,13 @@ for item; do
402409
mkdir -p "$out_cpath$rel_p"
403410
cp -n $f "$out_cpath$rel_p/"
404411
done
405-
for f in `find "$item" -name '*.inc'`; do
412+
for f in `find "$item" -name '*.inc'`; do
406413
rel_f=${f#*$item}
407414
rel_p=${rel_f%/*}
408415
mkdir -p "$out_cpath$rel_p"
409416
cp -n $f "$out_cpath$rel_p/"
410417
done
411-
# Temporary measure to fix issues caused by https://github.com/espressif/esp-idf/commit/dc4731101dd567cc74bbe4d0f03afe52b7db9afb#diff-1d2ce0d3989a80830fdf230bcaafb3117f32046d16cf46616ac3d55b4df2a988R17
418+
# Temporary measure to fix issues caused by https://github.com/espressif/esp-idf/commit/dc4731101dd567cc74bbe4d0f03afe52b7db9afb#diff-1d2ce0d3989a80830fdf230bcaafb3117f32046d16cf46616ac3d55b4df2a988R17
412419
if [[ "$fname" == "bt" && "$out_sub" == "/include/$IDF_TARGET/include" && -f "$ipath/controller/$IDF_TARGET/esp_bt_cfg.h" ]]; then
413420
mkdir -p "$AR_SDK/include/$fname/controller/$IDF_TARGET"
414421
cp -n "$ipath/controller/$IDF_TARGET/esp_bt_cfg.h" "$AR_SDK/include/$fname/controller/$IDF_TARGET/esp_bt_cfg.h"
@@ -434,6 +441,8 @@ done
434441

435442
set -- $LD_LIB_FILES
436443
for item; do
444+
#echo "***** Stripping $item"
445+
"$TOOLCHAIN-strip" -g "$item"
437446
cp "$item" "$AR_SDK/lib/"
438447
done
439448

@@ -507,6 +516,7 @@ function copy_precompiled_lib(){
507516
lib_file="$1"
508517
lib_name="$(basename $lib_file)"
509518
if [[ $LD_LIBS_SEARCH == *"$lib_name"* ]]; then
519+
"$TOOLCHAIN-strip" -g "$lib_file"
510520
cp "$lib_file" "$AR_SDK/ld/"
511521
fi
512522
}
@@ -523,6 +533,13 @@ for item; do
523533
done
524534
done
525535

536+
for lib in "openthread" "espressif__esp-tflite-micro" "bt" "espressif__esp_modem" "espressif__esp-zboss-lib" "espressif__esp-zigbee-lib" "espressif__mdns" "espressif__esp-dsp" "joltwallet__littlefs"; do
537+
if [ -f "$AR_SDK/lib/lib$lib.a" ]; then
538+
echo "Stripping $AR_SDK/lib/lib$lib.a"
539+
"$TOOLCHAIN-strip" -g "$AR_SDK/lib/lib$lib.a"
540+
fi
541+
done
542+
526543
# Handle Mem Variants
527544
mkdir -p "$AR_SDK/$MEMCONF/include"
528545
mv "$PWD/build/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h"
@@ -538,6 +555,7 @@ for mem_variant in `jq -c '.mem_variants_files[]' configs/builds.json`; do
538555
file=$(echo "$mem_variant" | jq -c '.file' | tr -d '"')
539556
out=$(echo "$mem_variant" | jq -c '.out' | tr -d '"')
540557
mv "$AR_SDK/$out" "$AR_SDK/$MEMCONF/$file"
558+
"$TOOLCHAIN-strip" -g "$AR_SDK/$MEMCONF/$file"
541559
fi
542560
done;
543561

0 commit comments

Comments
 (0)