summaryrefslogtreecommitdiff
path: root/toolchain/glibc/patches/glibc-cross.patch
blob: a1903179db65e3f532551c96a240ec143eeee516 (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
diff -Nur glibc-2.19.orig/sunrpc/rpc/types.h glibc-2.19/sunrpc/rpc/types.h
--- glibc-2.19.orig/sunrpc/rpc/types.h	2014-02-07 10:04:38.000000000 +0100
+++ glibc-2.19/sunrpc/rpc/types.h	2014-03-03 13:42:42.000000000 +0100
@@ -74,19 +74,24 @@
 # define __daddr_t_defined
 #endif
 
-#ifndef __u_char_defined
-typedef __u_char u_char;
-typedef __u_short u_short;
-typedef __u_int u_int;
-typedef __u_long u_long;
-typedef __quad_t quad_t;
-typedef __u_quad_t u_quad_t;
-typedef __fsid_t fsid_t;
-# define __u_char_defined
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#if __WORDSIZE == 64 
+#ifndef __APPLE__
+typedef long int quad_t;
+typedef unsigned long int u_quad_t;
+#endif
+#elif defined __GLIBC_HAVE_LONG_LONG
+typedef long long int quad_t;
+typedef unsigned long long int u_quad_t;
 #endif
-#ifndef __daddr_t_defined
-typedef __daddr_t daddr_t;
-typedef __caddr_t caddr_t;
+
+# define __u_char_defined
+#if !defined(__daddr_t_defined) && defined(linux)
+typedef long int daddr_t;
+typedef char *caddr_t;
 # define __daddr_t_defined
 #endif
 
diff -Nur glibc-2.19.orig/sunrpc/rpc_main.c glibc-2.19/sunrpc/rpc_main.c
--- glibc-2.19.orig/sunrpc/rpc_main.c	2014-02-07 10:04:38.000000000 +0100
+++ glibc-2.19/sunrpc/rpc_main.c	2014-03-04 07:12:00.000000000 +0100
@@ -38,7 +38,11 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#ifdef __APPLE__
+#define gettext(X) (X)
+#else
 #include <libintl.h>
+#endif
 #include <locale.h>
 #include <ctype.h>
 #include <sys/types.h>
@@ -958,10 +962,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 glibc-2.19.orig/sunrpc/rpc_scan.c glibc-2.19/sunrpc/rpc_scan.c
--- glibc-2.19.orig/sunrpc/rpc_scan.c	2014-02-07 10:04:38.000000000 +0100
+++ glibc-2.19/sunrpc/rpc_scan.c	2014-03-04 07:11:29.000000000 +0100
@@ -37,7 +37,11 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#ifdef __APPLE__
+#define gettext(X) (X)
+#else
 #include <libintl.h>
+#endif
 #include "rpc_scan.h"
 #include "rpc_parse.h"
 #include "rpc_util.h"