Bug 51977 - Detection of timegm() is incorrect for LSB compilers
Summary: Detection of timegm() is incorrect for LSB compilers
Status: UNCONFIRMED
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 18:14 PST by Craig Scott
Modified: 2012-08-07 21:18 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Scott 2011-01-05 18:14:38 PST
In JavaScriptCore/wtf/Platform.h the detection for availability of timegm() is as follows:

#if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
    && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
    && !OS(ANDROID) && !PLATFORM(BREWMP)
#define HAVE_TM_GMTOFF 1
#define HAVE_TM_ZONE 1
#define HAVE_TIMEGM 1
#endif

However, under linux with LSB compilers, there is no timegm() either. Therefore, an additional !defined(__LSB_VERSION__) needs to be added to the #if condition.
Comment 1 Craig Scott 2011-01-05 18:22:36 PST
Sorry, not quite right. The corrected version of the code should be this:

#if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
    && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
    && !OS(ANDROID) && !PLATFORM(BREWMP)
#define HAVE_TM_GMTOFF 1
#define HAVE_TM_ZONE 1
#if !defined(__LSB_VERSION__)
#define HAVE_TIMEGM 1
#endif
#endif

The LSB spec *does* have tm_gmtoff and tm_zone in the tm data structure since LSB 1.2, which basically all linux distributions would adhere to by now.
Comment 2 Patrick R. Gansterer 2011-01-06 12:04:41 PST
Can you provide a patch for this? See http://webkit.org/coding/contributing.html
Comment 3 Laszlo Gombos 2012-08-05 17:15:42 PDT
It would be beneficial to understand the extent of changes required to build webkit with LSB compilers. Is this the only change required ? 

Reference to the Qt bug - https://bugreports.qt-project.org/browse/QTBUG-16336?focusedCommentId=136479&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel.

Reference to LSB - http://www.linuxbase.org/navigator/browse/int_single.php?cmd=list-by-name&Ilibrary=libc&Iname=timegm
Comment 4 Craig Scott 2012-08-07 21:14:36 PDT
There were three LSB-related bugs that I filed around the same time. These arose from building the webkit part within Qt. I do not work on webkit directly as it stands outside of the Qt code base. I've also since changed companies, so I can't commit time to these issues currently.

For reference, the other two LSB-related bugs were bug 51974 and bug 51972. None of the three bugs should require more than the trivial changes mentioned in each bug report.
Comment 5 Craig Scott 2012-08-07 21:18:43 PDT
FWIW, if you want to know what breaks when building webkit with LSB compilers, just download the LSB SDK and use the lsbcc and lsbc++ compilers instead of gcc and g++ respectively. The compilers will soon tell you if something breaks. ;)