Bug 76288 - GCC compiler version is not detected properly for QNX qcc variant
Summary: GCC compiler version is not detected properly for QNX qcc variant
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eli Fidler
URL:
Keywords:
Depends on:
Blocks: 73144
  Show dependency treegraph
 
Reported: 2012-01-13 10:47 PST by Eli Fidler
Modified: 2012-01-13 18:47 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.82 KB, patch)
2012-01-13 10:56 PST, Eli Fidler
no flags Details | Formatted Diff | Diff
Patch (1.83 KB, patch)
2012-01-13 13:42 PST, Eli Fidler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Fidler 2012-01-13 10:47:09 PST
QNX is built with the qcc variant of GCC, which doesn't support -dumpversion.
Comment 1 Eli Fidler 2012-01-13 10:56:22 PST
Created attachment 122460 [details]
Patch
Comment 2 Leandro Pereira 2012-01-13 11:30:26 PST
Comment on attachment 122460 [details]
Patch

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

> Source/cmake/WebKitHelpers.cmake:15
> +        EXEC_PROGRAM("${CMAKE_CXX_COMPILER} -E -Wp,-dM - < /dev/null | grep __VERSION__ | sed -e 's/^[^\"]*\"//' -e 's/\".*$//'" OUTPUT_VARIABLE COMPILER_VERSION)

Nice trick.

I'd grep for '^#define __VERSION__ ', in the event that '__VERSION__' is present in some other predefined macro.

Also, since this part of the code is just interested in the compiler version numbers anyway, I'd use the more readable "grep -E -o '[0-9]+\.[0-9]+\.?[0-9]+?'" instead of that sed command. This have the added benefit of detecting gcc version as "4.6.2" even if the returned string is "4.6.2 20111223 (prerelease)" (or similar), which is important here as this is used to enable/disable flags to workaround compiler bugs.
Comment 3 Eli Fidler 2012-01-13 13:42:54 PST
Created attachment 122491 [details]
Patch
Comment 4 Rob Buis 2012-01-13 14:39:19 PST
Comment on attachment 122491 [details]
Patch

LGTM.
Comment 5 WebKit Review Bot 2012-01-13 18:47:43 PST
Comment on attachment 122491 [details]
Patch

Clearing flags on attachment: 122491

Committed r105014: <http://trac.webkit.org/changeset/105014>
Comment 6 WebKit Review Bot 2012-01-13 18:47:47 PST
All reviewed patches have been landed.  Closing bug.