summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2012-01-04 22:28:43 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-10 17:28:41 (GMT)
commitf1e58216fa81f74bc31ab5d242927185d8a3bf0b (patch)
tree583d75612c5932f1eec58ca0b5fd537ff11d055f
parent468998cddbe1a803096c9b357e1b5daa3b7e8c2e (diff)
downloadpoky-f1e58216fa81f74bc31ab5d242927185d8a3bf0b.tar.gz
libxxf86dga: fix compilation with x32 toolchain
Fix type conversion for x32. For x32 the off_t is 64bit and pointers are 32bit. so the conversion of pointer to off_t was resulting into this error: | XF86DGA2.c:931:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] | cc1: some warnings being treated as errors | | make[2]: *** [XF86DGA2.lo] Error 1 Fixed it by typecasting pointer into unsigned long 1st and then again typecasting unsigned long to off_t. (From OE-Core rev: 644aaa87a0e161f8a37267f13d4a18f6dfcd9a4f) Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.2_fix_for_x32.patch30
-rw-r--r--meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.2.bb5
2 files changed, 34 insertions, 1 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.2_fix_for_x32.patch b/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.2_fix_for_x32.patch
new file mode 100644
index 0000000..30692ad
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.2_fix_for_x32.patch
@@ -0,0 +1,30 @@
1Upstream-Status: pending
2
3Fix type conversion for x32. For x32 the off_t is 64bit and pointers are 32bit.
4so the conversion of pointer to off_t was resulting into this error:
5
6| XF86DGA2.c:931:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
7| cc1: some warnings being treated as errors
8|
9| make[2]: *** [XF86DGA2.lo] Error 1
10
11Fixed it by typecasting pointer into unsigned long 1st and then again typecasting
12unsigned long to off_t.
13
14Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
152012/01/04
16
17
18Index: libXxf86dga-1.1.2/src/XF86DGA2.c
19===================================================================
20--- libXxf86dga-1.1.2.orig/src/XF86DGA2.c 2010-10-06 21:17:11.000000000 -0700
21+++ libXxf86dga-1.1.2/src/XF86DGA2.c 2012-01-04 14:21:36.275971172 -0800
22@@ -928,7 +928,7 @@ DGAMapPhysical(
23 if ((pMap->fd = open(name, O_RDWR)) < 0)
24 return False;
25 pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE,
26- MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base);
27+ MAP_FILE | MAP_SHARED, pMap->fd, (off_t)(unsigned long)base);
28 if (pMap->virtual == (void *)-1)
29 return False;
30 mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);
diff --git a/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.2.bb b/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.2.bb
index 8e777c3..9a1c96f 100644
--- a/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.2.bb
+++ b/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.2.bb
@@ -8,7 +8,10 @@ allows relative mouse reporting, et al. It is mainly used by games and \
8emulators for games." 8emulators for games."
9 9
10DEPENDS += "libxext xf86dgaproto" 10DEPENDS += "libxext xf86dgaproto"
11PR = "r1" 11PR = "r2"
12
13SRC_URI += "file://libxxf86dga-1.1.2_fix_for_x32.patch"
14
12PE = "1" 15PE = "1"
13 16
14XORG_PN = "libXxf86dga" 17XORG_PN = "libXxf86dga"