From patchwork Mon Mar 21 11:53:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 600081 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 3qTDlj0fLfz9s5J for ; Mon, 21 Mar 2016 22:54:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=A8h5M5hZ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2412B31342; Mon, 21 Mar 2016 11:54:56 +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 skDbcGZaZu0U; Mon, 21 Mar 2016 11:54:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id BE39931DCF; Mon, 21 Mar 2016 11:54:53 +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 4A6B61C10E7 for ; Mon, 21 Mar 2016 11:54:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 44D828896F for ; Mon, 21 Mar 2016 11:54:52 +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 GrC7Au-0nOUV for ; Mon, 21 Mar 2016 11:54:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id 670218BC51 for ; Mon, 21 Mar 2016 11:54:50 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id l68so106668621wml.0 for ; Mon, 21 Mar 2016 04:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=w/WnGfP0o5jlOJLKviNkUKMtAuVQ5dqLaAO9tR6ZS7w=; b=A8h5M5hZkDC8Qbjyyb/ZpxlFa5PBTAvXltjvuBFCZc88/OnTnXMhgGun6Ows3E1bqB Z4HqtEeOy/zWnNDICWzk6vpX3jlcJ5f+Qeg5Tj8e/KgFhjL5AWOhzF5qZ0h4Fo297ah0 tPDyKhZWwy840B58RMN04an1ld75FdU17SUdd1eWDHdE6aIcpiivTv1AWwDVkw0pizwS ajU0lpsD1JeD3u04XmezI3QiZo3OtC37k3C7xKts0YyWI4QLaVx6NicxaWdFIIP9d1gX ttn1dTh4kb933FXfruJ6kQzFjRuyMPLI7FxMZTh+sgUSKqP6mmIPRImzwPyEER2/vTgV UuZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=w/WnGfP0o5jlOJLKviNkUKMtAuVQ5dqLaAO9tR6ZS7w=; b=c3/VoipQ4pqwdICxgNlcd0Yu89qQZTdc4WQdPojaZlz7yb2iUFjDU4ROAamNCnIOL3 GCJ2fQLEbzwWZW26fM+Yf6nNH+T+pkg1ZkP2TNo+bFUuBpyCxg5yXPrDJBvPTCm+/kcA sjdAS7DGcMq9eHRUtlkFLvDP+1qOL24OET4zn8+h9WWNq8Dsz6zRRptZ2gInSNw9eZeI olelgraQkwIMduNo262Jx14CHizPxkydJUOhD/KZskYC98QkmaYplu169qBvigyjiFYZ JPKNkoFIecyRddWJn0JqOwIKrNkJ5lKhGAPqIB1qYB1A9c/z9fN/V4qZcWAxKdmgojqF CSyg== X-Gm-Message-State: AD7BkJLwesjvm4jDmIVBdoaqMSuMvd/kzZqKu5RePzxJQhfKrlOAnQRNJOVCiYUu1krhIQ== X-Received: by 10.28.21.14 with SMTP id 14mr12981134wmv.39.1458561289011; Mon, 21 Mar 2016 04:54:49 -0700 (PDT) Received: from development1.visionsystems.de (mail.visionsystems.de. [213.209.99.202]) by smtp.gmail.com with ESMTPSA id w133sm12099995wmd.3.2016.03.21.04.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Mar 2016 04:54:47 -0700 (PDT) From: yegorslists@googlemail.com To: buildroot@busybox.net Date: Mon, 21 Mar 2016 12:53:39 +0100 Message-Id: <1458561219-28017-1-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 2.1.4 Subject: [Buildroot] [PATCH] pppd: fix MUSL build 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" From: Yegor Yefremov Apply a patch provided by OpemEmbedded: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch This patch separates glibc related includes/defines from non-glibc, like including sys/cdefs.h etc. Fixes: http://autobuild.buildroot.net/results/24c/24c8316e579965deb408caef8b4fc81ca8119a70/ Signed-off-by: Yegor Yefremov --- package/pppd/0001-Fix-build-with-musl.patch | 161 ++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 package/pppd/0001-Fix-build-with-musl.patch diff --git a/package/pppd/0001-Fix-build-with-musl.patch b/package/pppd/0001-Fix-build-with-musl.patch new file mode 100644 index 0000000..a1aeeb3 --- /dev/null +++ b/package/pppd/0001-Fix-build-with-musl.patch @@ -0,0 +1,161 @@ +From 473f60b1dfcd287bc9d40a69a9c614579d0f64bf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 May 2015 14:57:05 -0700 +Subject: [PATCH] Fix build with musl + +There are several assumption about glibc + +Signed-off-by: Khem Raj +--- + include/net/ppp_defs.h | 2 ++ + pppd/Makefile.linux | 2 +- + pppd/magic.h | 6 +++--- + pppd/plugins/rp-pppoe/config.h | 5 ++++- + pppd/plugins/rp-pppoe/plugin.c | 1 - + pppd/plugins/rp-pppoe/pppoe-discovery.c | 8 ++++---- + pppd/plugins/rp-pppoe/pppoe.h | 2 +- + pppd/sys-linux.c | 3 ++- + 8 files changed, 17 insertions(+), 12 deletions(-) + +diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h +index b06eda5..dafa36c 100644 +--- a/include/net/ppp_defs.h ++++ b/include/net/ppp_defs.h +@@ -38,6 +38,8 @@ + #ifndef _PPP_DEFS_H_ + #define _PPP_DEFS_H_ + ++#include ++ + /* + * The basic PPP frame. + */ +diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux +index a74c914..7acd2cf 100644 +--- a/pppd/Makefile.linux ++++ b/pppd/Makefile.linux +@@ -126,7 +126,7 @@ LIBS += -lcrypt + endif + + ifdef USE_LIBUTIL +-CFLAGS += -DHAVE_LOGWTMP=1 ++#CFLAGS += -DHAVE_LOGWTMP=1 + LIBS += -lutil + endif + +diff --git a/pppd/magic.h b/pppd/magic.h +index c81213b..9d399e3 100644 +--- a/pppd/magic.h ++++ b/pppd/magic.h +@@ -42,8 +42,8 @@ + * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ + */ + +-void magic_init __P((void)); /* Initialize the magic number generator */ +-u_int32_t magic __P((void)); /* Returns the next magic number */ ++void magic_init (void); /* Initialize the magic number generator */ ++u_int32_t magic (void); /* Returns the next magic number */ + + /* Fill buffer with random bytes */ +-void random_bytes __P((unsigned char *buf, int len)); ++void random_bytes (unsigned char *buf, int len); +diff --git a/pppd/plugins/rp-pppoe/config.h b/pppd/plugins/rp-pppoe/config.h +index 5703087..fff032e 100644 +--- a/pppd/plugins/rp-pppoe/config.h ++++ b/pppd/plugins/rp-pppoe/config.h +@@ -78,8 +78,9 @@ + #define HAVE_NET_IF_ARP_H 1 + + /* Define if you have the header file. */ ++#ifdef __GLIBC__ + #define HAVE_NET_ETHERNET_H 1 +- ++#endif + /* Define if you have the header file. */ + #define HAVE_NET_IF_H 1 + +@@ -102,7 +103,9 @@ + #define HAVE_NETPACKET_PACKET_H 1 + + /* Define if you have the header file. */ ++#ifdef __GLIBC__ + #define HAVE_SYS_CDEFS_H 1 ++#endif + + /* Define if you have the header file. */ + /* #undef HAVE_SYS_DLPI_H */ +diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c +index a8c2bb4..ca34d79 100644 +--- a/pppd/plugins/rp-pppoe/plugin.c ++++ b/pppd/plugins/rp-pppoe/plugin.c +@@ -46,7 +46,6 @@ static char const RCSID[] = + #include + #include + #include +-#include + #include + #include + #include +diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c +index 3d3bf4e..d42f619 100644 +--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c ++++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c +@@ -27,10 +27,6 @@ + #include + #endif + +-#ifdef HAVE_NET_ETHERNET_H +-#include +-#endif +- + #ifdef HAVE_ASM_TYPES_H + #include + #endif +@@ -47,6 +43,10 @@ + #include + #endif + ++#ifndef __GLIBC__ ++#define error(x...) fprintf(stderr, x) ++#endif ++ + char *xstrdup(const char *s); + void usage(void); + +diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h +index 9ab2eee..75b9004 100644 +--- a/pppd/plugins/rp-pppoe/pppoe.h ++++ b/pppd/plugins/rp-pppoe/pppoe.h +@@ -92,7 +92,7 @@ typedef unsigned long UINT32_t; + #ifdef HAVE_SYS_SOCKET_H + #include + #endif +-#ifndef HAVE_SYS_DLPI_H ++#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H + #include + #endif + #endif +diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c +index e5e9baf..1008cb1 100644 +--- a/pppd/sys-linux.c ++++ b/pppd/sys-linux.c +@@ -112,7 +112,7 @@ + #include + #include + #include +-#include ++/* #include */ + #include + #endif + #include +@@ -145,6 +145,7 @@ + #endif + + #ifdef INET6 ++#include + #ifndef _LINUX_IN6_H + /* + * This is in linux/include/net/ipv6.h. +-- +2.1.4 +