diff options
author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2011-12-02 12:20:02 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-05 22:47:06 +0000 |
commit | 13d011204a8711d3342b23a4c2a94307af84aeb9 (patch) | |
tree | f40ebd91e3a4fa66495cc20f1b9e881dcadfe1b7 /meta/recipes-support | |
parent | 51bfed2e26fc13a66e8b5710aa2ce1d7a04af721 (diff) | |
download | poky-13d011204a8711d3342b23a4c2a94307af84aeb9.tar.gz |
gmp: fix the recipe for x32 target
Add support for building with x32 toolchain.
(From OE-Core rev: 971c2042351c039b1d51f67e8e78749d0374d729)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/gmp/gmp/gmp_bugfix.patch | 94 | ||||
-rw-r--r-- | meta/recipes-support/gmp/gmp/gmp_fix_for_x32.patch | 45 | ||||
-rw-r--r-- | meta/recipes-support/gmp/gmp_5.0.2.bb | 6 |
3 files changed, 143 insertions, 2 deletions
diff --git a/meta/recipes-support/gmp/gmp/gmp_bugfix.patch b/meta/recipes-support/gmp/gmp/gmp_bugfix.patch new file mode 100644 index 0000000000..a96136fcc3 --- /dev/null +++ b/meta/recipes-support/gmp/gmp/gmp_bugfix.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | UpstreamStatus: Pending | ||
2 | |||
3 | When LONG_MIN is passed to val, -val is undefined. This patch fixes | ||
4 | it. See for details: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 | ||
5 | |||
6 | Received this patch from H.J. Lu <hjl.tools@gmail.com> | ||
7 | |||
8 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01 | ||
9 | |||
10 | --- gmp-4.3.2/mpf/iset_si.c.ll 2010-01-07 12:09:03.000000000 -0800 | ||
11 | +++ gmp-4.3.2/mpf/iset_si.c 2011-11-30 16:42:35.827944358 -0800 | ||
12 | @@ -31,7 +31,7 @@ mpf_init_set_si (mpf_ptr r, long int val | ||
13 | r->_mp_prec = prec; | ||
14 | r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((prec + 1) * BYTES_PER_MP_LIMB); | ||
15 | |||
16 | - vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val); | ||
17 | + vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val); | ||
18 | |||
19 | r->_mp_d[0] = vl & GMP_NUMB_MASK; | ||
20 | size = vl != 0; | ||
21 | --- gmp-4.3.2/mpf/set_si.c.ll 2010-01-07 12:09:03.000000000 -0800 | ||
22 | +++ gmp-4.3.2/mpf/set_si.c 2011-11-30 16:42:47.823878367 -0800 | ||
23 | @@ -27,7 +27,7 @@ mpf_set_si (mpf_ptr dest, long val) | ||
24 | mp_size_t size; | ||
25 | mp_limb_t vl; | ||
26 | |||
27 | - vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val); | ||
28 | + vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val); | ||
29 | |||
30 | dest->_mp_d[0] = vl & GMP_NUMB_MASK; | ||
31 | size = vl != 0; | ||
32 | --- gmp-4.3.2/mpz/cmp_si.c.ll 2010-01-07 12:09:03.000000000 -0800 | ||
33 | +++ gmp-4.3.2/mpz/cmp_si.c 2011-11-30 13:44:25.923319700 -0800 | ||
34 | @@ -27,7 +27,7 @@ _mpz_cmp_si (mpz_srcptr u, signed long i | ||
35 | { | ||
36 | mp_size_t usize = u->_mp_size; | ||
37 | mp_size_t vsize; | ||
38 | - mp_limb_t u_digit; | ||
39 | + mp_limb_t u_digit, vl_digit; | ||
40 | |||
41 | #if GMP_NAIL_BITS != 0 | ||
42 | /* FIXME. This isn't very pretty. */ | ||
43 | @@ -41,11 +41,14 @@ _mpz_cmp_si (mpz_srcptr u, signed long i | ||
44 | |||
45 | vsize = 0; | ||
46 | if (v_digit > 0) | ||
47 | - vsize = 1; | ||
48 | + { | ||
49 | + vsize = 1; | ||
50 | + vl_digit = (mp_limb_t) (unsigned long) v_digit; | ||
51 | + } | ||
52 | else if (v_digit < 0) | ||
53 | { | ||
54 | vsize = -1; | ||
55 | - v_digit = -v_digit; | ||
56 | + vl_digit = (mp_limb_t) -(unsigned long) v_digit; | ||
57 | } | ||
58 | |||
59 | if (usize != vsize) | ||
60 | @@ -56,10 +59,10 @@ _mpz_cmp_si (mpz_srcptr u, signed long i | ||
61 | |||
62 | u_digit = u->_mp_d[0]; | ||
63 | |||
64 | - if (u_digit == (mp_limb_t) (unsigned long) v_digit) | ||
65 | + if (u_digit == vl_digit) | ||
66 | return 0; | ||
67 | |||
68 | - if (u_digit > (mp_limb_t) (unsigned long) v_digit) | ||
69 | + if (u_digit > vl_digit) | ||
70 | return usize; | ||
71 | else | ||
72 | return -usize; | ||
73 | --- gmp-4.3.2/mpz/iset_si.c.ll 2010-01-07 12:09:03.000000000 -0800 | ||
74 | +++ gmp-4.3.2/mpz/iset_si.c 2011-11-30 13:44:25.924319695 -0800 | ||
75 | @@ -31,7 +31,7 @@ mpz_init_set_si (mpz_ptr dest, signed lo | ||
76 | dest->_mp_alloc = 1; | ||
77 | dest->_mp_d = (mp_ptr) (*__gmp_allocate_func) (BYTES_PER_MP_LIMB); | ||
78 | |||
79 | - vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val); | ||
80 | + vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val); | ||
81 | |||
82 | dest->_mp_d[0] = vl & GMP_NUMB_MASK; | ||
83 | size = vl != 0; | ||
84 | --- gmp-4.3.2/mpz/set_si.c.ll 2010-01-07 12:09:03.000000000 -0800 | ||
85 | +++ gmp-4.3.2/mpz/set_si.c 2011-11-30 13:44:25.947319574 -0800 | ||
86 | @@ -27,7 +27,7 @@ mpz_set_si (mpz_ptr dest, signed long in | ||
87 | mp_size_t size; | ||
88 | mp_limb_t vl; | ||
89 | |||
90 | - vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val); | ||
91 | + vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val); | ||
92 | |||
93 | dest->_mp_d[0] = vl & GMP_NUMB_MASK; | ||
94 | size = vl != 0; | ||
diff --git a/meta/recipes-support/gmp/gmp/gmp_fix_for_x32.patch b/meta/recipes-support/gmp/gmp/gmp_fix_for_x32.patch new file mode 100644 index 0000000000..b8e22aa002 --- /dev/null +++ b/meta/recipes-support/gmp/gmp/gmp_fix_for_x32.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Add X32 support in gmp configure. | ||
4 | |||
5 | Patch Originator: H J Lu @ Intel | ||
6 | Patch modified for Yocto by Nitin Kamble | ||
7 | Signed Off By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/11/21 | ||
8 | |||
9 | --- gmp-4.3.2/configure.in.x32 2011-08-12 15:03:06.143548291 -0700 | ||
10 | +++ gmp-4.3.2/configure.in 2011-08-12 15:06:20.580595316 -0700 | ||
11 | @@ -1499,6 +1499,25 @@ case $host in | ||
12 | path_64="x86_64/atom x86_64" | ||
13 | ;; | ||
14 | esac | ||
15 | + | ||
16 | + # X32 support. | ||
17 | + case x"$path_64" in | ||
18 | + xx86_64*) | ||
19 | + case x"$CC $CFLAGS" in | ||
20 | + x*-mx32*) | ||
21 | + abilist="x32 64 32" | ||
22 | + path_x32="$path_64" | ||
23 | + limb_x32=longlong | ||
24 | + cclist_x32="gcc" | ||
25 | + gcc_x32_cflags="-O2 -mx32" | ||
26 | + any_x32_testlist="sizeof-long-4" | ||
27 | + CALLING_CONVENTIONS_OBJS_x32='amd64call.lo amd64check$U.lo' | ||
28 | + SPEED_CYCLECOUNTER_OBJ_x32=x86_64.lo | ||
29 | + cyclecounter_size_x32=2 | ||
30 | + ;; | ||
31 | + esac | ||
32 | + ;; | ||
33 | + esac | ||
34 | ;; | ||
35 | esac | ||
36 | ;; | ||
37 | @@ -3039,7 +3058,7 @@ if test "$gmp_asm_syntax_testing" != no; | ||
38 | GMP_INCLUDE_MPN(x86/darwin.m4) ;; | ||
39 | esac | ||
40 | ;; | ||
41 | - 64) | ||
42 | + 64|x32) | ||
43 | GMP_INCLUDE_MPN(x86_64/x86_64-defs.m4) | ||
44 | case $host in | ||
45 | *-*-darwin*) | ||
diff --git a/meta/recipes-support/gmp/gmp_5.0.2.bb b/meta/recipes-support/gmp/gmp_5.0.2.bb index 873fc3ea0e..c28e745dc9 100644 --- a/meta/recipes-support/gmp/gmp_5.0.2.bb +++ b/meta/recipes-support/gmp/gmp_5.0.2.bb | |||
@@ -2,10 +2,12 @@ require gmp.inc | |||
2 | LICENSE="LGPLv3&GPLv3" | 2 | LICENSE="LGPLv3&GPLv3" |
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ | 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ |
4 | file://version.c;endline=18;md5=d8c56b52b9092346b9f93b4da65ef790" | 4 | file://version.c;endline=18;md5=d8c56b52b9092346b9f93b4da65ef790" |
5 | PR = "r2" | 5 | PR = "r3" |
6 | 6 | ||
7 | SRC_URI_append += "file://sh4-asmfix.patch \ | 7 | SRC_URI_append += "file://sh4-asmfix.patch \ |
8 | file://use-includedir.patch " | 8 | file://gmp_bugfix.patch \ |
9 | file://use-includedir.patch \ | ||
10 | file://gmp_fix_for_x32.patch" | ||
9 | 11 | ||
10 | export CC_FOR_BUILD = "${BUILD_CC}" | 12 | export CC_FOR_BUILD = "${BUILD_CC}" |
11 | 13 | ||