The upgrade from PIO-Core 4.1.0 to 4.2.0 breaks my generated elf file (on atmelSam platform). I figured out the difference is in the addition of an archive step:
- on PIO-Core 4.1.0: the recipe was:
- arm-none-eabi-gcc: compile all .c files to .o files
- arm-none-eabi-gcc: link all .o files together (in 1 command) into .elf file
- on PIO-Core 4.2.0: this recipe changed (without upgrading any platforms or libraries) into
- arm-none-eabi-gcc: compile all .c files to .o files
- arm-none-eabi-ar: create an archive of all .o files to .a file
- arm-none-eabi-ranlib: create index
4.arm-none-eabi-gcc: link main.o file with .a file into .elf file
=> The latter returns a different (non working) elf file than the former recipe. Not any warning or error is thrown by the linker, but it seems it wasn’t able to link in symbols from the .a file, since the .hex/.bin file is almost empty…
2 Questions:
- can someone point me to the code change between 4.1.0 and 4.2.0 that might have changed this behaviour?
- anybody an idea why the latter recipe is not working anymore? All commands seems valid to me and it should actually not make a difference if some .o files are first tied together into .a file before passed to the linker… or am i missing something.
Some more details:
- I’m using a custom library that modifies the build recipe from the atmelsam platform a bit: it adds a custom linker script (maybe that might have some influence on the behaviour of .a files for the linker)
- If you want to reproduce my issue, you can compile and execute the ArduinoZero example in GitHub - JelleRoets/AtmelStart_PlatformIO: PlatformIO library that automatically downloads Atmel Start generated code. If you do that with pio core 4.1.0 everything runs smooth, in 4.2.0 the extra archive step still runs without any errors but the elf file is not working (and almost empty)