Bug 51974 - Atomics.h has incorrect GCC test for ext/atomicity.h when using LSB compilers
Summary: Atomics.h has incorrect GCC test for ext/atomicity.h when using LSB compilers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-05 17:48 PST by Craig Scott
Modified: 2012-08-08 02:10 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.27 KB, patch)
2012-06-22 14:39 PDT, Alvaro Lopez Ortega
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Scott 2011-01-05 17:48:13 PST
In JacaScriptCore/wtf/Atomics.h the following code block can be found around line 64:

#if OS(WINDOWS)
#include <windows.h>
#elif OS(DARWIN)
#include <libkern/OSAtomic.h>
#elif OS(ANDROID)
#include <cutils/atomic.h>
#elif COMPILER(GCC) && !OS(SYMBIAN)
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
#include <ext/atomicity.h>
#else
#include <bits/atomicity.h>
#endif
#endif

The test for the GCC version is not correct when the LSB compiler is being used under linux, since the LSB headers only have bits/atomicity.h and not ext/atomicity.h. A more correct test would be:

#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))) && !defined(__LSB_VERSION__)


For reference, the LSB and Qt bug trackers also have corresponding entries about this particular webkit issue:

http://bugs.linuxbase.org/show_bug.cgi?id=2522
http://bugreports.qt.nokia.com/browse/QTBUG-16329
Comment 1 Patrick R. Gansterer 2011-01-06 12:04:16 PST
Can you provide a patch for this? See http://webkit.org/coding/contributing.html
Comment 2 Jędrzej Nowacki 2011-03-30 05:09:57 PDT
As far I understand ext/atomicity.h file should not be included at all.

The file starts from this warning:
/** @file atomicity.h
 *  This is an internal header file, included by other library headers.
 *  You should not attempt to use it directly.
 */

Changing status to New
Comment 3 Alvaro Lopez Ortega 2012-06-22 14:39:38 PDT
Created attachment 149104 [details]
Patch
Comment 4 Simon Hausmann 2012-07-27 01:33:36 PDT
Would you like help landing this, i.e. using the commit queue?
Comment 5 Craig Scott 2012-08-07 21:17:52 PDT
Not sure what the holdup is here. Alvaro provided a patch, so I'm assuming your last comment was directed to him. My changed employment arrangements mean I no longer can commit time to these issues myself.
Comment 6 WebKit Review Bot 2012-08-08 02:10:38 PDT
Comment on attachment 149104 [details]
Patch

Clearing flags on attachment: 149104

Committed r125010: <http://trac.webkit.org/changeset/125010>
Comment 7 WebKit Review Bot 2012-08-08 02:10:41 PDT
All reviewed patches have been landed.  Closing bug.