1
0

glibc-cross.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. diff -Nur glibc-2.20.orig/sunrpc/rpc/types.h glibc-2.20/sunrpc/rpc/types.h
  2. --- glibc-2.20.orig/sunrpc/rpc/types.h 2014-09-07 10:09:09.000000000 +0200
  3. +++ glibc-2.20/sunrpc/rpc/types.h 2014-12-26 10:30:51.733297900 +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.20.orig/sunrpc/rpc_main.c glibc-2.20/sunrpc/rpc_main.c
  40. --- glibc-2.20.orig/sunrpc/rpc_main.c 2014-09-07 10:09:09.000000000 +0200
  41. +++ glibc-2.20/sunrpc/rpc_main.c 2014-12-26 11:23:56.822092200 +0100
  42. @@ -38,7 +38,11 @@
  43. #include <stdio.h>
  44. #include <string.h>
  45. #include <unistd.h>
  46. +#if defined(__APPLE__) || defined(__CYGWIN__)
  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. @@ -51,6 +55,10 @@
  55. #include "rpc_scan.h"
  56. #include "proto.h"
  57. +#ifdef __CYGWIN__
  58. +#define stat64 stat
  59. +#endif
  60. +
  61. #include "../version.h"
  62. #define PACKAGE _libc_intl_domainname
  63. @@ -958,10 +966,12 @@
  64. abort ();
  65. temp = rindex (cmd->infile, '.');
  66. cp = stpcpy (mkfilename, "Makefile.");
  67. - if (temp != NULL)
  68. - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
  69. - else
  70. + if (temp != NULL) {
  71. + strncpy (cp, cmd->infile, temp - cmd->infile);
  72. + cp[temp - cmd->infile - 1] = '\0';
  73. + } else {
  74. stpcpy (cp, cmd->infile);
  75. + }
  76. }
  77. else
  78. diff -Nur glibc-2.20.orig/sunrpc/rpc_scan.c glibc-2.20/sunrpc/rpc_scan.c
  79. --- glibc-2.20.orig/sunrpc/rpc_scan.c 2014-09-07 10:09:09.000000000 +0200
  80. +++ glibc-2.20/sunrpc/rpc_scan.c 2014-12-26 10:30:51.764498000 +0100
  81. @@ -37,7 +37,11 @@
  82. #include <stdio.h>
  83. #include <ctype.h>
  84. #include <string.h>
  85. +#ifdef __APPLE__
  86. +#define gettext(X) (X)
  87. +#else
  88. #include <libintl.h>
  89. +#endif
  90. #include "rpc_scan.h"
  91. #include "rpc_parse.h"
  92. #include "rpc_util.h"