~ubuntu-branches/ubuntu/utopic/simgrid/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/lto-gcc-4.9.diff

  • Committer: Package Import Robot
  • Author(s): Martin Quinson
  • Date: 2014-07-05 00:20:25 UTC
  • Revision ID: package-import@ubuntu.com-20140705002025-x0d5sceaovd5jhpw
Tags: 3.11.1-7
* Disable LTO on all non-AMD architectures to circumvent a seemingly
  bug in gcc 4.9.
* Re-enable parallel builds now that LTO issues are (hopefully) fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
6
As an answer, we disable LTO for all non-AMD architectures. Simgrid is
 
7
not crucial to those architectures anyway.
 
8
 
 
9
---
 
10
 buildtools/Cmake/Flags.cmake |    6 +++++-
 
11
 1 file changed, 5 insertions(+), 1 deletion(-)
 
12
 
 
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)
 
18
     else()    
 
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)")
 
24
+       else()
 
25
+          set(optCFLAGS "${optCFLAGS} -flto ")
 
26
+       endif()
 
27
       endif()
 
28
     endif()
 
29
   endif()