]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/cairo/0005-fix-gcc-49-build.patch
112c9ea053cd6fd816746cf132e5b6e0eccc0ccb
[coffee/buildroot.git] / package / cairo / 0005-fix-gcc-49-build.patch
1 Fix build with gcc 4.9
2
3 cairo fails to build with gcc 4.9 due to a bad interaction of cairo
4 modules with the LTO mechanism. The suggested workaround is to pass
5 -ffat-lto-objects. See
6 https://bugs.freedesktop.org/show_bug.cgi?id=77060 for the upstream
7 bug report, and
8 https://bugs.archlinux.org/task/40313?project=1&openedfrom=-1+week for
9 the ArchLinux bug report.
10
11 This patch passes -ffat-lto-objects when gcc understands this option,
12 in order to provide compatibility with gcc versions older than 4.8,
13 which did not provide this option, but are anyway unaffected by the
14 issue.
15
16 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17
18 Index: b/configure.ac
19 ===================================================================
20 --- a/configure.ac
21 +++ b/configure.ac
22 @@ -37,6 +37,16 @@
23  m4_include(build/configure.ac.pthread)  dnl checks for pthreads
24  AC_CACHE_SAVE
25  
26 +old_cflags=$CFLAGS
27 +CFLAGS=-ffat-lto-objects
28 +AC_MSG_CHECKING([whether CC supports -ffat-lto-objects])
29 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
30 +    [AC_MSG_RESULT([yes])]
31 +    [LTO_CFLAGS=-ffat-lto-objects],
32 +    [AC_MSG_RESULT([no])]
33 +)
34 +CFLAGS="${old_CFLAGS} ${LTO_CFLAGS}"
35 +
36  dnl ===========================================================================
37  
38  AC_CHECK_LIB(z, compress,