1
0

eglibc-cross.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. diff -Nur eglibc-2.12.orig/libc/sunrpc/proto.h eglibc-2.12/libc/sunrpc/proto.h
  2. --- eglibc-2.12.orig/libc/sunrpc/proto.h 2010-09-28 19:14:26.000000000 +0200
  3. +++ eglibc-2.12/libc/sunrpc/proto.h 2010-09-29 14:05:15.000000000 +0200
  4. @@ -58,7 +58,9 @@
  5. /* Rather then defining _GNU_SOURCE before including $build's <string.h>
  6. we just declare stpcpy here. */
  7. +#if !defined(__APPLE__)
  8. extern char *stpcpy (char *, const char *);
  9. +#endif
  10. /* Use $build's i18n support as we can't use $host's. */
  11. #define _(X) (gettext (X))
  12. diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc/types.h eglibc-2.12/libc/sunrpc/rpc/types.h
  13. --- eglibc-2.12.orig/libc/sunrpc/rpc/types.h 2010-09-28 19:14:26.000000000 +0200
  14. +++ eglibc-2.12/libc/sunrpc/rpc/types.h 2010-09-29 12:45:55.000000000 +0200
  15. @@ -68,6 +68,7 @@
  16. #include <sys/types.h>
  17. #endif
  18. +#if !defined(_CROSS_RPCGEN_) || !defined(__APPLE__)
  19. #ifndef __u_char_defined
  20. typedef __u_char u_char;
  21. typedef __u_short u_short;
  22. @@ -83,6 +84,7 @@
  23. typedef __caddr_t caddr_t;
  24. # define __daddr_t_defined
  25. #endif
  26. +#endif
  27. #include <sys/time.h>
  28. #include <sys/param.h>
  29. diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc_clntout.c eglibc-2.12/libc/sunrpc/rpc_clntout.c
  30. --- eglibc-2.12.orig/libc/sunrpc/rpc_clntout.c 2010-09-28 19:14:27.000000000 +0200
  31. +++ eglibc-2.12/libc/sunrpc/rpc_clntout.c 2010-09-29 12:45:11.000000000 +0200
  32. @@ -31,7 +31,7 @@
  33. */
  34. #include <stdio.h>
  35. #include <string.h>
  36. -#include <rpc/types.h>
  37. +#include "rpc/types.h"
  38. #include "rpc_parse.h"
  39. #include "rpc_util.h"
  40. #include "proto.h"
  41. diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc_main.c eglibc-2.12/libc/sunrpc/rpc_main.c
  42. --- eglibc-2.12.orig/libc/sunrpc/rpc_main.c 2010-09-28 19:14:27.000000000 +0200
  43. +++ eglibc-2.12/libc/sunrpc/rpc_main.c 2010-09-29 12:45:11.000000000 +0200
  44. @@ -37,7 +37,11 @@
  45. #include <stdio.h>
  46. #include <string.h>
  47. #include <unistd.h>
  48. +#ifdef _CROSS_RPCGEN_
  49. +#define gettext(X) (X)
  50. +#else
  51. #include <libintl.h>
  52. +#endif
  53. #include <ctype.h>
  54. #include <sys/types.h>
  55. #include <sys/param.h>
  56. @@ -996,10 +1000,12 @@
  57. abort ();
  58. temp = rindex (cmd->infile, '.');
  59. cp = stpcpy (mkfilename, "Makefile.");
  60. - if (temp != NULL)
  61. - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
  62. - else
  63. + if (temp != NULL) {
  64. + strncpy (cp, cmd->infile, temp - cmd->infile);
  65. + cp[temp - cmd->infile - 1] = '\0';
  66. + } else {
  67. stpcpy (cp, cmd->infile);
  68. + }
  69. }
  70. else
  71. diff -Nur eglibc-2.12.orig/libc/sunrpc/rpc_scan.c eglibc-2.12/libc/sunrpc/rpc_scan.c
  72. --- eglibc-2.12.orig/libc/sunrpc/rpc_scan.c 2010-09-28 19:14:27.000000000 +0200
  73. +++ eglibc-2.12/libc/sunrpc/rpc_scan.c 2010-09-29 12:45:11.000000000 +0200
  74. @@ -36,7 +36,11 @@
  75. #include <stdio.h>
  76. #include <ctype.h>
  77. #include <string.h>
  78. +#ifdef _CROSS_RPCGEN_
  79. +#define gettext(X) (X)
  80. +#else
  81. #include <libintl.h>
  82. +#endif
  83. #include "rpc_scan.h"
  84. #include "rpc_parse.h"
  85. #include "rpc_util.h"
  86. diff -Nur eglibc-2.12.orig/libc/timezone/Makefile eglibc-2.12/libc/timezone/Makefile
  87. --- eglibc-2.12.orig/libc/timezone/Makefile 2010-09-28 19:13:39.000000000 +0200
  88. +++ eglibc-2.12/libc/timezone/Makefile 2010-09-29 12:45:11.000000000 +0200
  89. @@ -181,8 +181,9 @@
  90. $(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
  91. $(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
  92. - gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
  93. - -DCROSS_ZIC $(compile-mkdep-flags)
  94. + gcc $< -c $(OUTPUT_OPTION) \
  95. + $(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) \
  96. + $(CPPFLAGS-$*) -DCROSS_ZIC $(compile-mkdep-flags)
  97. $(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
  98. gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@