From patchwork Sat Jul 22 16:50:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 108523 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2158158qge; Sat, 22 Jul 2017 09:51:20 -0700 (PDT) X-Received: by 10.84.171.132 with SMTP id l4mr12487984plb.175.1500742280537; Sat, 22 Jul 2017 09:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500742280; cv=none; d=google.com; s=arc-20160816; b=NWXvMguWpPz1fbUPPvbB2f6PR/AHCusMXGjwO0t+2XBAoFKQB5QeAyfEme5j40OX42 ce6fX8BSSoTZGbUJNl/q3LDd8ZufHim1Rwe8pIO1mZxHJhlMIFIELfP5h4UBCIoh/+n3 3PRp/pkxyZYgGO5QJr6LhvFWJQUbSjFs2wx/d1HRfi4txYCxS9WjN65ZwOJM6pp91lqM vWnkkao/lePhJStHjiMBZVxh5U/wNzlLaSqkviNzi1BQosTOyF0k1Kstha6hesHn3RRn mGbnv1wtqmEGyjC0AIcP6C3n1E79rJlVyWcWtmHEs6zIDBVofvQzXb1F+OD6AwoiXlRc cyuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=DL+BDqLIWQ6gQYdhbsvJBuHiq2NFCQ4oiELUECvFxXg=; b=uHKP70kd86gxiBkinl3UvyLqpW9CXV1an8N5YrX+RJoz/g0ZuEimo9ZG7ccjuotdAa yFyKYNi4KoPwc9HTlY1PrsvCQKOzegVH6ghEvSbJ3rRguZ7El1PaR0sLexGAEgTpUqEi PBc/JhTF0NwUVwO0qQHnjiHHjwETk/BqcqdvrZGGSAwv2R0r7BOrXko0czoMH1V34Xpt uLNoiFgGsMwHma7UdMEHNCxzyqXM8IompSCcNknQR0zglkU0H2mA2N3JcJm5PuIiW0n8 AQFkj4S/OTYsXDlHEC7nr4ThC7LjnMyRFPA1MklqPvPJ3iOCHbbK26HJnj7ZER+XNahq rCIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=KvsE5sTT; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id y7si4587667pgq.578.2017.07.22.09.51.20; Sat, 22 Jul 2017 09:51:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=KvsE5sTT; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 8E0147845E; Sat, 22 Jul 2017 16:51:17 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by mail.openembedded.org (Postfix) with ESMTP id 3261A78449 for ; Sat, 22 Jul 2017 16:51:01 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id q85so7117366pfq.2 for ; Sat, 22 Jul 2017 09:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CJHxdEDvnTigaLOKYdmh7HOZ84VQtMx0WnAULO2D9kM=; b=KvsE5sTT3uSdsw5/b6AYjhkLbfvVKaxBWPvwaSv6YgJHT7tQ2WxSuYI2IcWFEcbqfE vKc54e2jymPZrF6vHm6/dkuyES97indOs5cb15g5/7UQnzZzl9c0Gf0KO/lk1CJF45Hu WkcvkItRQI/U4x0dREvaR0QIJT945QqvfiFCoR/aZFJpvV6RzYsXDQOKlF9+CRx3q+mT 5khFmqF0VUEHUBWkWwORaZKIFAe/cKFxZTJ7qY8C4eQQmuZzzmzunjqBsX/+18G2pTyJ 46LIomb8wvq7W0nZcoKeKcFtbx7U+SU1xEA2jyHFmXad/bgcooKOnYsIdFtBkOfFx7TV +Exw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CJHxdEDvnTigaLOKYdmh7HOZ84VQtMx0WnAULO2D9kM=; b=EZ0gdrp2snX8JSEaSOKrvLJiB0zfX1lVra8gWMa7qt6vefXVdfC4qYZjUnJkZJeIbn 7gePRE7MgyPYzYVd8e1AfNPamoQf8QwowLbECvs6zqsjW/4Qb0aAWwNS6Ik+89bZa718 xyxkAfhPHxUtfXd3dGuuOiy1MZ1FP+K1R6KmchyCse9dNy3bVL5/BOLLUpn9lbB3lbq0 5T+St6a5zOoR8Sn4LVmIG6Gk6wr/cmdWV6eoYEolfYn1ex1Yr73inwH9Zi6j8ZzqL+ml hWM+o+5aTL++v2gL7lmGvc1GkjBjOHm79FzknXiiNk0k5yKtQx3t7+uSI3NMeN+ucLfT piBQ== X-Gm-Message-State: AIVw112s+tFBZ/Utja4CoV0Inh0BfKKjgFs8TqKaE8AaetOW58fxzz4X /8GrkcaZ3aE3UQJl X-Received: by 10.84.253.2 with SMTP id z2mr7010308pll.464.1500742262420; Sat, 22 Jul 2017 09:51:02 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c:6245:cbff:fe64:591]) by smtp.gmail.com with ESMTPSA id o10sm15628924pgc.81.2017.07.22.09.51.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jul 2017 09:51:01 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Sat, 22 Jul 2017 09:50:43 -0700 Message-Id: <20170722165045.44735-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170722165045.44735-1-raj.khem@gmail.com> References: <20170722165045.44735-1-raj.khem@gmail.com> Subject: [oe] [meta-networking][PATCH 2/4] openflow: Fix build with musl X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org Regenerate configure before running oe_runconf Signed-off-by: Khem Raj --- .../recipes-protocols/openflow/openflow.inc | 3 +- ...use-strlcpy-from-libc-before-defining-own.patch | 64 ++++++++++++++++++++++ ...lib-netdev-Adjust-header-include-sequence.patch | 59 ++++++++++++++++++++ .../recipes-protocols/openflow/openflow_git.bb | 5 ++ 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch create mode 100644 meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch -- 2.13.3 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel diff --git a/meta-networking/recipes-protocols/openflow/openflow.inc b/meta-networking/recipes-protocols/openflow/openflow.inc index 0ae2d1f1d..cccbfa19a 100644 --- a/meta-networking/recipes-protocols/openflow/openflow.inc +++ b/meta-networking/recipes-protocols/openflow/openflow.inc @@ -27,9 +27,8 @@ S = "${WORKDIR}/git" inherit autotools-brokensep pkgconfig -do_configure() { +do_configure_prepend() { ./boot.sh - oe_runconf } do_install_append() { diff --git a/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch b/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch new file mode 100644 index 000000000..952274bb9 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch @@ -0,0 +1,64 @@ +From 7b62e5884353b247f542844d1e4687d0e9211999 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 20 Jul 2017 04:27:32 -0700 +Subject: [PATCH 1/2] Check and use strlcpy from libc before defining own + +This is required especially on musl where +function prototype conflicts and causes build +failures. + +Signed-off-by: Khem Raj +--- + configure.ac | 2 +- + lib/util.c | 2 ++ + lib/util.h | 1 + + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 13064f6..596c43f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -57,7 +57,7 @@ OFP_CHECK_HWTABLES + OFP_CHECK_HWLIBS + AC_SYS_LARGEFILE + +-AC_CHECK_FUNCS([strsignal]) ++AC_CHECK_FUNCS([strlcpy strsignal]) + + AC_ARG_VAR(KARCH, [Kernel Architecture String]) + AC_SUBST(KARCH) +diff --git a/lib/util.c b/lib/util.c +index 21cc28d..1f341b1 100644 +--- a/lib/util.c ++++ b/lib/util.c +@@ -138,6 +138,7 @@ xasprintf(const char *format, ...) + return s; + } + ++#ifndef HAVE_STRLCPY + void + strlcpy(char *dst, const char *src, size_t size) + { +@@ -148,6 +149,7 @@ strlcpy(char *dst, const char *src, size_t size) + dst[n_copy] = '\0'; + } + } ++#endif + + void + ofp_fatal(int err_no, const char *format, ...) +diff --git a/lib/util.h b/lib/util.h +index fde681f..9e45ea9 100644 +--- a/lib/util.h ++++ b/lib/util.h +@@ -41,6 +41,7 @@ + #include + #include + #include "compiler.h" ++#include "config.h" + + #ifndef va_copy + #ifdef __va_copy +-- +2.13.3 + diff --git a/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch b/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch new file mode 100644 index 000000000..75180fe32 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch @@ -0,0 +1,59 @@ +From 5bba224edea38607e8732081f86679ffd8b218ab Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 20 Jul 2017 04:29:04 -0700 +Subject: [PATCH 2/2] lib/netdev: Adjust header include sequence + +Specify libc headers before kernel UAPIs +this helps compiling with musl where otherwise +it uses the definition from kernel and complains +about double definition in libc headers + +Signed-off-by: Khem Raj +--- + lib/netdev.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/lib/netdev.c b/lib/netdev.c +index 3b6fbc5..c7de25e 100644 +--- a/lib/netdev.c ++++ b/lib/netdev.c +@@ -39,7 +39,6 @@ + #include + #include + #include +-#include + + /* Fix for some compile issues we were experiencing when setting up openwrt + * with the 2.4 kernel. linux/ethtool.h seems to use kernel-style inttypes, +@@ -57,10 +56,6 @@ + #define s64 __s64 + #endif + +-#include +-#include +-#include +-#include + #include + #include + #include +@@ -68,12 +63,16 @@ + #include + #include + #include +-#include + #include + #include + #include + #include + #include ++#include ++#include ++#include ++#include ++#include + + #include "fatal-signal.h" + #include "list.h" +-- +2.13.3 + diff --git a/meta-networking/recipes-protocols/openflow/openflow_git.bb b/meta-networking/recipes-protocols/openflow/openflow_git.bb index 6403bfb22..eceb45e94 100644 --- a/meta-networking/recipes-protocols/openflow/openflow_git.bb +++ b/meta-networking/recipes-protocols/openflow/openflow_git.bb @@ -2,3 +2,8 @@ include ${BPN}.inc SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a" PV = "1.0+git${SRCPV}" + +SRC_URI += "\ + file://0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch \ + file://0002-lib-netdev-Adjust-header-include-sequence.patch \ + "