From patchwork Thu Dec 24 11:34:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 560890 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 199A6140C38 for ; Thu, 24 Dec 2015 22:34:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=W+5anf0D; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1450433164; Thu, 24 Dec 2015 11:34:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5H0Mkv+GdngN; Thu, 24 Dec 2015 11:34:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3197232CF8; Thu, 24 Dec 2015 11:34:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 19A291C1714 for ; Thu, 24 Dec 2015 11:34:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 14B119288E for ; Thu, 24 Dec 2015 11:34:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lCh8p6GxPqql for ; Thu, 24 Dec 2015 11:34:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2266392882 for ; Thu, 24 Dec 2015 11:34:35 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id l126so181815396wml.1 for ; Thu, 24 Dec 2015 03:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=FAErnt2LmGq/fXo0uGdwEzobtlUxzXs32GieQBUBKy0=; b=W+5anf0D8vpRklchjRhh1MGK6Rgt77e0Io4amOS0dgwBw3kA4Apb5LHRGo5hC2UAja V6/3Hwi+L5T698BmH/9GUHHMvm3t3rDZ//lFQ7OYwshoiPUIVfWBvkXKap3ZEDlQ/vdB yr8O9EPW1rbR/0RbfcP8sihLj065yPLDVLl6O89ZvxnCvIISxA1fCHuPsJbzKME2L8Nu GDB9pI+rm7aexf7EveUuaBUPqUurHsdVnfcpcJzcKM9hHnE6VnAIjnKUo176qb5bazvx MyiZA+Q6eNtQa6V6z+4TunqdalDmfTiBMg3M0Va7xAtw+qvHFE7cSrSJbLlF64i0OO3f ZXuw== X-Received: by 10.28.216.72 with SMTP id p69mr42060031wmg.14.1450956873589; Thu, 24 Dec 2015 03:34:33 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id lx4sm41269031wjb.5.2015.12.24.03.34.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Dec 2015 03:34:32 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Thu, 24 Dec 2015 12:34:27 +0100 Message-Id: <1450956867-15532-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH] package/connman: cleanup backtrace patch X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" connman uses execinfo.h to dump a backtrace in case of failure. execinfo.h is optional in uClibc, so we had a patch that conditonally disabled backtraces for uClibc when it was missing execinfo.h However, musl is also entirely lacking execinfo.h. Add a proper patch that checks for execinfo.h at ./configure time. This will no longer make any assumption on the C library that is being used. Fixes: http://autobuild.buildroot.org/results/f6e/f6ee8ab3a6300f1f527f9e92b8c2ec81e63afb27/ http://autobuild.buildroot.org/results/96b/96b78bb644ed4ef3493782521b17e3b2113a405f/ ... Note that there might be other issues with musl; this patch only fiexes the execinfo.h one. Signed-off-by: "Yann E. MORIN" --- package/connman/0001-conditional-backtrace.patch | 74 ++++++++++++++++++++++++ package/connman/0001-uclibc-backtrace.patch | 44 -------------- 2 files changed, 74 insertions(+), 44 deletions(-) create mode 100644 package/connman/0001-conditional-backtrace.patch delete mode 100644 package/connman/0001-uclibc-backtrace.patch diff --git a/package/connman/0001-conditional-backtrace.patch b/package/connman/0001-conditional-backtrace.patch new file mode 100644 index 0000000..231eda2 --- /dev/null +++ b/package/connman/0001-conditional-backtrace.patch @@ -0,0 +1,74 @@ +commit 13cfdf6b01651b0e3d07455ed69f5c328642982e +Author: Yann E. MORIN +Date: Thu Dec 24 12:04:57 2015 +0100 + + configure: check for execinfo.h + + Not all toolchains have execinfo.h. For example, support for it is + optional in uClibc, while it is entirely missing from musl. + + Add a check in configure to look for it. + + Since execinfo.h is /only/ used to dump a backtrace in case of failure, + just do nothing when execinfo.h is missing. + + Signed-off-by: "Yann E. MORIN" + +diff --git a/Makefile.am b/Makefile.am +index fb7c74e..ef02cf5 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -210,7 +210,8 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" \ + -DSTORAGEDIR=\""$(storagedir)\"" \ + -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \ +- -DCONFIGDIR=\""$(configdir)\"" ++ -DCONFIGDIR=\""$(configdir)\"" \ ++ -DHAVE_BACKTRACE=$(HAVE_BACKTRACE) + + if VPN + AM_CPPFLAGS = -I$(builddir)/include -I$(srcdir)/gdbus +diff --git a/configure.ac b/configure.ac +index b51d6b3..87701d0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -182,6 +182,9 @@ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [ + AC_MSG_ERROR(resolver library support is required)) + ]) + ++AC_CHECK_HEADERS([execinfo.h],[HAVE_BACKTRACE=1], HAVE_BACKTRACE=0) ++AC_SUBST([HAVE_BACKTRACE]) ++ + AC_CHECK_FUNC(signalfd, dummy=yes, + AC_MSG_ERROR(signalfd support is required)) + +diff --git a/src/log.c b/src/log.c +index a693bd0..69ab50e 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -30,7 +30,9 @@ + #include + #include + #include ++#if defined(HAVE_BACKTRACE) && HAVE_BACKTRACE == 1 + #include ++#endif + #include + + #include "connman.h" +@@ -112,6 +114,7 @@ void connman_debug(const char *format, ...) + + static void print_backtrace(unsigned int offset) + { ++#if defined(HAVE_BACKTRACE) && HAVE_BACKTRACE == 1 + void *frames[99]; + size_t n_ptrs; + unsigned int i; +@@ -210,6 +213,7 @@ static void print_backtrace(unsigned int offset) + + close(outfd[1]); + close(infd[0]); ++#endif /* HAVE_BACKTRACE */ + } + + static void signal_handler(int signo) diff --git a/package/connman/0001-uclibc-backtrace.patch b/package/connman/0001-uclibc-backtrace.patch deleted file mode 100644 index 4b806c6..0000000 --- a/package/connman/0001-uclibc-backtrace.patch +++ /dev/null @@ -1,44 +0,0 @@ -[PATCH] fix build on uClibc without UCLIBC_HAS_BACKTRACE - -Backtrace support is only used for logging on signal errors, which -isn't really critical, so simply remove backtrace info if not -available in uClibc. - -Signed-off-by: Peter Korsgaard ---- - src/log.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -Index: connman-0.78/src/log.c -=================================================================== ---- connman-0.78.orig/src/log.c -+++ connman-0.78/src/log.c -@@ -30,7 +30,12 @@ - #include - #include - #include -+#include -+/* backtrace support is optional on uClibc */ -+#if !(defined(__UCLIBC__) && !defined (__UCLIBC_HAS_BACKTRACE__)) -+#define HAVE_BACKTRACE - #include -+#endif - #include - - #include "connman.h" -@@ -112,6 +117,7 @@ - - static void print_backtrace(unsigned int offset) - { -+#ifdef HAVE_BACKTRACE - void *frames[99]; - size_t n_ptrs; - unsigned int i; -@@ -210,6 +216,7 @@ - - close(outfd[1]); - close(infd[0]); -+#endif /* HAVE_BACKTRACE */ - } - - static void signal_handler(int signo)