Source: webkit
Version: 1.6.1-5
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

currently[1], webkit fails to build on GNU/Hurd.

The problem is due to the missing PTHREAD_KEYS_MAX definition (which is
optional in POSIX, though).
The attached patch does two things:
- Source/JavaScriptCore/wtf/Platform.h
  defines WTF_OS_HURD in hopefully a suitable way for upstream;
  it would be nice if you could send it upstream (so I don't need to
  patch also the various webkit copies for it).
- Source/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.cpp
  adds a band-aid fix fix for the lack of PTHREAD_KEYS_MAX definition,
  with a value which should not cause issues;
  this part should not go upstream but stay locally in Debian for now,
  as it will need either a better fix in webkit or a fix in
  glibc/libpthread for Hurd.

[1] 
https://buildd.debian.org/status/fetch.php?pkg=webkit&arch=hurd-i386&ver=1.6.1-5&stamp=1320390923

Thanks,
-- 
Pino
--- a/Source/JavaScriptCore/wtf/Platform.h
+++ b/Source/JavaScriptCore/wtf/Platform.h
@@ -352,6 +352,11 @@
 #define WTF_OS_HAIKU 1
 #endif
 
+/* OS(HURD) - GNU/Hurd */
+#ifdef __GNU__
+#define WTF_OS_HURD 1
+#endif
+
 /* OS(LINUX) - Linux */
 #ifdef __linux__
 #define WTF_OS_LINUX 1
@@ -398,6 +403,7 @@
     || OS(DARWIN)           \
     || OS(FREEBSD)          \
     || OS(HAIKU)            \
+    || OS(HURD)             \
     || OS(LINUX)            \
     || OS(NETBSD)           \
     || OS(OPENBSD)          \
--- a/Source/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.cpp
+++ b/Source/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.cpp
@@ -41,6 +41,9 @@
 #define PTHREAD_KEYS_MAX 1024
 #else
 #include <limits.h>
+#if OS(HURD)
+#define PTHREAD_KEYS_MAX INT_MAX
+#endif
 #endif
 
 namespace WTF {

Reply via email to