]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Workaround linker bug when compiling expand_instantiations. 1813/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 30 Oct 2015 01:25:29 +0000 (20:25 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 30 Oct 2015 01:25:29 +0000 (20:25 -0500)
Do so by removing -fuse-ld=gold from the list of linker flags for this program.

cmake/scripts/CMakeLists.txt

index ad2cf0e876b30a9c0ed0c0c89e55431c8de2d118..a51f8cb04c42285befeaca487d16533cd84f3e9a 100644 (file)
 ## ---------------------------------------------------------------------
 
 ADD_EXECUTABLE(expand_instantiations_exe expand_instantiations.cc)
+
+#
+# We run into a bug when compiling expand_instantiations with
+# -fuse-ld=gold -pthreads, see https://github.com/dealii/dealii/issues/1798
+# Work around this by stripping -fuse-ld=gold out of the build flags
+# for the script. This does little harm because linking this one file
+# is so exceedingly cheap that there is no speed difference between
+# using gold or the old BFD ld linker.
+#
+# If we are on a system where -fuse-ld=gold simply isn't part of the
+# linker flag, filtering this one command out of the list of flags
+# does not harm either.
+#
+STRING(REPLACE "-fuse-ld=gold" "" _expand_instantiations_link_flags ${DEAL_II_LINKER_FLAGS} )
 SET_TARGET_PROPERTIES(expand_instantiations_exe PROPERTIES
-  LINK_FLAGS "${DEAL_II_LINKER_FLAGS}"
+  LINK_FLAGS "${_expand_instantiations_link_flags}"
   LINKER_LANGUAGE "CXX"
   COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS}"
   COMPILE_FLAGS "${DEAL_II_CXX_FLAGS}"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.