Fix "standalone pacman" compile errors with gcc >9.2.1 #2223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the introduction of standalone pacman app in PR #2145, it's been impossible to build Mayhem firmware with any compiler version above 9.2.1. (Yes I realize that 9.2.1 is the "official" build version but I prefer the warning message versus strange compiler errors below.)
This command line switch resolves the issue, and is already being used in the cmake file when building applications so there should be no adverse affects.
Thanks to @Brumi-2021 for this fix.
BTW, this is what the errors look like without this fix:
/opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-writer.o): in function
_write_r':writer.c:(.text._write_r+0x10): undefined reference to
_write' /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-closer.o): in function
_close_r':closer.c:(.text._close_r+0xc): undefined reference to
_close' /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-fstatr.o): in function
_fstat_r':fstatr.c:(.text._fstat_r+0xe): undefined reference to
_fstat' /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-isattyr.o): in function
_isatty_r':isattyr.c:(.text._isatty_r+0xc): undefined reference to
_isatty' /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-lseekr.o): in function
_lseek_r':lseekr.c:(.text._lseek_r+0x10): undefined reference to
_lseek' /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /opt/build/armbin/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-readr.o): in function
_read_r':readr.c:(.text._read_r+0x10): undefined reference to
_read' collect2: error: ld returned 1 exit status make[2]: *** [firmware/standalone/pacman/CMakeFiles/pacman_app.elf.dir/build.make:114: firmware/standalone/pacman/pacman_app.elf] Error 1 make[1]: *** [CMakeFiles/Makefile2:2095: firmware/standalone/pacman/CMakeFiles/pacman_app.elf.dir/all] Error 2