1
0
forked from me/IronOS

Fix FTBFS due to LTO being more sensitive to file order

When a symbol is used from inline assembly, LTO compiling and linking
process becomes more picky with regard to the order of compile/linking
units.

Specifically, when FreeRTOS/Source/portable/GCC/ARM_CM3/port.c comes
before FreeRTOS/Source/tasks.c in find results, the build fails with
undefined reference to `pxCurrentTCB' error.

To workaround the issue, do the same as we already have for
vTaskSwitchContext.

Note: different order affects resulting binary (.text section) size:
39924 with the wrong order and 39884 with the correct.

Fixes #685.
This commit is contained in:
Paul Fertser
2020-09-05 18:23:03 +03:00
parent 372f8e3565
commit d37f8def88

View File

@@ -95,7 +95,9 @@ LINKER_FLAGS=-Wl,--gc-sections \
-Wl,--wrap=free \
-o$(OUT_HEXFILE).elf \
-Wl,-Map=$(OUT_HEXFILE).map \
-lm -Wl,--undefined=vTaskSwitchContext \
-lm \
-Wl,--undefined=vTaskSwitchContext \
-Wl,--undefined=pxCurrentTCB \
-Wl,--defsym=__FLASH_SIZE__=$(flash_size) \
-Wl,--defsym=__BOOTLDR_SIZE__=$(bootldr_size) \
--specs=nano.specs