From a01a6c0e422c3da20c9ccb19c5b8be4b034ebc67 Mon Sep 17 00:00:00 2001 From: Enrik Berkhan Date: Tue, 24 Nov 2020 19:12:48 +0100 Subject: [PATCH] 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). --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6605fd4..8d96bbb 100644 --- a/Makefile +++ b/Makefile @@ -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