Skip to content

Commit 6d3d9e5

Browse files
authored
Fix smart-light building issue (#38)
This fix is inspired by apple/swift-embedded-examples@2eb2975 described in apple/swift-embedded-examples#17. It solves the following problem that occurs when running `idf.py build`: ``` [7/9] Linking CXX executable light.elf FAILED: light.elf ... /Users/****/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld: The gap between .flash.appdesc and .flash.rodata must not exist to produce the final bin image. ... ```
1 parent 52432f6 commit 6d3d9e5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

smart-light/main/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
idf_component_register(
33
SRCS "../Matter/MatterInterface.cpp"
44
PRIV_INCLUDE_DIRS "."
5+
LDFRAGMENTS "linker.lf"
56
)
67

78
# Clear the default COMPILE_OPTIONS which include a lot of C/C++ specific compiler flags that the Swift compiler will not accept

smart-light/main/linker.lf

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[sections:flash_text_swift]
2+
entries:
3+
.swift_modhash+
4+
[sections:dram0_swift]
5+
entries:
6+
.got+
7+
.got.plt+
8+
[scheme:swift_default]
9+
entries:
10+
flash_text_swift -> flash_text
11+
dram0_swift -> dram0_data
12+
[mapping:swift_default]
13+
archive: *
14+
entries:
15+
* (swift_default);
16+
flash_text_swift -> flash_text SURROUND (swift_text),
17+
dram0_swift -> dram0_data SURROUND (swift_dram0)

0 commit comments

Comments
 (0)