From: Arnaud Giersch Date: Mon, 16 Jul 2018 13:15:43 +0000 (+0200) Subject: Try to fix MC with recent GNU ld (>= 2.30). X-Git-Tag: v3_21~422^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0a8350a10cb7b9a9aef49f09499d1815a25cfcc6 Try to fix MC with recent GNU ld (>= 2.30). It's failing with: ./src/mc/sosp/mc_checkpoint.cpp:205: [root/CRITICAL] Multiple read only segments for [...], not supported. --- diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index c72e6d5e28..9fa3a60243 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -120,6 +120,10 @@ if(CMAKE_COMPILER_IS_GNUCC AND GCCLIBATOMIC_LIBRARY) set(SIMGRID_DEP "${SIMGRID_DEP} -Wl,--as-needed -latomic -Wl,--no-as-needed") endif() +if(enable_model-checking AND CMAKE_COMPILER_IS_GNUCC AND LINKER_VERSION VERSION_GREATER_EQUAL "2.30") + set(SIMGRID_DEP "${SIMGRID_DEP} -Wl,-znoseparate-code") +endif() + target_link_libraries(simgrid ${SIMGRID_DEP}) # Dependencies from maintainer mode