summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-02-11 16:58:02 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-11 17:15:55 +0000
commitf7b44fe6db1895aa429962b47c0b9b1c9fecfd82 (patch)
tree1331f237b9f5c9baadd11227396a3aa53a527b5b
parent8d17c39cd66f55fab628d6a19780b167dfc37b7a (diff)
downloadpoky-f7b44fe6db1895aa429962b47c0b9b1c9fecfd82.tar.gz
gmp: add configure.ac patch to append user provided compilation flags
gmp configure script is pretty good at auto detecting the ABI and the tune flags that need to be passes to the compiler. However, the user provided flags (CFLAGS, CXXFLAGS, CPPFLAGS) take precedence and the ABI detection may fail, leading to configure errors like the one below: | configure: error: Oops, mp_limb_t is 32 bits, but the assembler code | in this configuration expects 64 bits. | You appear to have set $CFLAGS, perhaps you also need to tell GMP the | intended ABI, see "ABI and ISA" in the manual. One solution would be to change the recipe and add the ABI manually, or let gmp do the job. So, this patch will: * allow the configure process to auto-detect the ABI and tune flags properly; * append our flags to the detected ones; [YOCTO #5783] (From OE-Core rev: 8339b9ac16e7d3206de21a204beffaae5203adbb) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch52
-rw-r--r--meta/recipes-support/gmp/gmp_5.1.1.bb1
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch b/meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch
new file mode 100644
index 0000000000..ae1386c4c1
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch
@@ -0,0 +1,52 @@
1Upstream-Status: Inappropriate
2
3Append the user provided flags to the auto-detected ones.
4
5Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
6
7Index: gmp-5.1.1/configure.ac
8===================================================================
9--- gmp-5.1.1.orig/configure.ac 2014-02-11 15:05:44.925202403 +0200
10+++ gmp-5.1.1/configure.ac 2014-02-11 15:19:03.918511398 +0200
11@@ -1745,8 +1745,12 @@
12 EOF
13
14
15-test_CFLAGS=${CFLAGS+set}
16-test_CPPFLAGS=${CPPFLAGS+set}
17+test_CFLAGS=
18+test_CPPFLAGS=
19+
20+user_CFLAGS=$CFLAGS
21+user_CPPFLAGS=$CPPFLAGS
22+user_CXXFLAGS=$CXXFLAGS
23
24 for abi in $abilist; do
25 abi_last="$abi"
26@@ -2175,7 +2179,7 @@
27 want_cxx=no
28 AC_PROG_CXX
29 if test $enable_cxx != no; then
30- test_CXXFLAGS=${CXXFLAGS+set}
31+ test_CXXFLAGS=
32
33 echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AS_MESSAGE_LOG_FD()
34 cxxflags_ac_prog_cxx=$CXXFLAGS
35@@ -2202,7 +2206,7 @@
36 # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
37 #
38 for cxxflags_choice in $cxxflags_list; do
39- eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
40+ eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
41 GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
42 [want_cxx=yes
43 break])
44@@ -2292,6 +2296,8 @@
45 # done
46 fi
47
48+CFLAGS="$CFLAGS $user_CFLAGS"
49+CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
50
51 cat >&AS_MESSAGE_LOG_FD() <<EOF
52 Decided:
diff --git a/meta/recipes-support/gmp/gmp_5.1.1.bb b/meta/recipes-support/gmp/gmp_5.1.1.bb
index d6dcb97f3e..602061096a 100644
--- a/meta/recipes-support/gmp/gmp_5.1.1.bb
+++ b/meta/recipes-support/gmp/gmp_5.1.1.bb
@@ -4,6 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
4 file://version.c;endline=18;md5=d8c56b52b9092346b9f93b4da65ef790" 4 file://version.c;endline=18;md5=d8c56b52b9092346b9f93b4da65ef790"
5 5
6SRC_URI_append = " file://use-includedir.patch \ 6SRC_URI_append = " file://use-includedir.patch \
7 file://append_user_provided_flags.patch \
7 " 8 "
8 9
9SRC_URI[md5sum] = "2fa018a7cd193c78494525f236d02dd6" 10SRC_URI[md5sum] = "2fa018a7cd193c78494525f236d02dd6"