Patchwork [CONSOLIDATED,PULL,25/36] bluez4: Fix build on x86/amd64 with gcc 4.7

login
register
mail settings
Submitter Saul Wold
Date Feb. 28, 2012, 5:25 a.m.
Message ID <39a60d4f0ca8e88514114c0666df0305e51e7356.1330406574.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/22279/
State Accepted
Commit 09dcd878a55b5aec5427288c4faf3c4d64a30a72
Headers show

Comments

Saul Wold - Feb. 28, 2012, 5:25 a.m.
From: Khem Raj <raj.khem@gmail.com>

gcc figures an impossible asm contraint
in inline asm which it is correct about

"i" requires the operand to be a compile-time constant
but memory location of a multi-dimensional array isn't constant
at compile time.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../bluez/bluez4-4.98/sbc_mmx.patch                |   24 ++++++++++++++++++++
 meta/recipes-connectivity/bluez/bluez4_4.98.bb     |    6 +++-
 2 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/bluez/bluez4-4.98/sbc_mmx.patch

Patch

diff --git a/meta/recipes-connectivity/bluez/bluez4-4.98/sbc_mmx.patch b/meta/recipes-connectivity/bluez/bluez4-4.98/sbc_mmx.patch
new file mode 100644
index 0000000..98fab45
--- /dev/null
+++ b/meta/recipes-connectivity/bluez/bluez4-4.98/sbc_mmx.patch
@@ -0,0 +1,24 @@ 
+on x86 and x86_64 gcc 4.7 complains
+
+sbc/sbc_primitives_mmx.c: In function 'sbc_calc_scalefactors_mmx':
+sbc/sbc_primitives_mmx.c:294:4: warning: asm operand 2 probably doesn't match constraints [enabled by default]
+sbc/sbc_primitives_mmx.c:294:4: error: impossible constraint in 'asm'
+
+This patch is taken from https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/911871
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: bluez-4.98/sbc/sbc_primitives_mmx.c
+===================================================================
+--- bluez-4.98.orig/sbc/sbc_primitives_mmx.c	2011-12-21 14:53:54.000000000 -0800
++++ bluez-4.98/sbc/sbc_primitives_mmx.c	2012-02-24 10:07:03.422073800 -0800
+@@ -318,7 +318,7 @@
+ 				"movl          %k0, 4(%3)\n"
+ 			: "+r" (blk)
+ 			: "r" (&sb_sample_f[0][ch][sb]),
+-				"i" ((char *) &sb_sample_f[1][0][0] -
++				"r" ((char *) &sb_sample_f[1][0][0] -
+ 					(char *) &sb_sample_f[0][0][0]),
+ 				"r" (&scale_factor[ch][sb]),
+ 				"r" (&consts),
diff --git a/meta/recipes-connectivity/bluez/bluez4_4.98.bb b/meta/recipes-connectivity/bluez/bluez4_4.98.bb
index 62de1fe..2412b1b 100644
--- a/meta/recipes-connectivity/bluez/bluez4_4.98.bb
+++ b/meta/recipes-connectivity/bluez/bluez4_4.98.bb
@@ -1,8 +1,10 @@ 
 require bluez4.inc
 
-PR = "r0"
+PR = "r1"
 
-SRC_URI += "file://bluetooth.conf"
+SRC_URI += "file://bluetooth.conf \
+            file://sbc_mmx.patch \
+           "
 
 SRC_URI[md5sum] = "362864b716950baa04797de735fc237b"
 SRC_URI[sha256sum] = "9a5b655bada7c7a1921cb3bac83b8a32bbe49893e4c7a1377cdc1b0d35f7d233"