#1553: Prevent the user defining non-static functions in more than one object file --------------------------+------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by eschnett):
This is a problem because we put thorn functions into libraries, and (by default) libraries can contain duplicate definitions. In this case, the linker uses the first definition it sees, which depends on the order in which we list the thorns when calling the linker.
We have modifications to the flesh that make Cactus use all functions from all thorns all the time. This leads to linker errors for duplicate functions. Since this is system-specific, this is not the default. (I am unaware of a system where this fails, though.)
For OS X, you enable this with the options {{{ CACTUSLIBLINKLINE = -L$(CCTK_LIBDIR) -filelist $(CCTK_LIBDIR)/LINKLIST,$(TOP)/build BEGIN_WHOLE_ARCHIVE_FLAGS = -L$(CCTK_LIBDIR) # must not be empty END_WHOLE_ARCHIVE_FLAGS = }}}