glibc-cross.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. diff -Nur glibc-2.16.0.orig/sunrpc/rpc/types.h glibc-2.16.0/sunrpc/rpc/types.h
  2. --- glibc-2.16.0.orig/sunrpc/rpc/types.h 2012-06-30 21:12:34.000000000 +0200
  3. +++ glibc-2.16.0/sunrpc/rpc/types.h 2012-08-01 18:05:49.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.16.0.orig/sunrpc/rpc_clntout.c glibc-2.16.0/sunrpc/rpc_clntout.c
  41. --- glibc-2.16.0.orig/sunrpc/rpc_clntout.c 2012-06-30 21:12:34.000000000 +0200
  42. +++ glibc-2.16.0/sunrpc/rpc_clntout.c 2012-08-01 18:05:49.000000000 +0200
  43. @@ -31,7 +31,7 @@
  44. */
  45. #include <stdio.h>
  46. #include <string.h>
  47. -#include <rpc/types.h>
  48. +#include "rpc/types.h"
  49. #include "rpc_parse.h"
  50. #include "rpc_util.h"
  51. #include "proto.h"
  52. diff -Nur glibc-2.16.0.orig/sunrpc/rpc_main.c glibc-2.16.0/sunrpc/rpc_main.c
  53. --- glibc-2.16.0.orig/sunrpc/rpc_main.c 2012-06-30 21:12:34.000000000 +0200
  54. +++ glibc-2.16.0/sunrpc/rpc_main.c 2012-08-01 18:05:49.000000000 +0200
  55. @@ -38,7 +38,11 @@
  56. #include <stdio.h>
  57. #include <string.h>
  58. #include <unistd.h>
  59. +#ifdef _CROSS_RPCGEN_
  60. +#define gettext(X) (X)
  61. +#else
  62. #include <libintl.h>
  63. +#endif
  64. #include <ctype.h>
  65. #include <sys/types.h>
  66. #include <sys/param.h>
  67. @@ -958,10 +962,12 @@
  68. abort ();
  69. temp = rindex (cmd->infile, '.');
  70. cp = stpcpy (mkfilename, "Makefile.");
  71. - if (temp != NULL)
  72. - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
  73. - else
  74. + if (temp != NULL) {
  75. + strncpy (cp, cmd->infile, temp - cmd->infile);
  76. + cp[temp - cmd->infile - 1] = '\0';
  77. + } else {
  78. stpcpy (cp, cmd->infile);
  79. + }
  80. }
  81. else
  82. diff -Nur glibc-2.16.0.orig/sunrpc/rpc_scan.c glibc-2.16.0/sunrpc/rpc_scan.c
  83. --- glibc-2.16.0.orig/sunrpc/rpc_scan.c 2012-06-30 21:12:34.000000000 +0200
  84. +++ glibc-2.16.0/sunrpc/rpc_scan.c 2012-08-01 18:05:49.000000000 +0200
  85. @@ -37,7 +37,11 @@
  86. #include <stdio.h>
  87. #include <ctype.h>
  88. #include <string.h>
  89. +#ifdef _CROSS_RPCGEN_
  90. +#define gettext(X) (X)
  91. +#else
  92. #include <libintl.h>
  93. +#endif
  94. #include "rpc_scan.h"
  95. #include "rpc_parse.h"
  96. #include "rpc_util.h"