endianess-header.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Upstream-Status: Inappropriate [fix poky patch]
  2. This patch fixes build issues with a previous endian-ness_handling.patch on
  3. distros that don't have macros referenced
  4. 7/20/2011
  5. Matthew McClintock <msm@freescale.com>
  6. diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
  7. --- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600
  8. +++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500
  9. @@ -0,0 +1,64 @@
  10. +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
  11. + This file is part of the GNU C Library.
  12. +
  13. + The GNU C Library is free software; you can redistribute it and/or
  14. + modify it under the terms of the GNU Lesser General Public
  15. + License as published by the Free Software Foundation; either
  16. + version 2.1 of the License, or (at your option) any later version.
  17. +
  18. + The GNU C Library is distributed in the hope that it will be useful,
  19. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. + Lesser General Public License for more details.
  22. +
  23. + You should have received a copy of the GNU Lesser General Public
  24. + License along with the GNU C Library; if not, write to the Free
  25. + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  26. + 02111-1307 USA. */
  27. +
  28. +#include <endian.h>
  29. +
  30. +#ifndef _ENDIAN_EXTRA_H
  31. +#define _ENDIAN_EXTRA_H 1
  32. +
  33. +/* Don't redefine these macros if they already exist */
  34. +#ifndef htobe16
  35. +#ifdef __USE_BSD
  36. +/* Conversion interfaces. */
  37. +# include <byteswap.h>
  38. +
  39. +# if __BYTE_ORDER == __LITTLE_ENDIAN
  40. +# define htobe16(x) __bswap_16 (x)
  41. +# define htole16(x) (x)
  42. +# define be16toh(x) __bswap_16 (x)
  43. +# define le16toh(x) (x)
  44. +
  45. +# define htobe32(x) __bswap_32 (x)
  46. +# define htole32(x) (x)
  47. +# define be32toh(x) __bswap_32 (x)
  48. +# define le32toh(x) (x)
  49. +
  50. +# define htobe64(x) __bswap_64 (x)
  51. +# define htole64(x) (x)
  52. +# define be64toh(x) __bswap_64 (x)
  53. +# define le64toh(x) (x)
  54. +# else
  55. +# define htobe16(x) (x)
  56. +# define htole16(x) __bswap_16 (x)
  57. +# define be16toh(x) (x)
  58. +# define le16toh(x) __bswap_16 (x)
  59. +
  60. +# define htobe32(x) (x)
  61. +# define htole32(x) __bswap_32 (x)
  62. +# define be32toh(x) (x)
  63. +# define le32toh(x) __bswap_32 (x)
  64. +
  65. +# define htobe64(x) (x)
  66. +# define htole64(x) __bswap_64 (x)
  67. +# define be64toh(x) (x)
  68. +# define le64toh(x) __bswap_64 (x)
  69. +# endif
  70. +#endif
  71. +#endif
  72. +
  73. +#endif /* endian_extra.h */
  74. diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
  75. --- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500
  76. +++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500
  77. @@ -39,6 +39,8 @@
  78. # define N_(msgid) msgid
  79. #define _(msg) msg
  80. +#include "endian_extra.h"
  81. +
  82. extern int be;
  83. static uint16_t write16(uint16_t x, int be)
  84. diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
  85. --- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500
  86. +++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500
  87. @@ -25,6 +25,9 @@
  88. /* check_ptr checks that a pointer is in the mmaped file and doesn't
  89. point outside it. */
  90. +
  91. +#include "endian_extra.h"
  92. +
  93. #undef check_ptr
  94. #define check_ptr(ptr) \
  95. do \
  96. diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
  97. --- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500
  98. +++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500
  99. @@ -40,6 +40,8 @@
  100. #include "ldconfig.h"
  101. +#include "endian_extra.h"
  102. +
  103. #define _(msg) msg
  104. #define Elf32_CLASS ELFCLASS32