Disable link-time, whole program optimization

When using LTO, the linker calls back to the compiler to figure out
where a certain symbol is defined. However, in many versions there
is apparently a bug that is triggered if a template in inlined in
both a used library and in the main program, but with different
versions of the compiler. The Boost exception class is particular
prone for this.

Thus, we disable the -lto from the development builds by default;
if anyone wants to test of the behaviour of their own compiler, they
must now explicitly turn on this flag.
This commit is contained in:
Roland Kaufmann 2013-06-13 23:19:27 +02:00
parent 1a63243419
commit 7bf82f96b2

View File

@ -16,7 +16,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set (_opt_flags "") set (_opt_flags "")
# link-time (a.k.a. global) optimizations # link-time (a.k.a. global) optimizations
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" ON) # disabled due to widespread bugs in the linker plugin
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" OFF)
if (WHOLE_PROG_OPTIM) if (WHOLE_PROG_OPTIM)
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS) check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
if (HAVE_LINK_OPTS) if (HAVE_LINK_OPTS)