glibc-cross.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. diff -Nur glibc-2.18.orig/sunrpc/rpc/types.h glibc-2.18/sunrpc/rpc/types.h
  2. --- glibc-2.18.orig/sunrpc/rpc/types.h 2013-08-11 00:52:55.000000000 +0200
  3. +++ glibc-2.18/sunrpc/rpc/types.h 2013-09-13 08:25:18.000000000 +0200
  4. @@ -69,19 +69,25 @@
  5. #include <sys/types.h>
  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. +typedef long int quad_t;
  22. +typedef unsigned long int u_quad_t;
  23. +#elif defined __GLIBC_HAVE_LONG_LONG
  24. +typedef long long int quad_t;
  25. +typedef unsigned long long int u_quad_t;
  26. +#endif
  27. +#if defined(_CROSS_RPCGEN_)
  28. +typedef u_quad_t fsid_t;
  29. #endif
  30. -#ifndef __daddr_t_defined
  31. -typedef __daddr_t daddr_t;
  32. -typedef __caddr_t caddr_t;
  33. +
  34. +# define __u_char_defined
  35. +#if !defined(__daddr_t_defined) && defined(linux)
  36. +typedef long int daddr_t;
  37. +typedef char *caddr_t;
  38. # define __daddr_t_defined
  39. #endif
  40. diff -Nur glibc-2.18.orig/sunrpc/rpc_main.c glibc-2.18/sunrpc/rpc_main.c
  41. --- glibc-2.18.orig/sunrpc/rpc_main.c 2013-08-11 00:52:55.000000000 +0200
  42. +++ glibc-2.18/sunrpc/rpc_main.c 2013-09-13 08:26:07.000000000 +0200
  43. @@ -38,7 +38,11 @@
  44. #include <stdio.h>
  45. #include <string.h>
  46. #include <unistd.h>
  47. +#ifdef _CROSS_RPCGEN_
  48. +#define gettext(X) (X)
  49. +#else
  50. #include <libintl.h>
  51. +#endif
  52. #include <locale.h>
  53. #include <ctype.h>
  54. #include <sys/types.h>
  55. @@ -958,10 +962,12 @@
  56. abort ();
  57. temp = rindex (cmd->infile, '.');
  58. cp = stpcpy (mkfilename, "Makefile.");
  59. - if (temp != NULL)
  60. - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
  61. - else
  62. + if (temp != NULL) {
  63. + strncpy (cp, cmd->infile, temp - cmd->infile);
  64. + cp[temp - cmd->infile - 1] = '\0';
  65. + } else {
  66. stpcpy (cp, cmd->infile);
  67. + }
  68. }
  69. else
  70. diff -Nur glibc-2.18.orig/sunrpc/rpc_scan.c glibc-2.18/sunrpc/rpc_scan.c
  71. --- glibc-2.18.orig/sunrpc/rpc_scan.c 2013-08-11 00:52:55.000000000 +0200
  72. +++ glibc-2.18/sunrpc/rpc_scan.c 2013-09-13 08:25:18.000000000 +0200
  73. @@ -37,7 +37,11 @@
  74. #include <stdio.h>
  75. #include <ctype.h>
  76. #include <string.h>
  77. +#ifdef _CROSS_RPCGEN_
  78. +#define gettext(X) (X)
  79. +#else
  80. #include <libintl.h>
  81. +#endif
  82. #include "rpc_scan.h"
  83. #include "rpc_parse.h"
  84. #include "rpc_util.h"