diff mbox series

[oe,meta-oe,V2] iperf2: Fix build with latest libc++

Message ID 20190902232248.27969-1-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-oe,V2] iperf2: Fix build with latest libc++ | expand

Commit Message

Khem Raj Sept. 2, 2019, 11:22 p.m. UTC
Part of this patch was already there for gcc6 fix which was subsequenty
dropped in past iperf2 upgrades therefore
bring it back see 0647b7d6400b1c40fc6cb40596e56b852ceb85c5

Additionally check for stdbool.h being present on system

helps in fixing  build with latest clang/libc++

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
v2: Check and use stdbool.h if present

 ...nition-considering-stdbool.h-being-p.patch | 58 +++++++++++++++++++
 .../recipes-benchmark/iperf2/iperf2_2.0.13.bb |  4 +-
 2 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-benchmark/iperf2/iperf2/0001-Detect-bool-definition-considering-stdbool.h-being-p.patch

-- 
2.23.0

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-benchmark/iperf2/iperf2/0001-Detect-bool-definition-considering-stdbool.h-being-p.patch b/meta-oe/recipes-benchmark/iperf2/iperf2/0001-Detect-bool-definition-considering-stdbool.h-being-p.patch
new file mode 100644
index 0000000000..45c69ca067
--- /dev/null
+++ b/meta-oe/recipes-benchmark/iperf2/iperf2/0001-Detect-bool-definition-considering-stdbool.h-being-p.patch
@@ -0,0 +1,58 @@ 
+From 6df092a4153c6c37cfaddcabf2cd25a910a7f6e1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Sep 2019 15:40:52 -0700
+Subject: [PATCH] Detect bool definition considering stdbool.h being present
+
+This helps in defining the value correctly on different platforms e.g.
+clang/libc++ depends on the definition coming from stdbool.h
+current builds fail to compile therefore
+
+TMPDIR/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/iperf2/2.0.13-r0/recipe-sysroot/usr/include/c++/v1/type_traits:742:29: error: redefinition of '__libcpp_is_integral<int>'
+template <>          struct __libcpp_is_integral<int>                : public true_type {};
+                            ^~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ m4/dast.m4 | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/m4/dast.m4
++++ b/m4/dast.m4
+@@ -11,7 +11,12 @@ AH_TEMPLATE([false])
+ 
+ AC_DEFUN(DAST_CHECK_BOOL, [
+ 
+-AC_CHECK_SIZEOF(bool)
++if test "$ac_cv_header_stdbool_h" = yes; then
++  AC_CHECK_SIZEOF(bool,,[#include <stdbool.h>])
++else
++  AC_CHECK_SIZEOF(bool)
++fi
++
+ if test "$ac_cv_sizeof_bool" = 0 ; then
+   AC_DEFINE(bool, int)
+ fi
+--- a/configure.ac
++++ b/configure.ac
+@@ -113,7 +113,7 @@ AC_SEARCH_LIBS([socket], [socket], [],
+ 
+ dnl Checks for header files.
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
++AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h netdb.h netinet/in.h stdbool.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
+ 
+ dnl ===================================================================
+ dnl Checks for typedefs, structures
+--- a/include/util.h
++++ b/include/util.h
+@@ -56,7 +56,9 @@
+ #ifdef HAVE_CONFIG_H
+     #include "config.h"
+ #endif
+-
++#ifdef HAVE_STDBOOL_H
++# include <stdbool.h>
++#endif
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/meta-oe/recipes-benchmark/iperf2/iperf2_2.0.13.bb b/meta-oe/recipes-benchmark/iperf2/iperf2_2.0.13.bb
index 2bd552d1d8..4a520e3be5 100644
--- a/meta-oe/recipes-benchmark/iperf2/iperf2_2.0.13.bb
+++ b/meta-oe/recipes-benchmark/iperf2/iperf2_2.0.13.bb
@@ -4,7 +4,9 @@  SECTION = "console/network"
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=e136a7b2560d80bcbf0d9b3e1356ecff"
 
-SRC_URI = " ${SOURCEFORGE_MIRROR}/${BPN}/iperf-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/iperf-${PV}.tar.gz \
+           file://0001-Detect-bool-definition-considering-stdbool.h-being-p.patch \
+"
 
 SRC_URI[md5sum] = "31ea1c6d5cbf80b16ff3abe4288dad5e"
 SRC_URI[sha256sum] = "c88adec966096a81136dda91b4bd19c27aae06df4d45a7f547a8e50d723778ad"