Bug 127283

Summary: [GTK] Fix a c++11 compliance issue for fontconfig
Product: WebKit Reporter: ChangSeok Oh <changseok>
Component: WebKitGTKAssignee: ChangSeok Oh <changseok>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, gustavo, mrobinson, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description ChangSeok Oh 2014-01-20 04:10:46 PST
A build failure happens when building with clang.

In file included from ../../Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:29:
In file included from /home/shivamidow/Projects/WebKit/WebKitBuild/Dependencies/Root/include/cairo/cairo-ft.h:50:
/home/shivamidow/Projects/WebKit/WebKitBuild/Dependencies/Root/include/fontconfig/fontconfig.h:116:39: error: 
      invalid suffix on literal; C++11 requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
#define FC_CACHE_SUFFIX             ".cache-"FC_CACHE_VERSION
                                             ^
/home/shivamidow/Projects/WebKit/WebKitBuild/Dependencies/Root/include/fontconfig/fontconfig.h:117:45: error: 
      invalid suffix on literal; C++11 requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
#define FC_DIR_CACHE_FILE           "fonts.cache-"FC_CACHE_VERSION
                                                  ^
/home/shivamidow/Projects/WebKit/WebKitBuild/Dependencies/Root/include/fontconfig/fontconfig.h:118:47: error: 
      invalid suffix on literal; C++11 requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
#define FC_USER_CACHE_FILE          ".fonts.cache-"FC_CACHE_VERSION
                                                   ^
  CXX      Source/WebCore/bridge/libWebCore_la-NP_jsobject.lo
  CXX      Source/WebCore/bridge/libWebCore_la-npruntime.lo

So I propose to apply a proper patch to fontconfig or else to bump fontconfig to at lease 2.9.91
Comment 1 ChangSeok Oh 2014-01-20 04:19:10 PST
Created attachment 221645 [details]
Patch
Comment 2 Martin Robinson 2014-01-20 09:53:52 PST
Is there any way we can instead compile fontconfig with -Wno-reserved-user-defined-literal
Comment 3 Zan Dobersek 2014-01-20 11:40:07 PST
Using module_autogenargs in Tools/gtk/jhbuildrc should work:

module_autogenargs['fontconfig'] = 'CFLAGS=...' + autogenargs
Comment 4 Martin Robinson 2014-01-20 12:29:34 PST
Maybe we can wait for the alternate approach on this one so that we don't have to have another patch in the repo?
Comment 5 ChangSeok Oh 2014-01-21 02:14:41 PST
Created attachment 221729 [details]
Patch
Comment 6 ChangSeok Oh 2014-01-21 02:16:31 PST
(In reply to comment #2)
> Is there any way we can instead compile fontconfig with -Wno-reserved-user-defined-literal

Yeah. we can avoid the failure by adding the flag, -Wno-reserved-user-defined-literal to CXXFALGS.
Comment 7 ChangSeok Oh 2014-01-21 02:18:37 PST
(In reply to comment #3)
> Using module_autogenargs in Tools/gtk/jhbuildrc should work:
> 
> module_autogenargs['fontconfig'] = 'CFLAGS=...' + autogenargs

Zan thanks for the tip. But the build failure happens when building webkit not fontconfig itself. Sorry for my poor description about this bug. :P
Comment 8 Martin Robinson 2014-01-21 08:30:42 PST
(In reply to comment #7)
> (In reply to comment #3)
> > Using module_autogenargs in Tools/gtk/jhbuildrc should work:
> > 
> > module_autogenargs['fontconfig'] = 'CFLAGS=...' + autogenargs
> 
> Zan thanks for the tip. But the build failure happens when building webkit not fontconfig itself. Sorry for my poor description about this bug. :P

Oh, in that case a patch is probably the best, because we don't want to let C++11 slip into WebKit code. Sorry for the confusion. Do you mind if I r+ your patch again?
Comment 9 ChangSeok Oh 2014-01-21 09:11:26 PST
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #3)
> > > Using module_autogenargs in Tools/gtk/jhbuildrc should work:
> > > 
> > > module_autogenargs['fontconfig'] = 'CFLAGS=...' + autogenargs
> > 
> > Zan thanks for the tip. But the build failure happens when building webkit not fontconfig itself. Sorry for my poor description about this bug. :P
> 
> Oh, in that case a patch is probably the best, because we don't want to let C++11 slip into WebKit code. Sorry for the confusion. Do you mind if I r+ your patch again?

No problem. Let me re-upload the first patch near soon. :)
Comment 10 ChangSeok Oh 2014-01-21 09:16:35 PST
Created attachment 221752 [details]
Patch
Comment 11 ChangSeok Oh 2014-01-21 09:50:26 PST
Comment on attachment 221752 [details]
Patch

Thanks for the r+!
Comment 12 WebKit Commit Bot 2014-01-21 10:18:30 PST
Comment on attachment 221752 [details]
Patch

Clearing flags on attachment: 221752

Committed r162448: <http://trac.webkit.org/changeset/162448>
Comment 13 WebKit Commit Bot 2014-01-21 10:18:33 PST
All reviewed patches have been landed.  Closing bug.