Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/libmad/files: libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
Date: Fri, 30 Apr 2010 08:21:56
Message-Id: 20100430082151.7C5222C043@corvid.gentoo.org
1 ssuominen 10/04/30 08:21:51
2
3 Added:
4 libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
5 Log:
6 Fix building with GCC 4.4 on MIPS wrt #317871 by Manuel Lauss.
7 (Portage version: 2.2_rc67/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch?rev=1.1&content-type=text/plain
14
15 Index: libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
16 ===================================================================
17 libmad: MIPS GCC-4.4 build fixes
18
19 GCC-4.4 on MIPS removed the "h" asm constraint, fix this up.
20 Taken from OE.
21
22 http://patchwork.openembedded.org/patch/921/
23
24 diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
25 --- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030
26 +++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930
27 @@ -299,6 +299,23 @@
28
29 # elif defined(FPM_MIPS)
30
31 +/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
32 +#if defined (__GNUC__) && defined (__GNUC_MINOR__)
33 +#define __GNUC_PREREQ(maj, min) \
34 + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
35 +#else
36 +#define __GNUC_PREREQ(maj, min) 0
37 +#endif
38 +
39 +#if __GNUC_PREREQ(4,4)
40 + typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
41 +# define MAD_F_MLX(hi, lo, x, y) \
42 + do { \
43 + u64_di_t __ll = (u64_di_t) (x) * (y); \
44 + hi = __ll >> 32; \
45 + lo = __ll; \
46 + } while (0)
47 +#else
48 /*
49 * This MIPS version is fast and accurate; the disposition of the least
50 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
51 @@ -328,6 +345,7 @@
52 : "%r" ((x) >> 12), "r" ((y) >> 16))
53 # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
54 # endif
55 +#endif /* __GNU_PREREQ(4,4) */
56
57 # if defined(OPT_SPEED)
58 # define mad_f_scale64(hi, lo) \
59 diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
60 --- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030
61 +++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930
62 @@ -344,6 +344,23 @@
63
64 # elif defined(FPM_MIPS)
65
66 +/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
67 +#if defined (__GNUC__) && defined (__GNUC_MINOR__)
68 +#define __GNUC_PREREQ(maj, min) \
69 + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
70 +#else
71 +#define __GNUC_PREREQ(maj, min) 0
72 +#endif
73 +
74 +#if __GNUC_PREREQ(4,4)
75 + typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
76 +# define MAD_F_MLX(hi, lo, x, y) \
77 + do { \
78 + u64_di_t __ll = (u64_di_t) (x) * (y); \
79 + hi = __ll >> 32; \
80 + lo = __ll; \
81 + } while (0)
82 +#else
83 /*
84 * This MIPS version is fast and accurate; the disposition of the least
85 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
86 @@ -373,6 +390,7 @@
87 : "%r" ((x) >> 12), "r" ((y) >> 16))
88 # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
89 # endif
90 +#endif /* __GNU_PREREQ(4,4) */
91
92 # if defined(OPT_SPEED)
93 # define mad_f_scale64(hi, lo) \