Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] gmp: add configure.ac patch to append user provided compilation flags
@ 2014-02-11 14:58 Laurentiu Palcu
  2014-02-11 14:58 ` [PATCH 1/1] " Laurentiu Palcu
  0 siblings, 1 reply; 2+ messages in thread
From: Laurentiu Palcu @ 2014-02-11 14:58 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 9c61b6392c991363b0399ed36d6dec3f0d0d6bcf:

  bitbake: user-manual-metadata.xml: Edits to the "Sharing Functionality" section. (2014-02-11 12:17:06 +0000)

are available in the git repository at:

  git://mirror.rb.intel.com/git.yoctoproject.org/poky-contrib lpalcu/b5783_gmp_build_issue

for you to fetch changes up to 185f9a3161f4dfe3cf1643b1e11d4780c304c424:

  gmp: add configure.ac patch to append user provided compilation flags (2014-02-11 15:57:50 +0200)

----------------------------------------------------------------
Laurentiu Palcu (1):
      gmp: add configure.ac patch to append user provided compilation flags

 .../gmp/gmp-5.1.1/append_user_provided_flags.patch |   52 ++++++++++++++++++++
 meta/recipes-support/gmp/gmp_5.1.1.bb              |    1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch

Laurentiu Palcu (1):
  gmp: add configure.ac patch to append user provided compilation flags

 .../gmp/gmp-5.1.1/append_user_provided_flags.patch |   52 ++++++++++++++++++++
 meta/recipes-support/gmp/gmp_5.1.1.bb              |    1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] gmp: add configure.ac patch to append user provided compilation flags
  2014-02-11 14:58 [PATCH 0/1] gmp: add configure.ac patch to append user provided compilation flags Laurentiu Palcu
@ 2014-02-11 14:58 ` Laurentiu Palcu
  0 siblings, 0 replies; 2+ messages in thread
From: Laurentiu Palcu @ 2014-02-11 14:58 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../gmp/gmp-5.1.1/append_user_provided_flags.patch |   52 ++++++++++++++++++++
 meta/recipes-support/gmp/gmp_5.1.1.bb              |    1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch

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 0000000..ae1386c
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-5.1.1/append_user_provided_flags.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Inappropriate
+
+Append the user provided flags to the auto-detected ones.
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: gmp-5.1.1/configure.ac
+===================================================================
+--- gmp-5.1.1.orig/configure.ac	2014-02-11 15:05:44.925202403 +0200
++++ gmp-5.1.1/configure.ac	2014-02-11 15:19:03.918511398 +0200
+@@ -1745,8 +1745,12 @@
+ EOF
+ 
+ 
+-test_CFLAGS=${CFLAGS+set}
+-test_CPPFLAGS=${CPPFLAGS+set}
++test_CFLAGS=
++test_CPPFLAGS=
++
++user_CFLAGS=$CFLAGS
++user_CPPFLAGS=$CPPFLAGS
++user_CXXFLAGS=$CXXFLAGS
+ 
+ for abi in $abilist; do
+   abi_last="$abi"
+@@ -2175,7 +2179,7 @@
+ want_cxx=no
+ AC_PROG_CXX
+ if test $enable_cxx != no; then
+-  test_CXXFLAGS=${CXXFLAGS+set}
++  test_CXXFLAGS=
+ 
+   echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AS_MESSAGE_LOG_FD()
+   cxxflags_ac_prog_cxx=$CXXFLAGS
+@@ -2202,7 +2206,7 @@
+   # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
+   #
+   for cxxflags_choice in $cxxflags_list; do
+-    eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
++    eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
+     GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
+       [want_cxx=yes
+       break])
+@@ -2292,6 +2296,8 @@
+ #  done
+ fi
+ 
++CFLAGS="$CFLAGS $user_CFLAGS"
++CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
+ 
+ cat >&AS_MESSAGE_LOG_FD() <<EOF
+ Decided:
diff --git a/meta/recipes-support/gmp/gmp_5.1.1.bb b/meta/recipes-support/gmp/gmp_5.1.1.bb
index d6dcb97..6020610 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 \
 		    file://version.c;endline=18;md5=d8c56b52b9092346b9f93b4da65ef790"
 
 SRC_URI_append = " file://use-includedir.patch \
+                   file://append_user_provided_flags.patch \
                    "
 
 SRC_URI[md5sum] = "2fa018a7cd193c78494525f236d02dd6"
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-11 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 14:58 [PATCH 0/1] gmp: add configure.ac patch to append user provided compilation flags Laurentiu Palcu
2014-02-11 14:58 ` [PATCH 1/1] " Laurentiu Palcu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox