From patchwork Sun Nov 23 17:36:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 413446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 2D4B1140081 for ; Mon, 24 Nov 2014 04:36:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 70BDAA2D37; Sun, 23 Nov 2014 17:36:24 +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 oEJ-_D3uRsgH; Sun, 23 Nov 2014 17:36:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 384EAA2BEF; Sun, 23 Nov 2014 17:36:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2C4921C28CA for ; Sun, 23 Nov 2014 17:36:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 27F0792092 for ; Sun, 23 Nov 2014 17:36:10 +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 6JbWgvm5eFix for ; Sun, 23 Nov 2014 17:36:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by whitealder.osuosl.org (Postfix) with ESMTP id A2D4192088 for ; Sun, 23 Nov 2014 17:36:09 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id F360430A; Sun, 23 Nov 2014 18:36:13 +0100 (CET) Received: from localhost (unknown [151.16.200.174]) by mail.free-electrons.com (Postfix) with ESMTPSA id A2EDF2F3; Sun, 23 Nov 2014 18:36:13 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Sun, 23 Nov 2014 18:36:03 +0100 Message-Id: <1416764163-12826-6-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1416764163-12826-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1416764163-12826-1-git-send-email-thomas.petazzoni@free-electrons.com> Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH 5/5] radvd: add a patch to fix build failure on architectures without sysctl() 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" Modern architectures such as ARC do not provide the sysctl() system call, since it is deprecated. However, uClibc still installs in such cases, which defeats radvd check for the availability of sysctl(). This commit adds a patch to radvd which improves the sysctl() checking. Fixes: http://autobuild.buildroot.org/results/458/4581c4220adeaebbf6761e3b923088d8de8522d5/ Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- ...0003-Improve-check-of-the-sysctl-function.patch | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 package/radvd/0003-Improve-check-of-the-sysctl-function.patch diff --git a/package/radvd/0003-Improve-check-of-the-sysctl-function.patch b/package/radvd/0003-Improve-check-of-the-sysctl-function.patch new file mode 100644 index 0000000..3053f7b --- /dev/null +++ b/package/radvd/0003-Improve-check-of-the-sysctl-function.patch @@ -0,0 +1,49 @@ +From 4c86b3cbf52f810615d92835e98d83e9555a4d88 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 23 Nov 2014 12:13:47 +0100 +Subject: [PATCH 3/3] Improve check of the sysctl() function + +Since sysctl is a deprecated system call, new architectures such as +ARC don't implement it. In such cases, uClibc installs the + header, but dos not implement the sysctl() +function. This has the annoying side effect of breaking the sysctl +detection of radvd, which is purely based on the header file being +present. + +To fix this, this commit adds a check based on the existence of the +sysctl() function. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 1 + + device-linux.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 5dde3b2..5518f71 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -161,6 +161,7 @@ AC_CHECK_HEADERS( \ + time.h \ + ) + AC_HEADER_TIME ++AC_CHECK_FUNCS([sysctl]) + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_MSG_CHECKING(whether struct sockaddr_in6 has sin6_scope_id) +diff --git a/device-linux.c b/device-linux.c +index 1ecaa6b..d9b56b8 100644 +--- a/device-linux.c ++++ b/device-linux.c +@@ -183,7 +183,7 @@ int check_ip6_forwarding(void) + value = -1; + } + +-#ifdef HAVE_SYS_SYSCTL_H ++#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTL) + int forw_sysctl[] = { SYSCTL_IP6_FORWARDING }; + size_t size = sizeof(value); + if (!fp && sysctl(forw_sysctl, sizeof(forw_sysctl) / sizeof(forw_sysctl[0]), &value, &size, NULL, 0) < 0) { +-- +2.1.0 +