projectcalico / bird

Calico's fork of the BIRD protocol stack
91 stars 86 forks source link

Add -fcommon to CFLAGS #86

Closed nelljerram closed 4 years ago

nelljerram commented 4 years ago

To fix this problem, which we've been seeing since gcc:latest became GCC 10:

LD -r -o all.o cf-parse.tab.o cf-lex.o conf.o
/usr/bin/ld: cf-lex.o:/code/obj/amd64/conf/../lib/krt.h:115: multiple definition of `kif_proto'; cf-parse.tab.o:/code/obj/amd64/conf/../lib/krt.h:115: first defined here
collect2: error: ld returned 1 exit status

The GCC 10 release notes say:

GCC now defaults to -fno-common. As a result, global variable
accesses are more efficient on various targets. In C, global
variables with multiple tentative definitions now result in linker
errors. With -fcommon such definitions are silently merged during
linking.

(https://gcc.gnu.org/gcc-10/changes.html)

Description

A few sentences describing the overall goals of the pull request's commits. Please include

Todos