1
The LTO optimization seems to be somehow broken on most architectures.
2
The funny thing is that it breaks only sometimes, even if we are not
3
build in parallel. For more information, please see:
4
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753134
6
As an answer, we disable LTO for all non-AMD architectures. Simgrid is
7
not crucial to those architectures anyway.
10
buildtools/Cmake/Flags.cmake | 6 +++++-
11
1 file changed, 5 insertions(+), 1 deletion(-)
13
Index: b/buildtools/Cmake/Flags.cmake
14
===================================================================
15
--- a/buildtools/Cmake/Flags.cmake
16
+++ b/buildtools/Cmake/Flags.cmake
17
@@ -37,7 +37,11 @@ if(enable_compile_optimizations)
19
# On non-windows, 4.6 is enough for that
20
if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5" AND LINKER_VERSION STRGREATER "2.22")
21
- set(optCFLAGS "${optCFLAGS} -flto ")
22
+ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64" AND COMPILER_C_VERSION_MAJOR_MINOR STREQUAL "4.9")
23
+ message(STATUS "Disable LTO on non-AMD architectures as gcc 4.9 seems to be broken here (see #753134 on Debian)")
25
+ set(optCFLAGS "${optCFLAGS} -flto ")