File: hurd.patch

package info (click to toggle)
pike7.8 7.8.866-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 69,304 kB
  • ctags: 28,082
  • sloc: ansic: 252,877; xml: 36,537; makefile: 4,214; sh: 2,879; lisp: 655; asm: 591; objc: 212; pascal: 157; sed: 34
file content (113 lines) | stat: -rw-r--r-- 4,377 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Description: Fixes to make Pike build on GNU/Hurd
 1. Let realpath() allocate memory itself.
 2. Include mach/message.h directly where mach_msg_type_number_t is used.
 3. Don't build shared objects any differently than on Linux.
Forwarded: yes

--- a/src/modules/system/system.c
+++ b/src/modules/system/system.c
@@ -411,6 +411,13 @@ void f_resolvepath(INT32 args)
 #endif /* ENAMETOOLONG */
 	  (len >= buflen - 1));
 #elif defined(HAVE_REALPATH)
+#ifdef __GNU__
+  if ((buf = realpath(path, NULL))) {
+    len = strlen(buf);
+  } else if (errno == ENOMEM) {
+    Pike_error("resolvepath(): Out of memory\n");
+  }
+#else
   buflen = PATH_MAX+1;
 
   if (!(buf = alloca(buflen))) {
@@ -420,6 +427,7 @@ void f_resolvepath(INT32 args)
   if ((buf = realpath(path, buf))) {
     len = strlen(buf);
   }
+#endif
 #else /* !HAVE_RESOLVEPATH && !HAVE_REALPATH */
 #error "f_resolvepath with neither resolvepath nor realpath."
 #endif /* HAVE_RESOLVEPATH */
@@ -429,6 +437,9 @@ void f_resolvepath(INT32 args)
   }
   pop_n_elems(args);
   push_string(make_shared_binary_string(buf, len));
+#ifdef __GNU__
+  free(buf);
+#endif
 }
 #endif /* HAVE_RESOLVEPATH || HAVE_REALPATH */
 
--- a/src/pike_threadlib.h
+++ b/src/pike_threadlib.h
@@ -94,6 +94,9 @@ PMOD_EXPORT extern struct program *threa
 #ifdef HAVE_MACH_TASK_INFO_H
 #include <mach/task_info.h>
 #endif
+#ifdef HAVE_MACH_MESSAGE_H
+#include <mach/message.h>
+#endif
 #ifdef HAVE_MACH_TASK_H
 #include <mach/task.h>
 #endif
--- a/src/configure.in
+++ b/src/configure.in
@@ -3308,7 +3308,7 @@ AC_CHECK_HEADERS(winsock2.h sys/rusage.h
 		 float.h sys/priocntl.h sys/sched.h winbase.h errno.h \
 		 stddef.h mmx.h asm/mmx.h sys/termio.h sys/termios.h \
 		 ws2tcpip.h valgrind/memcheck.h memcheck.h valgrind.h \
-		 sys/prctl.h sys/ioctl.h mach/task_info.h mach/task.h \
+		 sys/prctl.h sys/ioctl.h mach/message.h mach/task_info.h mach/task.h \
 		 mach/mach_init.h syscall.h sys/syscall.h devices/timer.h \
 		 direct.h CoreServices/CoreServices.h execinfo.h \
 		 mach/mach.h mach/thread_act.h mach/clock.h,,,[
@@ -7933,7 +7933,7 @@ if test -z "$LDSHARED" ; then
     next*) LDSHARED="$REALCC $CFLAGS -nostdlib -r";;
     Linux*) LDSHARED="$REALCC -shared";;
     GNU/kFreeBSD*) LDSHARED="$REALCC -shared";;
-    GNU*) LDSHARED="$REALCC -Wl,-Bshareable";;
+    GNU*) LDSHARED="$REALCC -shared";;
     FreeBSD*) LDSHARED="$REALCC -Wl,-Bshareable";;
     NetBSD*) LDSHARED="$REALCC -Wl,-Bshareable";;
     OpenBSD*) LDSHARED="$REALCC -Wl,-Bshareable";;
--- a/src/configure
+++ b/src/configure
@@ -79597,7 +79597,7 @@ for ac_header in winsock2.h sys/rusage.h
 		 float.h sys/priocntl.h sys/sched.h winbase.h errno.h \
 		 stddef.h mmx.h asm/mmx.h sys/termio.h sys/termios.h \
 		 ws2tcpip.h valgrind/memcheck.h memcheck.h valgrind.h \
-		 sys/prctl.h sys/ioctl.h mach/task_info.h mach/task.h \
+		 sys/prctl.h sys/ioctl.h mach/message.h mach/task_info.h mach/task.h \
 		 mach/mach_init.h syscall.h sys/syscall.h devices/timer.h \
 		 direct.h CoreServices/CoreServices.h execinfo.h \
 		 mach/mach.h mach/thread_act.h mach/clock.h
@@ -79746,7 +79746,7 @@ done
 		 float.h sys/priocntl.h sys/sched.h winbase.h errno.h \
 		 stddef.h mmx.h asm/mmx.h sys/termio.h sys/termios.h \
 		 ws2tcpip.h valgrind/memcheck.h memcheck.h valgrind.h \
-		 sys/prctl.h sys/ioctl.h mach/task_info.h mach/task.h \
+		 sys/prctl.h sys/ioctl.h mach/message.h mach/task_info.h mach/task.h \
 		 mach/mach_init.h syscall.h sys/syscall.h devices/timer.h \
 		 direct.h CoreServices/CoreServices.h execinfo.h \
 		 mach/mach.h mach/thread_act.h mach/clock.h
@@ -104594,7 +104594,7 @@ if test -z "$LDSHARED" ; then
     next*) LDSHARED="$REALCC $CFLAGS -nostdlib -r";;
     Linux*) LDSHARED="$REALCC -shared";;
     GNU/kFreeBSD*) LDSHARED="$REALCC -shared";;
-    GNU*) LDSHARED="$REALCC -Wl,-Bshareable";;
+    GNU*) LDSHARED="$REALCC -shared";;
     FreeBSD*) LDSHARED="$REALCC -Wl,-Bshareable";;
     NetBSD*) LDSHARED="$REALCC -Wl,-Bshareable";;
     OpenBSD*) LDSHARED="$REALCC -Wl,-Bshareable";;
--- a/src/machine.h.in
+++ b/src/machine.h.in
@@ -875,6 +875,9 @@
 /* Define to 1 if you have the <mach/mach_init.h> header file. */
 #undef HAVE_MACH_MACH_INIT_H
 
+/* Define to 1 if you have the <mach/message.h> header file. */
+#undef HAVE_MACH_MESSAGE_H
+
 /* Define to 1 if you have the <mach-o/dyld.h> header file. */
 #undef HAVE_MACH_O_DYLD_H