From 69e888a8338e9935cdb7959dffe08d540a42eece Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 13 Mar 2017 22:49:54 -0700 Subject: m4: Fix build with clang especially on armv7 Signed-off-by: Khem Raj --- conf/nonclangable.conf | 1 - .../m4/m4/disable_builtin_mul_overflow.patch | 19 +++++++++++++++++++ recipes-devtools/m4/m4_%.bbappend | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 recipes-devtools/m4/m4/disable_builtin_mul_overflow.patch create mode 100644 recipes-devtools/m4/m4_%.bbappend diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index d09b212..b4f8ca8 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -41,7 +41,6 @@ TOOLCHAIN_pn-libvorbis = "gcc" # DO_NEXT_OP(len); TOOLCHAIN_pn-mozjs = "gcc" -TOOLCHAIN_pn-m4 = "gcc" TOOLCHAIN_pn-mtools = "gcc" TOOLCHAIN_pn-openssl = "gcc" TOOLCHAIN_pn-openjdk-8 = "gcc" diff --git a/recipes-devtools/m4/m4/disable_builtin_mul_overflow.patch b/recipes-devtools/m4/m4/disable_builtin_mul_overflow.patch new file mode 100644 index 0000000..1fe1beb --- /dev/null +++ b/recipes-devtools/m4/m4/disable_builtin_mul_overflow.patch @@ -0,0 +1,19 @@ +clang/arm has this issue where it generates call to __mulodi4 +which is only in compiler-rt and we end with errors + +/usr/src/debug/m4/1.4.18-r0/build/src/../../m4-1.4.18/lib/xalloc.h:107: undefined reference to `__mulodi4' + + +Index: m4-1.4.18/lib/xalloc-oversized.h +=================================================================== +--- m4-1.4.18.orig/lib/xalloc-oversized.h ++++ m4-1.4.18/lib/xalloc-oversized.h +@@ -52,7 +52,7 @@ typedef size_t __xalloc_count_type; + #elif ((5 <= __GNUC__ \ + || (__has_builtin (__builtin_mul_overflow) \ + && __has_builtin (__builtin_constant_p))) \ +- && !__STRICT_ANSI__) ++ && !__STRICT_ANSI__ && !__clang__) + # define xalloc_oversized(n, s) \ + (__builtin_constant_p (n) && __builtin_constant_p (s) \ + ? __xalloc_oversized (n, s) \ diff --git a/recipes-devtools/m4/m4_%.bbappend b/recipes-devtools/m4/m4_%.bbappend new file mode 100644 index 0000000..e00f7c4 --- /dev/null +++ b/recipes-devtools/m4/m4_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://disable_builtin_mul_overflow.patch" -- cgit v1.2.3-54-g00ecf