Patchwork [05/11] mesa-dri, mesa-xlib: fix compilation with x32 toolchain

login
register
mail settings
Submitter Nitin A Kamble
Date Dec. 2, 2011, 8:20 p.m.
Message ID <3eb0c7dd7cd03e3b6ae3040299b2359975c9ef79.1322856805.git.nitin.a.kamble@intel.com>
Download mbox | patch
Permalink /patch/16143/
State New
Headers show

Comments

Nitin A Kamble - Dec. 2, 2011, 8:20 p.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

Add support for building with x32 toolchain.

Simplified the use of SRC_URI & S vars across multiple files.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 meta/recipes-graphics/mesa/mesa-7.11.inc           |   11 ++++++--
 meta/recipes-graphics/mesa/mesa-common.inc         |    2 -
 meta/recipes-graphics/mesa/mesa-dri_7.11.bb        |    2 +-
 meta/recipes-graphics/mesa/mesa-git.inc            |    6 ++--
 meta/recipes-graphics/mesa/mesa-xlib_7.11.bb       |    2 +-
 .../mesa/mesa/mesa_fix_for_x32.patch               |   24 ++++++++++++++++++++
 6 files changed, 37 insertions(+), 10 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/mesa/mesa_fix_for_x32.patch

Patch

diff --git a/meta/recipes-graphics/mesa/mesa-7.11.inc b/meta/recipes-graphics/mesa/mesa-7.11.inc
index 2f14ed4..7c4a690 100644
--- a/meta/recipes-graphics/mesa/mesa-7.11.inc
+++ b/meta/recipes-graphics/mesa/mesa-7.11.inc
@@ -1,9 +1,14 @@ 
 DEPENDS += "mesa-dri-glsl-native"
 
-SRC_URI += "file://uclibc.patch \
-            file://crossfix.patch \
-            file://crossfix-mklib.patch \
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \ 
+           file://uclibc.patch \
+           file://crossfix.patch \
+           file://crossfix-mklib.patch \
+           file://mesa_fix_for_x32.patch \
            "
+S = "${WORKDIR}/Mesa-${PV}"
+
 SRC_URI[md5sum] = "ff03aca82d0560009a076a87c888cf13"
 SRC_URI[sha256sum] = "f8bf37a00882840a3e3d327576bc26a79ae7f4e18fe1f7d5f17a5b1c80dd7acf"
 
diff --git a/meta/recipes-graphics/mesa/mesa-common.inc b/meta/recipes-graphics/mesa/mesa-common.inc
index df035e6..59e8e64 100644
--- a/meta/recipes-graphics/mesa/mesa-common.inc
+++ b/meta/recipes-graphics/mesa/mesa-common.inc
@@ -15,8 +15,6 @@  LIC_FILES_CHKSUM = "file://docs/license.html;md5=7a3373c039b6b925c427755a4f779c1
 INC_PR = "r13"
 PE = "2"
 
-SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2"
-S = "${WORKDIR}/Mesa-${PV}"
 
 PROTO_DEPS = "xf86driproto glproto"
 LIB_DEPS = "virtual/libx11 libxext libxxf86vm libxdamage libxfixes libxml2-native"
diff --git a/meta/recipes-graphics/mesa/mesa-dri_7.11.bb b/meta/recipes-graphics/mesa/mesa-dri_7.11.bb
index 5d25127..219e555 100644
--- a/meta/recipes-graphics/mesa/mesa-dri_7.11.bb
+++ b/meta/recipes-graphics/mesa/mesa-dri_7.11.bb
@@ -1,4 +1,4 @@ 
 include mesa-common.inc
 include mesa-${PV}.inc
 include mesa-dri.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
diff --git a/meta/recipes-graphics/mesa/mesa-git.inc b/meta/recipes-graphics/mesa/mesa-git.inc
index 594d9b8..1b4c0a6 100644
--- a/meta/recipes-graphics/mesa/mesa-git.inc
+++ b/meta/recipes-graphics/mesa/mesa-git.inc
@@ -6,9 +6,9 @@  PV = "7.11+gitr${SRCPV}"
 LIC_FILES_CHKSUM = "file://docs/license.html;md5=03ccdc4c379c4289aecfb8892c546f67"
 FILESEXTRAPATHS_prepend := "${THISDIR}/mesa-git:"
 
-SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;protocol=git"
-SRC_URI += "file://uclibc.patch \
-            file://crossfix.patch \
+SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;protocol=git \
+           file://uclibc.patch \
+           file://crossfix.patch \
            "
 S = "${WORKDIR}/git"
 
diff --git a/meta/recipes-graphics/mesa/mesa-xlib_7.11.bb b/meta/recipes-graphics/mesa/mesa-xlib_7.11.bb
index 95ff5e8..7912287 100644
--- a/meta/recipes-graphics/mesa/mesa-xlib_7.11.bb
+++ b/meta/recipes-graphics/mesa/mesa-xlib_7.11.bb
@@ -1,5 +1,5 @@ 
 include mesa-common.inc
 include mesa-${PV}.inc
 include mesa-xlib.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
diff --git a/meta/recipes-graphics/mesa/mesa/mesa_fix_for_x32.patch b/meta/recipes-graphics/mesa/mesa/mesa_fix_for_x32.patch
new file mode 100644
index 0000000..22a2339
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/mesa_fix_for_x32.patch
@@ -0,0 +1,24 @@ 
+UpstreamStatus: Pending
+
+get correct compiler options for x32 gcc.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
+
+--- Mesa-7.11/bin/mklib.x32	2011-11-30 14:29:14.976465283 -0800
++++ Mesa-7.11/bin/mklib	2011-11-30 14:32:48.591525193 -0800
+@@ -335,7 +335,12 @@ case $ARCH in
+ 	    set ${OBJECTS}
+ 	    ABI32=`file $1 | grep 32-bit`
+ 	    if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
+-		OPTS="-m32 ${OPTS}"
++		ABIX32=`file $1 | grep x86-64`
++		if [ "${ABI32}" ]; then
++		    OPTS="-mx32 ${OPTS}"
++		else
++		    OPTS="-m32 ${OPTS}"
++		fi
+ 	    fi
+ 
+             if [ "${ALTOPTS}" ] ; then