* [PATCH] fix libmad compilation with GCC-4.4 on mips
@ 2009-08-05 1:46 Graham Gower
2009-08-09 13:33 ` Holger Hans Peter Freyther
0 siblings, 1 reply; 2+ messages in thread
From: Graham Gower @ 2009-08-05 1:46 UTC (permalink / raw)
To: openembedded-devel
Fix build failure due to removal of the h asm constraint in GCC-4.4 mips port.
-Graham
diff --git a/recipes/libmad/files/mad-mips-h-constraint.patch b/recipes/libmad/files/mad-mips-h-constraint.patch
new file mode 100644
index 0000000..b65555e
--- /dev/null
+++ b/recipes/libmad/files/mad-mips-h-constraint.patch
@@ -0,0 +1,70 @@
+diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
+--- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030
++++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930
+@@ -299,6 +299,23 @@
+
+ # elif defined(FPM_MIPS)
+
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min) 0
++#endif
++
++#if __GNUC_PREREQ(4,4)
++ typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++ do { \
++ u64_di_t __ll = (u64_di_t) (x) * (y); \
++ hi = __ll >> 32; \
++ lo = __ll; \
++ } while (0)
++#else
+ /*
+ * This MIPS version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+@@ -328,6 +345,7 @@
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
+ # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
+ # endif
++#endif /* __GNU_PREREQ(4,4) */
+
+ # if defined(OPT_SPEED)
+ # define mad_f_scale64(hi, lo) \
+diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
+--- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030
++++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930
+@@ -344,6 +344,23 @@
+
+ # elif defined(FPM_MIPS)
+
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min) 0
++#endif
++
++#if __GNUC_PREREQ(4,4)
++ typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++ do { \
++ u64_di_t __ll = (u64_di_t) (x) * (y); \
++ hi = __ll >> 32; \
++ lo = __ll; \
++ } while (0)
++#else
+ /*
+ * This MIPS version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+@@ -373,6 +390,7 @@
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
+ # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
+ # endif
++#endif /* __GNU_PREREQ(4,4) */
+
+ # if defined(OPT_SPEED)
+ # define mad_f_scale64(hi, lo) \
diff --git a/recipes/libmad/libmad_0.15.1b.bb b/recipes/libmad/libmad_0.15.1b.bb
index 4a75c2d..738dcc2 100644
--- a/recipes/libmad/libmad_0.15.1b.bb
+++ b/recipes/libmad/libmad_0.15.1b.bb
@@ -7,7 +7,8 @@ PR = "r4"
SRC_URI = "${SOURCEFORGE_MIRROR}/mad/libmad-${PV}.tar.gz \
file://add-pkgconfig.patch;patch=1 \
- file://mad.diff;patch=1 "
+ file://mad.diff;patch=1 \
+ file://mad-mips-h-constraint.patch;patch=1"
S = "${WORKDIR}/libmad-${PV}"
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fix libmad compilation with GCC-4.4 on mips
2009-08-05 1:46 [PATCH] fix libmad compilation with GCC-4.4 on mips Graham Gower
@ 2009-08-09 13:33 ` Holger Hans Peter Freyther
0 siblings, 0 replies; 2+ messages in thread
From: Holger Hans Peter Freyther @ 2009-08-09 13:33 UTC (permalink / raw)
To: openembedded-devel
On Wednesday 05 August 2009 03:46:28 Graham Gower wrote:
> Fix build failure due to removal of the h asm constraint in GCC-4.4 mips
> port.
Signed-Off-By: Holger Freyther <holger@freyther.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-09 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05 1:46 [PATCH] fix libmad compilation with GCC-4.4 on mips Graham Gower
2009-08-09 13:33 ` Holger Hans Peter Freyther
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.