mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
5.2 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/glibc/glibc23/glibc-fp-byteorder.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c
  20. and makes printf("%f", 1.0) work.
  21. diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h
  22. --- glibc.old/sysdeps/arm/bits/endian.h 1999-04-12 11:59:13.000000000 -0400
  23. +++ glibc.new/sysdeps/arm/bits/endian.h 2004-02-12 09:15:13.000000000 -0500
  24. @@ -9,4 +9,9 @@
  25. #else
  26. #define __BYTE_ORDER __LITTLE_ENDIAN
  27. #endif
  28. +
  29. +#ifdef __VFP_FP__
  30. +#define __FLOAT_WORD_ORDER __BYTE_ORDER
  31. +#else
  32. #define __FLOAT_WORD_ORDER __BIG_ENDIAN
  33. +#endif
  34. diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h
  35. --- glibc.old/sysdeps/arm/gmp-mparam.h 2001-07-07 15:21:19.000000000 -0400
  36. +++ glibc.new/sysdeps/arm/gmp-mparam.h 2004-02-12 09:15:13.000000000 -0500
  37. @@ -26,5 +26,13 @@ MA 02111-1307, USA. */
  38. #define BITS_PER_SHORTINT 16
  39. #define BITS_PER_CHAR 8
  40. -#define IEEE_DOUBLE_BIG_ENDIAN 0
  41. -#define IEEE_DOUBLE_MIXED_ENDIAN 1
  42. +#if defined(__ARMEB__)
  43. +# define IEEE_DOUBLE_MIXED_ENDIAN 0
  44. +# define IEEE_DOUBLE_BIG_ENDIAN 1
  45. +#elif defined(__VFP_FP__)
  46. +# define IEEE_DOUBLE_MIXED_ENDIAN 0
  47. +# define IEEE_DOUBLE_BIG_ENDIAN 0
  48. +#else
  49. +# define IEEE_DOUBLE_BIG_ENDIAN 0
  50. +# define IEEE_DOUBLE_MIXED_ENDIAN 1
  51. +#endif
  52. diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h
  53. --- glibc.old/sysdeps/arm/ieee754.h 2001-07-07 15:21:19.000000000 -0400
  54. +++ glibc.new/sysdeps/arm/ieee754.h 1969-12-31 19:00:00.000000000 -0500
  55. @@ -1,115 +0,0 @@
  56. -/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.
  57. - This file is part of the GNU C Library.
  58. -
  59. - The GNU C Library is free software; you can redistribute it and/or
  60. - modify it under the terms of the GNU Lesser General Public
  61. - License as published by the Free Software Foundation; either
  62. - version 2.1 of the License, or (at your option) any later version.
  63. -
  64. - The GNU C Library is distributed in the hope that it will be useful,
  65. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  66. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  67. - Lesser General Public License for more details.
  68. -
  69. - You should have received a copy of the GNU Lesser General Public
  70. - License along with the GNU C Library; if not, write to the Free
  71. - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  72. - 02111-1307 USA. */
  73. -
  74. -#ifndef _IEEE754_H
  75. -
  76. -#define _IEEE754_H 1
  77. -#include <features.h>
  78. -
  79. -#include <endian.h>
  80. -
  81. -__BEGIN_DECLS
  82. -
  83. -union ieee754_float
  84. - {
  85. - float f;
  86. -
  87. - /* This is the IEEE 754 single-precision format. */
  88. - struct
  89. - {
  90. - unsigned int mantissa:23;
  91. - unsigned int exponent:8;
  92. - unsigned int negative:1;
  93. - } ieee;
  94. -
  95. - /* This format makes it easier to see if a NaN is a signalling NaN. */
  96. - struct
  97. - {
  98. - unsigned int mantissa:22;
  99. - unsigned int quiet_nan:1;
  100. - unsigned int exponent:8;
  101. - unsigned int negative:1;
  102. - } ieee_nan;
  103. - };
  104. -
  105. -#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
  106. -
  107. -
  108. -union ieee754_double
  109. - {
  110. - double d;
  111. -
  112. - /* This is the IEEE 754 double-precision format. */
  113. - struct
  114. - {
  115. - unsigned int mantissa0:20;
  116. - unsigned int exponent:11;
  117. - unsigned int negative:1;
  118. - unsigned int mantissa1:32;
  119. - } ieee;
  120. -
  121. - /* This format makes it easier to see if a NaN is a signalling NaN. */
  122. - struct
  123. - {
  124. - unsigned int mantissa0:19;
  125. - unsigned int quiet_nan:1;
  126. - unsigned int exponent:11;
  127. - unsigned int negative:1;
  128. - unsigned int mantissa1:32;
  129. - } ieee_nan;
  130. - };
  131. -
  132. -#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
  133. -
  134. -
  135. -/* The following two structures are correct for `new' floating point systems but
  136. - wrong for the old FPPC. The only solution seems to be to avoid their use on
  137. - old hardware. */
  138. -
  139. -union ieee854_long_double
  140. - {
  141. - long double d;
  142. -
  143. - /* This is the IEEE 854 double-extended-precision format. */
  144. - struct
  145. - {
  146. - unsigned int exponent:15;
  147. - unsigned int empty:16;
  148. - unsigned int negative:1;
  149. - unsigned int mantissa1:32;
  150. - unsigned int mantissa0:32;
  151. - } ieee;
  152. -
  153. - /* This is for NaNs in the IEEE 854 double-extended-precision format. */
  154. - struct
  155. - {
  156. - unsigned int exponent:15;
  157. - unsigned int empty:16;
  158. - unsigned int negative:1;
  159. - unsigned int mantissa1:32;
  160. - unsigned int mantissa0:30;
  161. - unsigned int quiet_nan:1;
  162. - unsigned int one:1;
  163. - } ieee_nan;
  164. - };
  165. -
  166. -#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
  167. -
  168. -__END_DECLS
  169. -
  170. -#endif /* ieee754.h */