[cairo] Cairo 1.14.2 problems with Solaris 10, libXrender

suzuki toshiya mpsuzuki at hiroshima-u.ac.jp
Wed Aug 5 07:07:20 PDT 2015

Dear Andreas,

Now I don't have good platform for side-by-side checking
to experience the trouble really, so please let me ask
a question...

The issue was found by the inconsistent header/library in
Solaris 10 (so, it would be possible for Solaris 10 users
to bypass this problem by tweaking the configure script),
but your comment is that the hardwired configuration about
the availability of XrenderCreateSolidFill etc is not good
idea, they should be checked in runtime.

Is this correct understanding?

If this is correct understanding, the runtime checking of
the availability would be a symbol checking in libXrender?
Or, should we contact with X server whether required
XRender extension is available /or not (I'm afraid I'm
misunderstanding with your word, "actual X server")?


Andreas F. Borchert wrote:
> Hi folks,
> the following problem is not the fault of the Cairo library in the first
> place but of Solaris. However, the current release makes it pretty hard
> to track down this problem and I am posting this here as other developers
> might run into the same problem.
> I build open source packages by myself for Solaris 10. To get GTK+ up and
> running, I compiled and packaged the whole suite along with the Cairo
> library. Everything could be compiled, at times with some minor fixes,
> but the end result was unfortunately not usable as
>     * Gtk2 failed to render text and
>     * Gtk3 failed to render anything.
> It took me a while to track this down to the Cairo library in
> conjunction with the Xrender library. Newer updates of Solaris 10
> provide libXrender.so.1 and Xrender.h. Unfortunately the versions of
> both files do not match, i.e. libXrender.so.1 supports 0.10 along with
> CreateLinearGradient etc [1] but Xrender.h appears to support 0.9 only
> and does not provide the declarations of 0.10. This is known to Oracle
> since November 2010 (bug id 15683111) but was unfortunately never fixed
> since then despite numerous X11 updates (including patch 119060-69 which
> was released in July 2015).
> configure checks if the functions XRenderCreateSolidFill,
> XRenderCreateLinearGradient, XRenderCreateRadialGradient, and
> XRenderCreateConicalGradient are provided by -lXrender. As they
> are defined, configure sets HAVE_XRENDERCREATECONICALGRADIENT etc to 1
> in config.h. Subsequent compilations, however, fail as the associated
> prototypes are not to be found in Xrender.h. Seeing these error messages,
> I thought that these extensions do not appear to be supported and decided
> quickly to set all these macros to 0. This compiled and lead to the
> result above.
> What is the problem? In cairo-xlib-xrender-private.h we find multiple
> tests of these config.h macros. Here is the first one:
>     #define XRenderCreateSolidFill                          _int_consume
>     #endif
> This means that calls of XRenderCreateSolidFill are replaced
> by calls of _int_consume which is effectively a no-op. In
> cairo-xlib-source.c, however, the config.h macros are ignored.
> Instead macros like CAIRO_RENDER_HAS_GRADIENTS are used that
> check the actual version of the RENDER extension in the X server
> at runtime. Example from the color_source function:
>     if (CAIRO_RENDER_HAS_GRADIENTS(dst->display)) {
>        picture = XRenderCreateSolidFill (dpy, &xcolor);
>     } else {
>        // ...
>     }
> In consequence, if this code is compiled with
> with a RENDER extension of version 0.10 or better, we
> invoke a no-op instead of rendering this. This explains why
> Gtk rendering failed that badly.
> The major problem was, of course, that Solaris 10 shipped a header file
> and a library that were not in sync. However, you might run into this
> problem as well if you compile cairo with a consistent Xrender library
> of version 0.9 which happens to encounter during runtime an extension of
> version 0.10. Your code assumes wrongly that the Xrender release of the
> library matches that of the actual X server. I would suggest to fix this.
> After patching Xrender.h on Solaris 10, Cairo compiled with
> these options switched on and Gtk renders as expected.
> Regards, Andreas.
> [1] http://www.x.org/releases/X11R7.7/doc/renderproto/renderproto.txt

More information about the cairo mailing list