1
0

eglibc-cross.patch 3.6 KB

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