Cactus fails to link with gcc-10 due to duplicate linker symbols

Issue #2406 resolved
Roland Haas created an issue

Compiling with gcc-10 Cactus eventually fails to link with errors such as (shown for ExternalLibraries/HDF5 but also happen eg for the restricted parameters structs _wavetoyres_ or so):

/usr/bin/ld: ../src/libh5check.a(h5pline.o):/data/rhaas/postdoc/gr/cactus/ET_Turing/configs/sim/scratch/build/HDF5/h5check_2_0/src/h5_check.h:2126: multiple definition of `g_verbose_num'; h5checker_main.o:/data/rhaas/postdoc/gr/cactus/ET_Turing/configs/sim/scratch/build/HDF5/h5check_2_0/tool/../src/h5_check.h:2126: first defined here

This is due to the compiler defaulting to -fno-common ( and can be avoiding by add -fcommon.

Comments (8)

  1. Roland Haas reporter

    I good solution is likely to check for __attribute__((__common__)) in configure then use that when declaring the parameter structs as this does not require that a particular command line option be used.

  2. Log in to comment