Skip to content

Commit b1d3ab8

Browse files
Fix PIO toolchain by ensuring IRQ vectors in link
PIO uses GCC in a way that causes the compiler to optimize away the IRQ vectors (since they're not used in our code itself) in the final build stage. We can avoid this by forcing all of libmain to be included in the final object. This is a small file, and almost completely related to IRQs, so space impact is minimal. Fixes esp8266#6087 and platformio/platform-espressif8266#147
1 parent 98125f8 commit b1d3ab8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implici
5151
compiler.S.cmd=xtensa-lx106-elf-gcc
5252
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls
5353

54-
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
54+
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-Wl,-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
5555

5656
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
57-
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc
57+
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -Wl,--whole-archive -lmain -Wl,--no-whole-archive -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc
5858

5959
compiler.cpp.cmd=xtensa-lx106-elf-g++
6060
compiler.cpp.flags=-c {compiler.warning_flags} -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags}

0 commit comments

Comments
 (0)