From patchwork Tue Jul 28 16:17:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Heading X-Patchwork-Id: 501298 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 969EA140AF3 for ; Wed, 29 Jul 2015 02:17:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=qhAR24CB; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 73B413334A; Tue, 28 Jul 2015 16:17:37 +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 WQb0yJRszkFf; Tue, 28 Jul 2015 16:17:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2DFCF333C4; Tue, 28 Jul 2015 16:17:30 +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 21DCE1C13C0 for ; Tue, 28 Jul 2015 16:17:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1EF3C91A6E for ; Tue, 28 Jul 2015 16:17:29 +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 iVdf0auZR18J for ; Tue, 28 Jul 2015 16:17:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1327591A86 for ; Tue, 28 Jul 2015 16:17:28 +0000 (UTC) Received: by wibxm9 with SMTP id xm9so168266175wib.1 for ; Tue, 28 Jul 2015 09:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=4XJMf4xCyFuBblXeOfThA+yvJzvJz7RuIGOsauglg5E=; b=qhAR24CBlxKdfT0p1XUi9QB+6dy0xLBjmBof1tQovZLLBRO5o5RenA0bfFqQcEVufN vDTUXf7uWqudoSOMxfjVTzsrSpKH2t4BiuAbfEQqY0/Ii7DjwBJOSVx4lvd0JRoQ2D7E xgOiRocZZtcc8Kg5tASYq6jCbJUc7x32Ox9QgrnetEjNgYBDISd+QbKyvdQjPdy7cYHQ lBJHmfAAcrMEkdyoHd7HqJ6oXKB19v28qA/Tq2/uG00Izz9jBD09+/tcqhl9bI7Q897k qwcT5QJdwC4dpl1YixX0+WGz0yRAV8QUOT58njqrtn2Odmtwr6aeyxST2IvC3SGYosoN v6sg== X-Received: by 10.180.208.114 with SMTP id md18mr36067563wic.31.1438100246647; Tue, 28 Jul 2015 09:17:26 -0700 (PDT) Received: from bhfedora.localdomain ([82.15.84.251]) by smtp.gmail.com with ESMTPSA id c11sm19780690wib.1.2015.07.28.09.17.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 09:17:25 -0700 (PDT) From: Brendan Heading To: buildroot@buildroot.org Date: Tue, 28 Jul 2015 17:17:22 +0100 Message-Id: <1438100242-11161-1-git-send-email-brendanheading@gmail.com> X-Mailer: git-send-email 2.4.3 Cc: Brendan Heading Subject: [Buildroot] [PATCH 1/1] package/acpid: fix musl build problem 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" Fixes http://autobuild.buildroot.net/results/7e6/7e60af535dd4177afdc4cb7b92e9abf27c3fba07 acpid uses TEMP_FAILURE_RETRY which is a glibc feature. patch adds this macro if it is not present and __GLIBC__ is undefined. Patch submitted upstream. Signed-off-by: Brendan Heading --- .../acpid/0003-support-for-non-glibc-libcs.patch | 184 +++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 package/acpid/0003-support-for-non-glibc-libcs.patch diff --git a/package/acpid/0003-support-for-non-glibc-libcs.patch b/package/acpid/0003-support-for-non-glibc-libcs.patch new file mode 100644 index 0000000..f152d32 --- /dev/null +++ b/package/acpid/0003-support-for-non-glibc-libcs.patch @@ -0,0 +1,184 @@ +From a3dac1c3cee169e52c7d644dd565235a1cd833e3 Mon Sep 17 00:00:00 2001 +From: Brendan Heading +Date: Wed, 22 Jul 2015 23:10:11 +0100 +Subject: [PATCH] support for non-glibc libcs + +Added a TEMP_FAILURE_RETRY macro. This is a glibcism provided by +glibc and uclibc, but missing from musl (& possibly other libcs). + +Upstream-status: submitted (see https://sourceforge.net/p/acpid2/tickets/7/) +--- + acpi_listen.c | 2 ++ + acpid.c | 1 + + event.c | 2 ++ + input_layer.c | 1 + + kacpimon/libnetlink.h | 2 ++ + libc_compat.h | 40 ++++++++++++++++++++++++++++++++++++++++ + libnetlink.c | 2 ++ + netlink.c | 1 + + proc.c | 1 + + ud_socket.c | 1 + + 10 files changed, 53 insertions(+) + create mode 100644 libc_compat.h + +diff --git a/acpi_listen.c b/acpi_listen.c +index d0bc175..839e4f9 100644 +--- a/acpi_listen.c ++++ b/acpi_listen.c +@@ -39,6 +39,8 @@ + #include "acpid.h" + #include "ud_socket.h" + ++#include "libc_compat.h" ++ + static int handle_cmdline(int *argc, char ***argv); + static char *read_line(int fd); + +diff --git a/acpid.c b/acpid.c +index 23f1e58..8555c82 100644 +--- a/acpid.c ++++ b/acpid.c +@@ -41,6 +41,7 @@ + #include "input_layer.h" + #include "inotify_handler.h" + #include "netlink.h" ++#include "libc_compat.h" + + static int handle_cmdline(int *argc, char ***argv); + static void close_fds(void); +diff --git a/event.c b/event.c +index 324078f..3b069a2 100644 +--- a/event.c ++++ b/event.c +@@ -39,6 +39,8 @@ + #include "log.h" + #include "sock.h" + #include "ud_socket.h" ++#include "libc_compat.h" ++ + #include "event.h" + /* + * What is a rule? It's polymorphic, pretty much. +diff --git a/input_layer.c b/input_layer.c +index 9aa19c6..cbf8085 100644 +--- a/input_layer.c ++++ b/input_layer.c +@@ -42,6 +42,7 @@ + #include "log.h" + #include "connection_list.h" + #include "event.h" ++#include "libc_compat.h" + + #include "input_layer.h" + +diff --git a/kacpimon/libnetlink.h b/kacpimon/libnetlink.h +index 6185cbc..0c61896 100644 +--- a/kacpimon/libnetlink.h ++++ b/kacpimon/libnetlink.h +@@ -7,6 +7,8 @@ + #include + #include + ++#include "libc_compat.h" ++ + struct rtnl_handle + { + int fd; +diff --git a/libc_compat.h b/libc_compat.h +new file mode 100644 +index 0000000..39f2336 +--- /dev/null ++++ b/libc_compat.h +@@ -0,0 +1,40 @@ ++/* ++ * libc_compat.h - implement defs/macros missing from some libcs ++ * ++ * Copyright (C) 1999-2000 Andrew Henroid ++ * Copyright (C) 2001 Sun Microsystems ++ * Portions Copyright (C) 2004 Tim Hockin (thockin@hockin.org) ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef LIBC_COMPAT_H__ ++#define LIBC_COMPAT_H__ ++ ++/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' ++ set to EINTR. This macro is present on glibc/uclibc but may not be in other cases. */ ++ ++#ifndef ____GLIBC__ ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++#endif /* __GLIBC__ */ ++ ++#endif /* LIBC_COMPAT_H__ */ +diff --git a/libnetlink.c b/libnetlink.c +index e61d417..cc7aedc 100644 +--- a/libnetlink.c ++++ b/libnetlink.c +@@ -24,6 +24,8 @@ + #include + #include + ++#include "libc_compat.h" ++ + #include "libnetlink.h" + + void rtnl_close(struct rtnl_handle *rth) +diff --git a/netlink.c b/netlink.c +index c64e878..27e3536 100644 +--- a/netlink.c ++++ b/netlink.c +@@ -41,6 +41,7 @@ + #include "libnetlink.h" + #include "genetlink.h" + #include "acpi_genetlink.h" ++#include "libc_compat.h" + + #include "acpi_ids.h" + #include "connection_list.h" +diff --git a/proc.c b/proc.c +index 5bb8fa2..f96b913 100644 +--- a/proc.c ++++ b/proc.c +@@ -31,6 +31,7 @@ + #include "log.h" + #include "event.h" + #include "connection_list.h" ++#include "libc_compat.h" + + #include "proc.h" + +diff --git a/ud_socket.c b/ud_socket.c +index 2790686..1790917 100644 +--- a/ud_socket.c ++++ b/ud_socket.c +@@ -21,6 +21,7 @@ + #include "acpid.h" + #include "log.h" + #include "ud_socket.h" ++#include "libc_compat.h" + + int + ud_create_socket(const char *name, mode_t socketmode) +-- +2.4.3 +