[gimp] build/win: Disable lto in cairo



commit f08c519aa265f79f00f68496145bb999301f0c40
Author: Michael Henning <drawoc darkrefraction com>
Date:   Tue Jul 29 22:59:32 2014 -0400

    build/win: Disable lto in cairo
    
    It causes issues with older binutils versions. See:
    https://bugs.freedesktop.org/show_bug.cgi?id=77060

 build/windows/jhbuild/build.jhbuildrc              |    3 +-
 build/windows/jhbuild/gtk+.moduleset               |    2 +
 .../jhbuild/patches/cairo-disable-lto.patch        |   51 ++++++++++++++++++++
 3 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/build/windows/jhbuild/build.jhbuildrc b/build/windows/jhbuild/build.jhbuildrc
index 5b98858..2d3fef6 100644
--- a/build/windows/jhbuild/build.jhbuildrc
+++ b/build/windows/jhbuild/build.jhbuildrc
@@ -136,7 +136,8 @@ module_autogenargs['cairo']      = autogenargs + """ --enable-xlib=no \
                                                      --enable-xcb=no \
                                                      --enable-xcb-shm=no \
                                                      --enable-pthread=no \
-                                                     --enable-win32-font=yes"""
+                                                     --enable-win32-font=yes \
+                                                     --disable-lto"""
 
 module_autogenargs['pixman']     = autogenargs + """ --enable-gtk=no"""
 
diff --git a/build/windows/jhbuild/gtk+.moduleset b/build/windows/jhbuild/gtk+.moduleset
index b3ddae1..f13d014 100644
--- a/build/windows/jhbuild/gtk+.moduleset
+++ b/build/windows/jhbuild/gtk+.moduleset
@@ -23,6 +23,8 @@
        <branch version="1.12.16" repo="cairographics.org"
                        module="cairo-1.12.16.tar.xz"
                        hash="sha1:4f6e337d5d3edd7ea79d1426f575331552b003ec">
+               <!-- From cairo git -->
+               <patch file="cairo-disable-lto.patch" strip="1"/>
        </branch>
        <dependencies>
                <dep package="zlib"/>
diff --git a/build/windows/jhbuild/patches/cairo-disable-lto.patch 
b/build/windows/jhbuild/patches/cairo-disable-lto.patch
new file mode 100644
index 0000000..3cf36f2
--- /dev/null
+++ b/build/windows/jhbuild/patches/cairo-disable-lto.patch
@@ -0,0 +1,51 @@
+From c3645d97ebd24c6f7ad850785d585aebc706a11c Mon Sep 17 00:00:00 2001
+From: Bryce Harrington <b harrington samsung com>
+Date: Tue, 08 Jul 2014 20:14:20 +0000
+Subject: configure.ac: Add a --disable-lto configure option
+
+Link-Time Optimization seems to be stable enough with gcc 4.8 and 4.9,
+but has proven to be an issue in the past for many cairo users (webkit,
+efl, ubuntu, opensuse, gentoo, arch...) who carry patches to disable it.
+
+Gentoo's patch[1] adds a --disable-lto option to leave it enabled by
+default but give users the ability to work around lto related build
+problems (c.f. fdo #77060).  Patch appears to have been authored by
+Alexandre Rostovtsev[2].
+
+1: sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-libs/cairo/files/cairo-1.12.16-lto-optional.patch
+2: https://bugs.gentoo.org/show_bug.cgi?id=509552
+
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60852
+Signed-off-by: Bryce Harrington <b harrington samsung com>
+Reviewed-by: Uli Schlachter <psychon znc in>
+---
+diff --git a/build/configure.ac.warnings b/build/configure.ac.warnings
+index f984eb2..a72d948 100644
+--- a/build/configure.ac.warnings
++++ b/build/configure.ac.warnings
+@@ -38,13 +38,18 @@ dnl options.  Namely, the following:
+ 
+ dnl -flto working really needs a test link, not just a compile
+ 
+-safe_MAYBE_WARN="$MAYBE_WARN"
+-MAYBE_WARN="$MAYBE_WARN -flto"
+-AC_TRY_LINK([],[
++AC_ARG_ENABLE(lto,
++  AS_HELP_STRING([--disable-lto],
++                 [Do not try to use Link-Time Optimization]))
++if test "x$enable_lto" != "xno"; then
++   safe_MAYBE_WARN="$MAYBE_WARN"
++   MAYBE_WARN="$MAYBE_WARN -flto"
++   AC_TRY_LINK([],[
+       int main(int argc, char **argv) { return 0; }
+-],[],[
++   ],[],[
+       MAYBE_WARN="$safe_MAYBE_WARN"
+-])
++   ])
++fi
+ 
+ MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
+ 
+--
+cgit v0.9.0.2-2-gbebe


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]