sysklogd: fix build on musl
[buildroot-gz.git] / package / cairo / 0005-fix-gcc-49-build.patch
blob112c9ea053cd6fd816746cf132e5b6e0eccc0ccb
1 Fix build with gcc 4.9
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.
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.
16 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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
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])]
34 +CFLAGS="${old_CFLAGS} ${LTO_CFLAGS}"
36 dnl ===========================================================================
38 AC_CHECK_LIB(z, compress,