On Sun, 3 Mar 2024 at 16:26, Akihiko Odaki <akihiko.od...@daynix.com> wrote: > > --warn-common ldflag causes warnings for multiple definitions of > ___asan_globals_registered when enabling AddressSanitizer with clang. > The warning is somewhat obsolete so just remove it. > > The common block is used to allow duplicate definitions of uninitialized > global variables. In the past, GCC and clang used to place such > variables in a common block by default, which prevented programmers for > noticing accidental duplicate definitions. Commit 49237acdb725 ("Enable > ld flag --warn-common") added --warn-common ldflag so that ld warns in > such a case. > > Today, both of GCC and clang don't use common blocks by default[1][2] so > any remaining use of common blocks should be intentional. Remove > --warn-common ldflag to suppress warnings for intentional use of > common blocks.
We also explicitly turn off the common block with -fno-common (since commit 4c288acbd6b9e, 2014). thanks -- PMM