libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. libmad: MIPS GCC-4.4 build fixes
  2. GCC-4.4 on MIPS removed the "h" asm constraint, fix this up.
  3. Taken from OE.
  4. http://patchwork.openembedded.org/patch/921/
  5. diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
  6. --- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030
  7. +++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930
  8. @@ -299,6 +299,23 @@
  9. # elif defined(FPM_MIPS)
  10. +/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
  11. +#if defined (__GNUC__) && defined (__GNUC_MINOR__)
  12. +#define __GNUC_PREREQ(maj, min) \
  13. + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
  14. +#else
  15. +#define __GNUC_PREREQ(maj, min) 0
  16. +#endif
  17. +
  18. +#if __GNUC_PREREQ(4,4)
  19. + typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
  20. +# define MAD_F_MLX(hi, lo, x, y) \
  21. + do { \
  22. + u64_di_t __ll = (u64_di_t) (x) * (y); \
  23. + hi = __ll >> 32; \
  24. + lo = __ll; \
  25. + } while (0)
  26. +#else
  27. /*
  28. * This MIPS version is fast and accurate; the disposition of the least
  29. * significant bit depends on OPT_ACCURACY via mad_f_scale64().
  30. @@ -328,6 +345,7 @@
  31. : "%r" ((x) >> 12), "r" ((y) >> 16))
  32. # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
  33. # endif
  34. +#endif /* __GNU_PREREQ(4,4) */
  35. # if defined(OPT_SPEED)
  36. # define mad_f_scale64(hi, lo) \
  37. diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
  38. --- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030
  39. +++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930
  40. @@ -344,6 +344,23 @@
  41. # elif defined(FPM_MIPS)
  42. +/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
  43. +#if defined (__GNUC__) && defined (__GNUC_MINOR__)
  44. +#define __GNUC_PREREQ(maj, min) \
  45. + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
  46. +#else
  47. +#define __GNUC_PREREQ(maj, min) 0
  48. +#endif
  49. +
  50. +#if __GNUC_PREREQ(4,4)
  51. + typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
  52. +# define MAD_F_MLX(hi, lo, x, y) \
  53. + do { \
  54. + u64_di_t __ll = (u64_di_t) (x) * (y); \
  55. + hi = __ll >> 32; \
  56. + lo = __ll; \
  57. + } while (0)
  58. +#else
  59. /*
  60. * This MIPS version is fast and accurate; the disposition of the least
  61. * significant bit depends on OPT_ACCURACY via mad_f_scale64().
  62. @@ -373,6 +390,7 @@
  63. : "%r" ((x) >> 12), "r" ((y) >> 16))
  64. # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
  65. # endif
  66. +#endif /* __GNU_PREREQ(4,4) */
  67. # if defined(OPT_SPEED)
  68. # define mad_f_scale64(hi, lo) \