• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/webkit/webkit-pthread_getattr_np.patch
Peter KorsgaardPeter Korsgaard committed ec61799c33824 Jun 2011
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
Patch WebKit because pthread_getattr_np is not implemented in uClibc
2
​
3
Define UCLIBC_USE_PROC_SELF_MAPS etc. as a workaround for uClibc. This
4
code was in the qtoipa webkit but appears to have been removed from
5
more recent versions of webkit.
6
​
7
See: http://bugreports.qt.nokia.com/browse/QTBUG-6551
8
Credit for fix: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=545066#545066
9
​
10
Signed-off-by: Paul Jones <paul@pauljones.id.au>
11
​
12
Index: webkit-1.2.3/JavaScriptCore/runtime/Collector.cpp
13
===================================================================
14
--- webkit-1.2.3.orig/JavaScriptCore/runtime/Collector.cpp  2010-07-22 17:16:19.000000000 +0200
15
+++ webkit-1.2.3/JavaScriptCore/runtime/Collector.cpp   2010-07-22 17:25:02.000000000 +0200
16
@@ -75,6 +75,19 @@
17
 #endif
18
 #include <unistd.h>
19
 
20
+#if defined(__UCLIBC__)
21
+// versions of uClibc 0.9.32 and below with linuxthreads.old do not have
22
+// pthread_getattr_np or pthread_attr_getstack.
23
+#if __UCLIBC_MAJOR__ == 0 &&                   \
24
+  (__UCLIBC_MINOR__ < 9 ||                 \
25
+   (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32)) &&    \
26
+   defined(__LINUXTHREADS_OLD__)
27
+#define UCLIBC_USE_PROC_SELF_MAPS 1
28
+#include <stdio_ext.h>
29
+extern int *__libc_stack_end;
30
+#endif
31
+#endif
32
+
33
 #if OS(SOLARIS)
34
 #include <thread.h>
35
 #else
36
@@ -610,6 +622,36 @@
37
     get_thread_info(find_thread(NULL), &threadInfo);
38
     return threadInfo.stack_end;
39
 #elif OS(UNIX)
40
+#ifdef UCLIBC_USE_PROC_SELF_MAPS
41
+    // Read /proc/self/maps and locate the line whose address
42
+    // range contains __libc_stack_end.
43
+    FILE *file = fopen("/proc/self/maps", "r");
44
+    if (!file)
45
+      return 0;
46
+    __fsetlocking(file, FSETLOCKING_BYCALLER);
47
+    char *line = NULL;
48
+    size_t lineLen = 0;
49
+    while (!feof_unlocked(file)) {
50
+      if (getdelim(&line, &lineLen, '\n', file) <= 0)
51
+   break;
52
+      long from;
53
+      long to;
54
+      if (sscanf (line, "%lx-%lx", &from, &to) != 2)
55
+   continue;
56
+      if (from <= (long)__libc_stack_end && (long)__libc_stack_end < to) {
57
+   fclose(file);
58
+   free(line);
59
+#ifdef _STACK_GROWS_UP
60
+   return (void *)from;
61
+#else
62
+   return (void *)to;
63
+#endif
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.