Avoid duplicate definitions of globals 06/14106/4
authorCheyenne Wills <cwills@sinenomine.net>
Wed, 1 Apr 2020 15:48:57 +0000 (09:48 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 3 Apr 2020 15:21:51 +0000 (11:21 -0400)
commit0e2072ae386d4111bef161eb955964b649c31386
treedb739a55f988b462187076590e80e3953af7d285
parentf841c189a53f3a6bcf5c25336e4e0ad5362036e2
Avoid duplicate definitions of globals

GCC 10 changed a default flag from -fcommon to -fno-common.  See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678 for some background.

The change in gcc 10 results in build link-time errors. For example:
   ../../src/xstat/.libs/liboafs_xstat_cm.a(xstat_cm.o):(.bss+0x2050):
       multiple definition of `numCollections';

Ensure that only one definition for global data objects exist and change
references to use "extern" as needed.

To ensure that future changes do not introduce duplicated global
definitions, add the -fno-common flag to XCFLAGS when using the
configure --enable-checking setting.

Change-Id: I6780dd995fe6fb6c2102765ff3484c18e1e1cd58
Reviewed-on: https://gerrit.openafs.org/14106
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
16 files changed:
src/bucoord/main.c
src/butc/dbentries.c
src/butc/dump.c
src/butc/lwps.c
src/butc/tcmain.c
src/cf/osconf.m4
src/fsprobe/fsprobe.h
src/uss/uss_vol.c
src/viced/host.c
src/viced/host.h
src/vol/fssync-server.c
src/vol/volume.c
src/xstat/xstat_cm.c
src/xstat/xstat_cm.h
src/xstat/xstat_fs.c
src/xstat/xstat_fs.h