0005-fix-gcc-49-build.patch 1.2 KB

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