Portage Errors: Cairo Fails to Compile on libiberty.h

You may encounter the following error while compiling Cairo:

/usr/include/libiberty.h:589: error: expected declaration specifiers or '...' before numeric constant
/usr/include/libiberty.h:589: error: conflicting types for '__asprintf_chk'
/usr/include/bits/stdio2.h:135: error: previous declaration of '__asprintf_chk' was here
make[4]: *** [libcairo_trace_la-lookup-symbol.lo] Error 1
make[4]: Leaving directory `/var/tmp/portage/x11-libs/cairo-1.10.2-r1/work/cairo-1.10.2/util/cairo-trace'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/x11-libs/cairo-1.10.2-r1/work/cairo-1.10.2/util'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/x11-libs/cairo-1.10.2-r1/work/cairo-1.10.2/util'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-libs/cairo-1.10.2-r1/work/cairo-1.10.2'
make: *** [all] Error 2
emake failed
 * ERROR: x11-libs/cairo-1.10.2-r1 failed (compile phase):
 *   emake failed
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 3089:  Called _eapi2_src_compile
 *     ebuild.sh, line  669:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"

This error is a result of how old versions of glibc behave when compiled with SSP. Temporarily remove -fstack-protector or -PIC from your CFLAGS and update glibc:

# emerge --update glibc gcc
# emerge cairo


There are no comments for this item.