Bug 69239 - FTBFS with GCC 4.7.3 on MIPS
Summary: FTBFS with GCC 4.7.3 on MIPS
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-11 20:21 UTC by christophe.jarry
Modified: 2013-09-16 11:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
config.log of the build (142.26 KB, text/plain)
2013-09-12 20:51 UTC, christophe.jarry
Details

Description christophe.jarry 2013-09-11 20:21:16 UTC
Cloned cairo from git today and tried to build it with:

./autogen.sh \
    --prefix=/usr \
    --enable-gl \
    --enable-xcb
make

The build fails with GCC 4.7.3:

cairo-gobject-enums.c:14:4: error: implicit declaration of function 'g_once_init_enter'
cairo-gobject-enums.c:58:7: error: implicit declaration of function 'g_once_init_leave'
Comment 1 Uli Schlachter 2013-09-12 08:54:31 UTC
FTBFS? Are you on debian?

Could you attach your config.log? Apparently, you don't have libglib2.0-dev installed, but configure still decided to enable the cairo-gobject code.

Hm. On the other hand, these are all the compiler errors? The compiler did find all the included headers?

Which version of gobject is this? Could you try adding "#include <glib.h>" to the beginning of util/cairo-gobject/cairo-gobject-enums.c?
Comment 2 christophe.jarry 2013-09-12 20:51:47 UTC
Created attachment 85742 [details]
config.log of the build
Comment 3 christophe.jarry 2013-09-12 21:00:12 UTC
FTBFS means "Fails to build from source".

I am not on debian.

I attached my config.log.

These are all the compiler errors. I also have warnings.

I don't know if the compiler did find all the included headers.

I don't know which version of gobject is this.

After I added "#include <glib.h>" to the beginning of util/cairo-gobject/cairo-gobject-enums.c, I did a `make` inside util/cairo-gobject. Below are the error messages I have:

cairo-gobject-structs.c:57:1: error: implicit declaration of function 'g_once_init_enter' [-Werror=implicit-function-declaration]
cairo-gobject-structs.c:57:1: error: implicit declaration of function 'g_once_init_leave' [-Werror=implicit-function-declaration]
cairo-gobject-enums.c:14:4: error: implicit declaration of function 'g_once_init_enter' [-Werror=implicit-function-declaration]
cairo-gobject-enums.c:58:7: error: implicit declaration of function 'g_once_init_leave' [-Werror=implicit-function-declaration]
Comment 4 Uli Schlachter 2013-09-13 13:24:09 UTC
Sorry, I thought you were on debian because I never heard FTBFS elsewhere.

To figure out your glib version, run 'grep VERSION /usr/lib/glib-2.0/include/glibconfig.h'. Alternatively, pkg-config --modversion glib-2.0 should tell you as well. You need at least glib 2.14 (was released in August 2007) for g_once_init_enter.

I think that your glib version is too old, but configure doesn't notice. To forcefully disable this, add --disable-gobject to your ./configure arguments.
Comment 5 christophe.jarry 2013-09-14 09:44:37 UTC
(In reply to comment #4)
> Sorry, I thought you were on debian because I never heard FTBFS elsewhere.

Neither did I ;P

My glib version was 2.12.13. I updated to 2.34.
It seems this broke my libX11.a, libX11.la, libXext.a and libXext.la.
So I rebuilt libx11 and libxext. Now cairo builds without error.

Thanks for your help.

I think someone should add to configure.ac that cairo requires at least version 2.14 of glib.
Comment 6 Uli Schlachter 2013-09-16 11:00:30 UTC
commit a8a805b8d9bbbfed9986ecc71e76859a5353730f
Author: Uli Schlachter <psychon@znc.in>
Date:   Fri Sep 13 22:18:08 2013 +0200

    cairo-gobject: Require at least glib 2.14
    
    cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions
    were added in glib 2.14 and thus cairo needs at least this version for its
    gobject helper functions.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239
    Signed-off-by: Uli Schlachter <psychon@znc.in>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.