>Number: 39268
>Category: pkg
>Synopsis: x11/qt4-libs fails to compile at least in DragonFly and OpenBSD
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 01 19:30:00 +0000 2008
>Originator: Hasso Tepper
>Release: DragonFly
>Organization:
>Environment:
DragonFly
>Description:
/usr/include/pthread_np.h:41: error: typedef 'pthread_switch_routine_t' is
initialized (use __typeof__ instead)
/usr/include/pthread_np.h:41: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:41: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:47: error: 'pthread_attr_t' was not declared in this
scope
/usr/include/pthread_np.h:47: error: expected primary-expression before ')'
token
/usr/include/pthread_np.h:48: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:48: error: 'pthread_attr_t' was not declared in this
scope
/usr/include/pthread_np.h:48: error: expected primary-expression before ')'
token
/usr/include/pthread_np.h:48: error: initializer expression list treated as
compound expression
/usr/include/pthread_np.h:51: error: 'pthread_mutexattr_t' was not declared in
this scope
/usr/include/pthread_np.h:52: error: 'pthread_mutexattr_t' was not declared in
this scope
/usr/include/pthread_np.h:52: error: expected primary-expression before ','
token
/usr/include/pthread_np.h:52: error: expected primary-expression before 'int'
/usr/include/pthread_np.h:52: error: initializer expression list treated as
compound expression
/usr/include/pthread_np.h:54: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:55: error: variable or field 'pthread_set_name_np'
declared void
/usr/include/pthread_np.h:55: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:55: error: expected primary-expression before 'const'
/usr/include/pthread_np.h:55: error: initializer expression list treated as
compound expression
/usr/include/pthread_np.h:58: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:59: error: 'pthread_switch_routine_t' was not
declared in this scope
/usr/include/pthread_np.h:60: error: 'pthread_switch_routine_t' was not
declared in this scope
/usr/include/pthread_np.h:61: error: 'pthread_t' was not declared in this scope
/usr/include/pthread_np.h:61: error: expected primary-expression before 'void'
/usr/include/pthread_np.h:61: error: expected primary-expression before 'const'
/usr/include/pthread_np.h:61: error: initializer expression list treated as
compound expression
../JavaScriptCore/kjs/collector.cpp: In function 'void*
KJS::currentThreadStackBase()':
../JavaScriptCore/kjs/collector.cpp:345: error: 'pthread_t' does not name a type
../JavaScriptCore/kjs/collector.cpp:346: error: 'pthread_t' was not declared in
this scope
../JavaScriptCore/kjs/collector.cpp:346: error: expected `;' before 'thread'
../JavaScriptCore/kjs/collector.cpp:347: error: 'thread' was not declared in
this scope
../JavaScriptCore/kjs/collector.cpp:347: error: 'stackThread' was not declared
in this scope
../JavaScriptCore/kjs/collector.cpp:348: error: 'pthread_attr_t' was not
declared in this scope
../JavaScriptCore/kjs/collector.cpp:348: error: expected `;' before 'sattr'
../JavaScriptCore/kjs/collector.cpp:349: error: 'sattr' was not declared in
this scope
../JavaScriptCore/kjs/collector.cpp:349: error: 'pthread_attr_init' was not
declared in this scope
../JavaScriptCore/kjs/collector.cpp:352: error: 'pthread_attr_get_np' cannot be
used as a function
../JavaScriptCore/kjs/collector.cpp:357: error: 'pthread_attr_getstack' was not
declared in this scope
../JavaScriptCore/kjs/collector.cpp:360: error: 'pthread_attr_destroy' was not
declared in this scope
gmake[1]: *** [.obj/release-shared/collector.lo] Error 1
>How-To-Repeat:
The problem is that at least in DragonFly and OpenBSD you can't include just
pthread_np.h alone. You have to include pthread.h before that as well.
I reported it to Trolls long time ago (in 4.4 beta phase) and it was closed to
be a duplicate of the
http://trolltech.com/developer/task-tracker/index_html?method=entry&id=205961
which is scheduled to be fixed in next (4.5.0) release.
>Fix:
I've used following trivial patch here and it certainly fixes the issue in
DragonFly and OpenBSD, but I'm not sure whether it has a chance to break some
(I don't know any such) platform.
--- src/3rdparty/webkit/JavaScriptCore/kjs/collector.cpp.orig
+++ src/3rdparty/webkit/JavaScriptCore/kjs/collector.cpp
@@ -73,6 +73,7 @@ extern int *__libc_stack_end;
#endif
#if HAVE(PTHREAD_NP_H)
+#include <pthread.h>
#include <pthread_np.h>
#else
#include <pthread.h>