From patchwork Tue Jan 22 08:01:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 1029118 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embedded.rocks Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43kLTh4j5Vz9s7T for ; Tue, 22 Jan 2019 19:01:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4BDC62377F; Tue, 22 Jan 2019 08:01:22 +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 SO35ky2bYmKc; Tue, 22 Jan 2019 08:01:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 9A8E322EE6; Tue, 22 Jan 2019 08:01:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 076B71BF5DB for ; Tue, 22 Jan 2019 08:01:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 047FF84475 for ; Tue, 22 Jan 2019 08:01:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RAgbxD7dNHwU for ; Tue, 22 Jan 2019 08:01:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by fraxinus.osuosl.org (Postfix) with ESMTPS id AF77D8444F for ; Tue, 22 Jan 2019 08:01:14 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id D44382400E6 for ; Tue, 22 Jan 2019 09:01:11 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 43kLTL6QvFz9rxH for ; Tue, 22 Jan 2019 09:01:10 +0100 (CET) Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id B5vfXM-8CUzg; Tue, 22 Jan 2019 09:01:09 +0100 (CET) Received: from nzxt.fritz.box (port-92-195-7-31.dynamic.qsc.de [92.195.7.31]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Tue, 22 Jan 2019 09:01:09 +0100 (CET) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Tue, 22 Jan 2019 09:01:05 +0100 Message-Id: <20190122080105.12748-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/wavemon: add upstream patch to fix musl/uclibc build issue X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In version 0.9.0 wavemon uses the GLIBC-specific extension `on_exit()` which is not available in musl and uClibc. According to the Linux kernel man page [1]: "Portable application should avoid this function, and use the standard atexit(3) instead." Add patch from upstream which is fixing this issue by dropping `on_exit()` and using the standard `atexit()` instead. Note, that the commit message of the upstream patch was changed to add some useful information. [1] http://man7.org/linux/man-pages/man3/on_exit.3.html Backported from: f6e20c9c6e9b50963caaf5483248d329473a6815 Fixes: http://autobuild.buildroot.net/results/ae54441c65fe9a1bdcf743aa7f6a208e5545ca29 http://autobuild.buildroot.net/results/40fd66e6a351a1acd537ade715ab3e993eddb1c1 Signed-off-by: Jörg Krause --- ...-on_exit-use-standard-atexit-instead.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 package/wavemon/0001-Drop-on_exit-use-standard-atexit-instead.patch diff --git a/package/wavemon/0001-Drop-on_exit-use-standard-atexit-instead.patch b/package/wavemon/0001-Drop-on_exit-use-standard-atexit-instead.patch new file mode 100644 index 0000000000..67292539ca --- /dev/null +++ b/package/wavemon/0001-Drop-on_exit-use-standard-atexit-instead.patch @@ -0,0 +1,73 @@ +From f6e20c9c6e9b50963caaf5483248d329473a6815 Mon Sep 17 00:00:00 2001 +From: Gerrit Renker +Date: Mon, 21 Jan 2019 09:23:43 -0700 +Subject: [PATCH] Drop on_exit(), use standard atexit() instead +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +`on_exit()` is a GLIBC specific extension and not available in musl and uClibc. + +Portable applications should avoid this function, and use the standard +`atexit()` instead. + +Backported from:f6e20c9c6e9b50963caaf5483248d329473a6815 + +Signed-off-by: Jörg Krause +--- + iw_if.c | 10 ++++++---- + iw_if.h | 2 +- + iw_scan.c | 2 +- + 3 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/iw_if.c b/iw_if.c +index c0b0128..d8bacbc 100644 +--- a/iw_if.c ++++ b/iw_if.c +@@ -87,11 +87,13 @@ int if_set_down(const char *ifname) + return if_set_up_or_down(ifname, false); + } + +-/** Exit handler to restore interface 'down' state on exit via on_exit(3). */ +-void if_set_down_on_exit(int rc, void *arg) ++/** Exit handler to restore interface 'down' state on exit via atexit(3). */ ++void if_set_down_on_exit(void) + { +- if (if_set_down(arg) < 0) { +- err_msg("unable to restore %s interface state - set down manually", arg); ++ const char *ifname = conf_ifname(); ++ ++ if (ifname && if_set_down(ifname) < 0) { ++ err_msg("unable to restore %s interface state - set down manually", ifname); + } + } + +diff --git a/iw_if.h b/iw_if.h +index 50f5a47..e2199d3 100644 +--- a/iw_if.h ++++ b/iw_if.h +@@ -76,7 +76,7 @@ struct if_info { + }; + extern bool if_is_up(const char *ifname); + extern int if_set_up(const char *ifname); +-extern void if_set_down_on_exit(int rc, void *arg); ++extern void if_set_down_on_exit(void); + extern void if_getinf(const char *ifname, struct if_info *info); + + /** +diff --git a/iw_scan.c b/iw_scan.c +index 18e9e06..e2b3067 100644 +--- a/iw_scan.c ++++ b/iw_scan.c +@@ -430,7 +430,7 @@ void *do_scan(void *sr_ptr) + + if (if_set_up(conf_ifname()) < 0) + err_sys("Can not bring up interface '%s'", conf_ifname()); +- if (on_exit(if_set_down_on_exit, (void *)conf_ifname()) < 0) ++ if (atexit(if_set_down_on_exit) < 0) + snprintf(sr->msg, sizeof(sr->msg), "Warning: unable to restore %s down state on exit", conf_ifname()); + break; + } +-- +2.20.1 +