public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] gmp: Fix wrong detection of -march flag
@ 2016-08-12 18:10 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2016-08-12 18:10 UTC (permalink / raw)
  To: openembedded-core

Configure detects -march flag based upon target
triplet, it wrongly passes -march=armv4 for all
arm, this is unearthed when compiling with clang
since it errors out with flags like

/tmp/kraj01/a-0c2038.s:27: Error: selected processor does not support `bx r0' in ARM mode

since it does not pass --fix-v4bx along with
-march=armv4, which does not happen with gcc
toolchain since this flag is passed impicitly hence
this error was indetected

Fixed thusly

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...re.ac-Believe-the-cflags-from-environment.patch | 52 ++++++++++++++++++++++
 meta/recipes-support/gmp/gmp_6.1.1.bb              |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-support/gmp/gmp-6.1.1/0001-confiure.ac-Believe-the-cflags-from-environment.patch

diff --git a/meta/recipes-support/gmp/gmp-6.1.1/0001-confiure.ac-Believe-the-cflags-from-environment.patch b/meta/recipes-support/gmp/gmp-6.1.1/0001-confiure.ac-Believe-the-cflags-from-environment.patch
new file mode 100644
index 0000000..6653676
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-6.1.1/0001-confiure.ac-Believe-the-cflags-from-environment.patch
@@ -0,0 +1,52 @@
+From ae1a4c37417a3bbbf8ea1cab198982b0cad47e29 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 12 Aug 2016 17:08:13 +0000
+Subject: [PATCH] confiure.ac: Believe the cflags from environment
+
+In some toolchains e.g. OpenEmbedded -march options
+are passed on compiler cmdline, it does not use
+the expected target triplets to make these decision
+during configure.
+
+Secondly, dont set armv4 for march when no selection
+is made, since it is passed from cmdline
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate[OE-Specific]
+
+ configure.ac | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 857ea3b..359e919 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -607,15 +607,6 @@ case $host in
+     GMP_INCLUDE_MPN(arm/arm-defs.m4)
+     CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
+ 
+-    # This is needed for clang, which is not content with flags like -mfpu=neon
+-    # alone.
+-    case $host in
+-      *-*-*eabi)
+-        gcc_cflags_fpmode="-mfloat-abi=softfp" ;;
+-      *-*-*eabihf)
+-        gcc_cflags_fpmode="-mfloat-abi=hard" ;;
+-    esac
+-
+     # FIXME: We make mandatory compiler options optional here.  We should
+     # either enforce them, or organise to strip paths as the corresponding
+     # options fail.
+@@ -686,8 +677,6 @@ case $host in
+ 	;;
+       *)
+ 	path="arm"
+-	gcc_cflags_arch="-march=armv4"
+-	GMP_DEFINE_RAW(["define(<NOTHUMB>,1)"])
+ 	;;
+     esac
+     ;;
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/gmp/gmp_6.1.1.bb b/meta/recipes-support/gmp/gmp_6.1.1.bb
index 1df9b06..303c3ef 100644
--- a/meta/recipes-support/gmp/gmp_6.1.1.bb
+++ b/meta/recipes-support/gmp/gmp_6.1.1.bb
@@ -12,6 +12,7 @@ SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2 \
            file://amd64.patch \
            file://use-includedir.patch \
            file://0001-Append-the-user-provided-flags-to-the-auto-detected-.patch \
+           file://0001-confiure.ac-Believe-the-cflags-from-environment.patch \
            "
 
 SRC_URI[md5sum] = "4c175f86e11eb32d8bf9872ca3a8e11d"
-- 
2.9.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-12 18:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-12 18:10 [PATCH] gmp: Fix wrong detection of -march flag Khem Raj

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