PC: make build using gcc 10 work.

gcc 10 changed its default behavior from `-fcommon' to `-fno-common' for
C code. (see https://gcc.gnu.org/gcc-10/changes.html). This makes
linking the PC version of the solo firmware fail due to duplicate
symbols.

This change adds '-fcommon' to CFLAGS to restore the old behavior. It
works using older compiler versions, too.

Tested to build successfully on Ubuntu 20.10 using gcc-8, gcc-9, gcc-10
(default), clang-9, clang-10 and clang-11 (default).
fault-injection-optimization
Enrik Berkhan 2020-11-24 19:12:48 +01:00 zatwierdzone przez Conor Patrick
rodzic 3a2f8436f2
commit a01a6c0e42
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -25,7 +25,7 @@ endif
LDFLAGS += $(LIBSOLO) $(LIBCBOR) -lsodium
CFLAGS = -O2 -fdata-sections -ffunction-sections -g
CFLAGS = -O2 -fdata-sections -ffunction-sections -fcommon -g
ECC_CFLAGS = -O2 -fdata-sections -ffunction-sections -DuECC_PLATFORM=$(ecc_platform)
INCLUDES = -I../ -I./fido2/ -I./pc -I../pc -I./tinycbor/src