Bug 178283 - [WPE] Fontconfig fails build in JHBuild with “error: conflicting types for ‘FcObjectTypeHash’”
Summary: [WPE] Fontconfig fails build in JHBuild with “error: conflicting types for ‘F...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-13 13:37 PDT by Adrian Perez
Modified: 2017-10-13 15:04 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.41 KB, patch)
2017-10-13 13:45 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2017-10-13 13:37:34 PDT
Full error:

  In file included from ../../../Source/fontconfig-2.12.4/src/fcobjs.c:33:0:
    fcobjshash.gperf:28:1: error: conflicting types for ‘FcObjectTypeHash’
      "aspect",FC_ASPECT_OBJECT
      ^~~~~~~~~~~~~~~~
  ../../../Source/fontconfig-2.12.4/src/fcobjs.c:28:1:
    note: previous declaration of ‘FcObjectTypeHash’ was here
      FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len);
      ^~~~~~~~~~~~~~~~
  In file included from ../../../Source/fontconfig-2.12.4/src/fcobjs.c:33:0:
    fcobjshash.gperf:172:1: error: conflicting types for ‘FcObjectTypeLookup’
  ../../../Source/fontconfig-2.12.4/src/fcobjs.c:31:1:
    note: previous declaration of ‘FcObjectTypeLookup’ was here
      FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len);
      ^~~~~~~~~~~~~~~~~~
Comment 1 Adrian Perez 2017-10-13 13:38:05 PDT
Interestingly enough, the JHBuild for the GTK+ port uses exactly
the same version of Fontconfig, but there it builds.
Comment 2 Adrian Perez 2017-10-13 13:45:21 PDT
Created attachment 323738 [details]
Patch
Comment 3 Zan Dobersek 2017-10-13 13:54:19 PDT
Could this be a ccache issue?

What's the target architecture? Is it an issue with how FC_GPERF_SIZE_T is deduced?
Comment 4 Adrian Perez 2017-10-13 14:15:48 PDT
(In reply to Zan Dobersek from comment #3)
> Could this be a ccache issue?
> 
> What's the target architecture? Is it an issue with how FC_GPERF_SIZE_T is
> deduced?

The target architecture is x86-64 (my work laptop). I added the
‘supports-non-srcdir-builds="no"’ because I noticed that the JHBuild
module set for the GTK+ port has that, and that made Fontconfig build
successfully.
Comment 5 Adrian Perez 2017-10-13 14:20:19 PDT
(In reply to Adrian Perez from comment #4)
> (In reply to Zan Dobersek from comment #3)
> > Could this be a ccache issue?
> > 
> > What's the target architecture? Is it an issue with how FC_GPERF_SIZE_T is
> > deduced?
> 
> The target architecture is x86-64 (my work laptop). I added the
> ‘supports-non-srcdir-builds="no"’ because I noticed that the JHBuild
> module set for the GTK+ port has that, and that made Fontconfig build
> successfully.

Surprise! It was me who disabled non-srcdir builds for Fontconfig
in the GTK+ JHBuild module set back in May:

  http://trac.webkit.org/changeset/216184

The commit log message still applies:

   “[...] building the module with srcdir!=builddir prevents
    "fcobjshash.gperf" being regenerated (which is needed) so this is
    disabled for the Fontconfig module.”

TL;DR: The Fontconfig code includes a pregenerated “fcobjhash.gperf”
which is out of date and the build rules for it don't work with
srcdir!=builddir.
Comment 6 WebKit Commit Bot 2017-10-13 15:03:46 PDT
Comment on attachment 323738 [details]
Patch

Clearing flags on attachment: 323738

Committed r223301: <https://trac.webkit.org/changeset/223301>
Comment 7 WebKit Commit Bot 2017-10-13 15:03:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2017-10-13 15:04:20 PDT
<rdar://problem/34986650>