summaryrefslogtreecommitdiff
path: root/toolchain/eglibc/patches/eglibc-cross.patch
blob: 6a7fb9e512ecc4a804b8fae3ca3efc94ee4ad2bf (plain)
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
* NOTE: This will still use a hardcoded “gcc” instead of HOSTCC

diff -Nur eglibc-2.12.orig/libc/sunrpc/proto.h eglibc-2.12/libc/sunrpc/proto.h
--- eglibc-2.12.orig/libc/sunrpc/proto.h	2010-09-28 19:14:26.000000000 +0200
+++ eglibc-2.12/libc/sunrpc/proto.h	2010-09-29 14:05:15.000000000 +0200
@@ -58,7 +58,9 @@
 
 /* Rather then defining _GNU_SOURCE before including $build's <string.h>
    we just declare stpcpy here.  */
+#if !defined(__APPLE__)
 extern char *stpcpy (char *, const char *);
+#endif
 
 /* Use $build's i18n support as we can't use $host's.  */
 #define _(X) (gettext (X))
diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc/types.h eglibc-2.12/libc/sunrpc/rpc/types.h
--- eglibc-2.12.orig/libc/sunrpc/rpc/types.h	2010-09-28 19:14:26.000000000 +0200
+++ eglibc-2.12/libc/sunrpc/rpc/types.h	2010-09-29 12:45:55.000000000 +0200
@@ -68,6 +68,7 @@
 #include <sys/types.h>
 #endif
 
+#if !defined(_CROSS_RPCGEN_) || !defined(__APPLE__)
 #ifndef __u_char_defined
 typedef __u_char u_char;
 typedef __u_short u_short;
@@ -83,6 +84,7 @@
 typedef __caddr_t caddr_t;
 # define __daddr_t_defined
 #endif
+#endif 
 
 #include <sys/time.h>
 #include <sys/param.h>
diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc_clntout.c eglibc-2.12/libc/sunrpc/rpc_clntout.c
--- eglibc-2.12.orig/libc/sunrpc/rpc_clntout.c	2010-09-28 19:14:27.000000000 +0200
+++ eglibc-2.12/libc/sunrpc/rpc_clntout.c	2010-09-29 12:45:11.000000000 +0200
@@ -31,7 +31,7 @@
  */
 #include <stdio.h>
 #include <string.h>
-#include <rpc/types.h>
+#include "rpc/types.h"
 #include "rpc_parse.h"
 #include "rpc_util.h"
 #include "proto.h"
diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc_main.c eglibc-2.12/libc/sunrpc/rpc_main.c
--- eglibc-2.12.orig/libc/sunrpc/rpc_main.c	2010-09-28 19:14:27.000000000 +0200
+++ eglibc-2.12/libc/sunrpc/rpc_main.c	2010-09-29 12:45:11.000000000 +0200
@@ -37,7 +37,11 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#ifdef _CROSS_RPCGEN_
+#define gettext(X) (X)
+#else
 #include <libintl.h>
+#endif
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/param.h>
@@ -996,10 +1000,12 @@
 	abort ();
       temp = rindex (cmd->infile, '.');
       cp = stpcpy (mkfilename, "Makefile.");
-      if (temp != NULL)
-	*((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
-      else
+      if (temp != NULL) {
+	strncpy (cp, cmd->infile, temp - cmd->infile);
+	cp[temp - cmd->infile - 1] = '\0';
+      } else {
 	stpcpy (cp, cmd->infile);
+      }
 
     }
   else
diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc_scan.c eglibc-2.12/libc/sunrpc/rpc_scan.c
--- eglibc-2.12.orig/libc/sunrpc/rpc_scan.c	2010-09-28 19:14:27.000000000 +0200
+++ eglibc-2.12/libc/sunrpc/rpc_scan.c	2010-09-29 12:45:11.000000000 +0200
@@ -36,7 +36,11 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#ifdef _CROSS_RPCGEN_
+#define gettext(X) (X)
+#else
 #include <libintl.h>
+#endif
 #include "rpc_scan.h"
 #include "rpc_parse.h"
 #include "rpc_util.h"
diff -Nur eglibc-2.12.orig/libc/timezone/Makefile eglibc-2.12/libc/timezone/Makefile
--- eglibc-2.12.orig/libc/timezone/Makefile	2010-09-28 19:13:39.000000000 +0200
+++ eglibc-2.12/libc/timezone/Makefile	2010-09-29 12:45:11.000000000 +0200
@@ -181,8 +181,9 @@
 $(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
 
 $(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
-	gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
-		-DCROSS_ZIC $(compile-mkdep-flags)
+	gcc $< -c $(OUTPUT_OPTION) \
+		$(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) \
+		$(CPPFLAGS-$*) -DCROSS_ZIC $(compile-mkdep-flags)
 
 $(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
 	gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@