Bug 27885 - Add QNX as supported platform
Summary: Add QNX as supported platform
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-31 09:22 PDT by Harald Fernengel
Modified: 2009-08-14 07:44 PDT (History)
1 user (show)

See Also:


Attachments
Patch making WebKitCore and JavaScriptCore compile on QNX (4.39 KB, patch)
2009-07-31 09:22 PDT, Harald Fernengel
eric: review-
Details | Formatted Diff | Diff
Updated version of the QNX patch (4.49 KB, patch)
2009-08-10 04:42 PDT, Harald Fernengel
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Fernengel 2009-07-31 09:22:28 PDT
Created attachment 33880 [details]
Patch making WebKitCore and JavaScriptCore compile on QNX

Attached patch adds WTF_PLATFORM_QNX and a few minor fixes to make WebKitCore and JavaScriptCore compile on QNX 6.4.

Tested only with Qt, see http://www.youtube.com/watch?v=U05iuHL2b9M&fmt=22 for proof :)
Comment 1 Simon Hausmann 2009-08-04 08:13:37 PDT
Comment on attachment 33880 [details]
Patch making WebKitCore and JavaScriptCore compile on QNX


The patch looks good to me, but I'm wondering about the hunk below:

> @@ -544,8 +567,9 @@ static inline void* currentThreadStackBa
>  #endif
>          int rc = pthread_attr_getstack(&sattr, &stackBase, &stackSize);
>          (void)rc; // FIXME: Deal with error code somehow? Seems fatal.
> -        ASSERT(stackBase);
>          pthread_attr_destroy(&sattr);
> +#endif
> +        ASSERT(stackBase);
>          stackThread = thread;
>      }
>      return static_cast<char*>(stackBase) + stackSize;

Why did you move the ASSERT? :)
Comment 2 Eric Seidel (no email) 2009-08-06 19:07:59 PDT
Comment on attachment 33880 [details]
Patch making WebKitCore and JavaScriptCore compile on QNX

Can't we use a ThreadingQNX abstraction here to get the stack base instead?
Comment 3 Eric Seidel (no email) 2009-08-07 11:22:31 PDT
Comment on attachment 33880 [details]
Patch making WebKitCore and JavaScriptCore compile on QNX

We have LOG macros for this:
+#ifndef NDEBUG
+            perror("Unable to open /proc/self:");
+#endif

No c-style casts in c++:
+        stackBase = (void*)threadInfo.stkbase;

r-.  Please explain why this shouldn't use (or expand and then use) the Threading abstraction model in Threading*
Comment 4 Harald Fernengel 2009-08-10 04:42:50 PDT
Created attachment 34446 [details]
Updated version of the QNX patch

Thanks for your comments.

I've removed the C-style cast and used LOG_ERROR instead of perror().

Also, the QNX specific part of getting the current thread's stack base is now factored out into currentThreadStackBaseQNX(), making it more readable and removing some #define magic.

QNX offers standard pthreads, so a special Threading* abstraction is not necessary. Collector.cpp already contains #defines for all platforms that use standard pthreads but don't offer pthread_getattr_np() to retrieve the stack base.
Comment 5 Simon Hausmann 2009-08-14 07:32:05 PDT
Comment on attachment 34446 [details]
Updated version of the QNX patch

r=me

> +static inline void *currentThreadStackBaseQNX()

Small coding style buglet here, but I'll fix that when landing.
Comment 6 Simon Hausmann 2009-08-14 07:44:53 PDT
Landed in r47284