Bug 49479

Summary: [Qt] Building QtWebKit fails on uClibc (0.9.31)
Product: WebKit Reporter: Daniel Nyström <daniel.nystrom>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Enhancement CC: benjamin, ggaren, kamaji, kling, laszlo.gombos, mjs, norbert.leser, webkit.review.bot
Priority: P5 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Bugfix
kling: review-
Same patch but with bug URL and no tabs
none
Fixed code styling complains kling: review-

Description Daniel Nyström 2010-11-12 14:09:06 PST
Building QtWebKit on uClibc (0.9.31) fails like QtScript did in 4.6: http://bugreports.qt.nokia.com/browse/QTBUG-6551

Attaching i patch which adds what fixed the QtScript build.
Comment 1 Daniel Nyström 2010-11-12 14:25:11 PST
Created attachment 73778 [details]
Bugfix
Comment 2 Andreas Kling 2010-11-12 14:39:00 PST
Comment on attachment 73778 [details]
Bugfix

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

> JavaScriptCore/ChangeLog:5
> +	Merged changes from QtScript which fixes missing pthread_getattr_np not available on uClibc causing build error.

Use spaces, not tabs, for indentation.
Please include the Bugzilla URL here.
Comment 3 Andreas Kling 2010-11-12 14:40:09 PST
CC'ing Geoff and Maciej per suggestion from Oliver.
Comment 4 Daniel Nyström 2010-11-12 14:49:42 PST
Created attachment 73780 [details]
Same patch but with bug URL and no tabs
Comment 5 WebKit Review Bot 2010-11-12 14:55:24 PST
Attachment 73780 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'JavaScriptCore/ChangeLog', u'JavaScriptCore/runtime/Collector.cpp']" exit_code: 1
JavaScriptCore/runtime/Collector.cpp:78:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
JavaScriptCore/runtime/Collector.cpp:539:  Declaration has space between type name and * in FILE *file  [whitespace/declaration] [3]
JavaScriptCore/runtime/Collector.cpp:543:  Declaration has space between type name and * in char *line  [whitespace/declaration] [3]
JavaScriptCore/runtime/Collector.cpp:543:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Daniel Nyström 2010-11-12 15:19:45 PST
Created attachment 73782 [details]
Fixed code styling complains
Comment 7 WebKit Review Bot 2010-11-12 15:22:47 PST
Attachment 73782 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'JavaScriptCore/ChangeLog', u'JavaScriptCore/runtime/Collector.cpp']" exit_code: 1
JavaScriptCore/runtime/Collector.cpp:78:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
JavaScriptCore/runtime/Collector.cpp:83:  __libc_stack_end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Andreas Kling 2010-11-12 15:30:27 PST
(In reply to comment #7)
> JavaScriptCore/runtime/Collector.cpp:78:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
> JavaScriptCore/runtime/Collector.cpp:83:  __libc_stack_end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]

You can ignore these complaints IMO.
Comment 9 Andreas Kling 2010-11-17 03:43:49 PST
Comment on attachment 73782 [details]
Fixed code styling complains

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

> JavaScriptCore/ChangeLog:5
> +        Merged changes from QtScript which fixes missing pthread_getattr_np not available on uClibc causing build error.

This is a bit muddy. Suggestion:

==
Fix currentThreadStackBase() compilation against uClibc

uClibc doesn't have pthread_getattr_np or pthread_attr_getstack.
Patch originally from QtScript.
==

> JavaScriptCore/runtime/Collector.cpp:77
> +// versions of uClibc 0.9.31 and below do not have
> +// pthread_getattr_np or pthread_attr_getstack.

This seems a bit strange to me, since 0.9.31 is the latest version (AFAICT from uclibc.org)
Shouldn't we be doing this for *any* uClibc version, not just <= 0.9.31?

> JavaScriptCore/runtime/Collector.cpp:544
> +    size_t lineLen = 0;

We generally don't abbreviate in WebKit, "lineLength" sounds better here.

> JavaScriptCore/runtime/Collector.cpp:551
> +        if (sscanf (line, "%lx-%lx", &from, &to) != 2)

Style, remove space after sscanf.

> JavaScriptCore/runtime/Collector.cpp:557
> +            return (void *)from;

Style, remove space after void.

> JavaScriptCore/runtime/Collector.cpp:559
> +            return (void *)to;

Ditto.
Comment 10 Daniel Nyström 2010-11-23 02:34:56 PST
I think putting this patch on hold until someone can really support it is to prefer right now.

To make QtWebKit build on uClibc, just enable NPTL (only in trunk currently).
Comment 11 Jocelyn Turcotte 2014-02-03 03:16:57 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.