1
0

glibc-cross.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. diff -Nur glibc-2.19.orig/sunrpc/rpc/types.h glibc-2.19/sunrpc/rpc/types.h
  2. --- glibc-2.19.orig/sunrpc/rpc/types.h 2014-02-07 10:04:38.000000000 +0100
  3. +++ glibc-2.19/sunrpc/rpc/types.h 2014-03-03 13:42:42.000000000 +0100
  4. @@ -74,19 +74,24 @@
  5. # define __daddr_t_defined
  6. #endif
  7. -#ifndef __u_char_defined
  8. -typedef __u_char u_char;
  9. -typedef __u_short u_short;
  10. -typedef __u_int u_int;
  11. -typedef __u_long u_long;
  12. -typedef __quad_t quad_t;
  13. -typedef __u_quad_t u_quad_t;
  14. -typedef __fsid_t fsid_t;
  15. -# define __u_char_defined
  16. +typedef unsigned char u_char;
  17. +typedef unsigned short u_short;
  18. +typedef unsigned int u_int;
  19. +typedef unsigned long u_long;
  20. +#if __WORDSIZE == 64
  21. +#ifndef __APPLE__
  22. +typedef long int quad_t;
  23. +typedef unsigned long int u_quad_t;
  24. +#endif
  25. +#elif defined __GLIBC_HAVE_LONG_LONG
  26. +typedef long long int quad_t;
  27. +typedef unsigned long long int u_quad_t;
  28. #endif
  29. -#ifndef __daddr_t_defined
  30. -typedef __daddr_t daddr_t;
  31. -typedef __caddr_t caddr_t;
  32. +
  33. +# define __u_char_defined
  34. +#if !defined(__daddr_t_defined) && defined(linux)
  35. +typedef long int daddr_t;
  36. +typedef char *caddr_t;
  37. # define __daddr_t_defined
  38. #endif
  39. diff -Nur glibc-2.19.orig/sunrpc/rpc_main.c glibc-2.19/sunrpc/rpc_main.c
  40. --- glibc-2.19.orig/sunrpc/rpc_main.c 2014-02-07 10:04:38.000000000 +0100
  41. +++ glibc-2.19/sunrpc/rpc_main.c 2014-03-04 07:12:00.000000000 +0100
  42. @@ -38,7 +38,11 @@
  43. #include <stdio.h>
  44. #include <string.h>
  45. #include <unistd.h>
  46. +#ifdef __APPLE__
  47. +#define gettext(X) (X)
  48. +#else
  49. #include <libintl.h>
  50. +#endif
  51. #include <locale.h>
  52. #include <ctype.h>
  53. #include <sys/types.h>
  54. @@ -958,10 +962,12 @@
  55. abort ();
  56. temp = rindex (cmd->infile, '.');
  57. cp = stpcpy (mkfilename, "Makefile.");
  58. - if (temp != NULL)
  59. - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
  60. - else
  61. + if (temp != NULL) {
  62. + strncpy (cp, cmd->infile, temp - cmd->infile);
  63. + cp[temp - cmd->infile - 1] = '\0';
  64. + } else {
  65. stpcpy (cp, cmd->infile);
  66. + }
  67. }
  68. else
  69. diff -Nur glibc-2.19.orig/sunrpc/rpc_scan.c glibc-2.19/sunrpc/rpc_scan.c
  70. --- glibc-2.19.orig/sunrpc/rpc_scan.c 2014-02-07 10:04:38.000000000 +0100
  71. +++ glibc-2.19/sunrpc/rpc_scan.c 2014-03-04 07:11:29.000000000 +0100
  72. @@ -37,7 +37,11 @@
  73. #include <stdio.h>
  74. #include <ctype.h>
  75. #include <string.h>
  76. +#ifdef __APPLE__
  77. +#define gettext(X) (X)
  78. +#else
  79. #include <libintl.h>
  80. +#endif
  81. #include "rpc_scan.h"
  82. #include "rpc_parse.h"
  83. #include "rpc_util.h"