Bug 83584

Summary: Fix the build with gcc 4.7.0
Product: WebKit Reporter: Andras Becsi <abecsi>
Component: Tools / TestsAssignee: Andras Becsi <abecsi>
Status: RESOLVED FIXED    
Severity: Normal CC: jingdow, kbalazs, ossy, vestbo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: Linux   
Bug Depends on:    
Bug Blocks: 43191    
Attachments:
Description Flags
proposed fix
buildbot: commit-queue-
updated patch
none
updated patch with updated changelog none

Description Andras Becsi 2012-04-10 08:18:05 PDT
Building WebKit with the recently released gcc 4.7.0 is not possible because the compiler has a few new warning messages which make the build fail because of Werror.
Comment 1 Andras Becsi 2012-04-10 09:24:42 PDT
Created attachment 136470 [details]
proposed fix
Comment 2 Build Bot 2012-04-10 09:50:22 PDT
Comment on attachment 136470 [details]
proposed fix

Attachment 136470 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12379515
Comment 3 Andras Becsi 2012-04-10 09:51:36 PDT
Created attachment 136473 [details]
updated patch
Comment 4 Andras Becsi 2012-04-10 10:00:13 PDT
Created attachment 136474 [details]
updated patch with updated changelog

*sigh*
Comment 5 Alexey Proskuryakov 2012-04-10 12:51:45 PDT
Comment on attachment 136474 [details]
updated patch with updated changelog

View in context: https://bugs.webkit.org/attachment.cgi?id=136474&action=review

> Source/WebCore/html/HTMLImageElement.cpp:76
> -    if (optionalHeight > 0)
> +    if (optionalHeight)

Heh.
Comment 6 Andras Becsi 2012-04-11 04:23:29 PDT
Comment on attachment 136474 [details]
updated patch with updated changelog

Clearing flags on attachment: 136474

Committed r113848: <http://trac.webkit.org/changeset/113848>
Comment 7 Andras Becsi 2012-04-11 04:23:38 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 jingdow 2012-04-12 01:10:51 PDT
Still fails with error:

g++: error: unrecognized command line option ‘-fuse-ld=gold’

on x86_64 architecture. It works if I manually edit 'Tools/qmake/mkspecs/features/unix/default_post.prf' removing lines 41-46.
Comment 9 Balazs Kelemen 2012-04-12 02:21:18 PDT
(In reply to comment #8)
> Still fails with error:
> 
> g++: error: unrecognized command line option ‘-fuse-ld=gold’
> 
> on x86_64 architecture. It works if I manually edit 'Tools/qmake/mkspecs/features/unix/default_post.prf' removing lines 41-46.

Strange. Do you use the same gcc for building qt and webkit?
Comment 10 Andras Becsi 2012-04-12 02:41:02 PDT
(In reply to comment #8)
> Still fails with error:
> 
> g++: error: unrecognized command line option ‘-fuse-ld=gold’
> 
> on x86_64 architecture. It works if I manually edit 'Tools/qmake/mkspecs/features/unix/default_post.prf' removing lines 41-46.

You have to build Qt with the same compiler you try to build WebKit, since the QT_GCC_FOO_VERSION variables are set on compile time of Qt.

So if your Qt was built with gcc 4.6 (or older), then the check does not work, and the -fuse-ld=gold is appended.

There should probably be a version check for the actual compiler in the WebKit codebase, but this is not trivial since we support a myriad of compilers. 
And additionally, this is a transition problem which should be fixed by the Qt packagers of the distribution / the provider of your Qt.
Comment 11 Andras Becsi 2012-04-12 02:45:05 PDT
(In reply to comment #10)
> (In reply to comment #8)
> > Still fails with error:
> > 
> > g++: error: unrecognized command line option ‘-fuse-ld=gold’
> > 
> > on x86_64 architecture. It works if I manually edit 'Tools/qmake/mkspecs/features/unix/default_post.prf' removing lines 41-46.
> 
> You have to build Qt with the same compiler you try to build WebKit, since the QT_GCC_FOO_VERSION variables are set on compile time of Qt.
> 
> So if your Qt was built with gcc 4.6 (or older), then the check does not work, and the -fuse-ld=gold is appended.
> 
> There should probably be a version check for the actual compiler in the WebKit codebase, but this is not trivial since we support a myriad of compilers. 
> And additionally, this is a transition problem which should be fixed by the Qt packagers of the distribution / the provider of your Qt.

This made me wonder if we should consider removing the QMAKE_LFLAGS += -fuse-ld=gold line altogether and require developers to set ld.gold as the default linker if they want to use it.

Tor Arne, what do you think?
Comment 12 jingdow 2012-04-13 06:54:34 PDT
To reply Balazs and Andras: I use Qt binary package provided by my OS (Arch Linux), which is (most probably) compiled with gcc 4.6. Thanks for clarification.