Skip to content

Commit cd6cd85

Browse files
committed
sdk: add a script for library update
Moves instructions from Readme file into a script
1 parent c885542 commit cd6cd85

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

tools/sdk/lib/README.md

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
## Updating SDK libraries
22

3-
After updating SDK libraries to a new version, do the following changes.
4-
5-
6-
Remove mem_manager.o from libmain.a to use custom heap implementation, and time.o to fix redefinition of time-related functions:
7-
8-
```bash
9-
xtensa-lx106-elf-ar -d libmain.a mem_manager.o
10-
xtensa-lx106-elf-ar -d libmain.a time.o
11-
```
12-
13-
Rename `hostname` and `default_hostname` symbols:
14-
15-
```bash
16-
xtensa-lx106-elf-ar x libmain.a eagle_lwip_if.o user_interface.o
17-
xtensa-lx106-elf-objcopy --redefine-sym hostname=wifi_station_hostname user_interface.o
18-
xtensa-lx106-elf-objcopy --redefine-sym hostname=wifi_station_hostname eagle_lwip_if.o
19-
xtensa-lx106-elf-objcopy --redefine-sym default_hostname=wifi_station_default_hostname user_interface.o
20-
xtensa-lx106-elf-objcopy --redefine-sym default_hostname=wifi_station_default_hostname eagle_lwip_if.o
21-
xtensa-lx106-elf-ar r libmain.a eagle_lwip_if.o user_interface.o
22-
```
3+
- Copy .a files from SDK `lib` directory to this directory
4+
- Run `fix_sdk_libs.sh`
235

246
## Updating libstdc++
257

tools/sdk/lib/fix_sdk_libs.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Remove mem_manager.o from libmain.a to use custom heap implementation,
5+
# and time.o to fix redefinition of time-related functions:
6+
xtensa-lx106-elf-ar d libmain.a mem_manager.o
7+
xtensa-lx106-elf-ar d libmain.a time.o
8+
9+
# Rename `hostname` and `default_hostname` symbols:
10+
xtensa-lx106-elf-ar x libmain.a eagle_lwip_if.o user_interface.o
11+
xtensa-lx106-elf-objcopy --redefine-sym hostname=wifi_station_hostname user_interface.o
12+
xtensa-lx106-elf-objcopy --redefine-sym hostname=wifi_station_hostname eagle_lwip_if.o
13+
xtensa-lx106-elf-objcopy --redefine-sym default_hostname=wifi_station_default_hostname user_interface.o
14+
xtensa-lx106-elf-objcopy --redefine-sym default_hostname=wifi_station_default_hostname eagle_lwip_if.o
15+
xtensa-lx106-elf-ar r libmain.a eagle_lwip_if.o user_interface.o
16+
rm eagle_lwip_if.o user_interface.o

0 commit comments

Comments
 (0)