All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 1/4 V2] gperftools: Upgrade to 2.6.1
@ 2017-07-22 16:50 Khem Raj
  2017-07-22 16:50 ` [meta-networking][PATCH 2/4] openflow: Fix build with musl Khem Raj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Khem Raj @ 2017-07-22 16:50 UTC (permalink / raw)
  To: openembedded-devel

Fix build with musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
v1 -> v2:
- Disable thumb on armv5

 .../0001-Fix-build-failure-for-ppc.patch           | 28 ----------
 .../gperftools/0001-fix-build-with-musl-libc.patch | 61 ++++++++++++++++++++++
 ...001-include-fcntl.h-for-loff_t-definition.patch | 28 ++++++++++
 .../{gperftools_2.5.bb => gperftools_2.6.1.bb}     | 19 ++++---
 4 files changed, 102 insertions(+), 34 deletions(-)
 delete mode 100644 meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
 create mode 100644 meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch
 create mode 100644 meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch
 rename meta-oe/recipes-support/gperftools/{gperftools_2.5.bb => gperftools_2.6.1.bb} (58%)

diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
deleted file mode 100644
index 27f855d1e..000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Subject: Fix build failure for ppc
-
-Upstream-Status: Pending
-
-Fix the following build failure.
-
-  error: 'siginfo_t' does not name a type
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- src/stacktrace_powerpc-linux-inl.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
-index 5d16fa1..a9bf775 100644
---- a/src/stacktrace_powerpc-linux-inl.h
-+++ b/src/stacktrace_powerpc-linux-inl.h
-@@ -44,6 +44,7 @@
- 
- #include <stdint.h>   // for uintptr_t
- #include <stdlib.h>   // for NULL
-+#include <signal.h>   // for siginfo_t
- #include <gperftools/stacktrace.h>
- #include <base/vdso_support.h>
- 
--- 
-2.8.3
-
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch
new file mode 100644
index 000000000..78621c7fe
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch
@@ -0,0 +1,61 @@
+From 157914941bd38f1a38bb6bd7294ca6c2bc1b8dcb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Jul 2017 15:51:28 -0700
+Subject: [PATCH] fix build with musl libc
+
+Patch from https://github.com/gperftools/gperftools/pull/765/
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac                 | 1 +
+ src/malloc_hook_mmap_linux.h | 8 ++++++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b42fea3..70b49a3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -188,6 +188,7 @@ AC_HEADER_STDC
+ AC_CHECK_TYPES([__int64])       # defined in some windows platforms
+ AC_CHECK_TYPES([struct mallinfo],,, [#include <malloc.h>])
+ AC_CHECK_TYPES([Elf32_Versym],,, [#include <elf.h>])   # for vdso_support.h
++AC_CHECK_FUNCS(__sbrk)          # for intercepting glibc memory allocator
+ AC_CHECK_FUNCS(sbrk)            # for tcmalloc to get memory
+ AC_CHECK_FUNCS(geteuid)         # for turning off services when run as root
+ AC_CHECK_FUNCS(fork)            # for the pthread_atfork setup
+diff --git a/src/malloc_hook_mmap_linux.h b/src/malloc_hook_mmap_linux.h
+index 79ac4e3..d444635 100755
+--- a/src/malloc_hook_mmap_linux.h
++++ b/src/malloc_hook_mmap_linux.h
+@@ -46,6 +46,10 @@
+ #include <errno.h>
+ #include "base/linux_syscall_support.h"
+ 
++#ifndef __GLIBC__
++typedef off64_t   __off64_t;
++#endif
++
+ // The x86-32 case and the x86-64 case differ:
+ // 32b has a mmap2() syscall, 64b does not.
+ // 64b and 32b have different calling conventions for mmap().
+@@ -168,7 +172,7 @@ extern "C" void* mmap64(void *start, size_t length, int prot, int flags,
+   return result;
+ }
+ 
+-# if !defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH)
++# if defined(__GLIBC__) && (!defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH))
+ 
+ extern "C" void* mmap(void *start, size_t length, int prot, int flags,
+                       int fd, off_t offset) __THROW {
+@@ -206,7 +210,7 @@ extern "C" void* mremap(void* old_addr, size_t old_size, size_t new_size,
+   return result;
+ }
+ 
+-#ifndef __UCLIBC__
++#if HAVE___SBRK
+ // libc's version:
+ extern "C" void* __sbrk(ptrdiff_t increment);
+ 
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch
new file mode 100644
index 000000000..667008a5b
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch
@@ -0,0 +1,28 @@
+From 04ea8e001501931f4dbf20288aca78469617b08a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Jul 2017 19:28:17 -0700
+Subject: [PATCH] include fcntl.h for loff_t definition
+
+Fixes
+linux_syscall_support.h:2641:26: error: 'loff_t' has not been declared
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/base/linux_syscall_support.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/base/linux_syscall_support.h b/src/base/linux_syscall_support.h
+index 85347a2..70431ca 100644
+--- a/src/base/linux_syscall_support.h
++++ b/src/base/linux_syscall_support.h
+@@ -162,6 +162,7 @@ extern "C" {
+ #include <unistd.h>
+ #include <linux/unistd.h>
+ #include <endian.h>
++#include <fcntl.h>
+ 
+ #ifdef __mips__
+ /* Include definitions of the ABI currently in use.                          */
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.5.bb b/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb
similarity index 58%
rename from meta-oe/recipes-support/gperftools/gperftools_2.5.bb
rename to meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb
index 43780a5ee..6c29a6127 100644
--- a/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
+++ b/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb
@@ -2,22 +2,29 @@ SUMMARY = "Fast, multi-threaded malloc() and nifty performance analysis tools"
 HOMEPAGE = "http://code.google.com/p/gperftools/"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
-DEPENDS = "libunwind"
+DEPENDS += "libunwind"
 
-SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.5.tar.gz/aa1eaf95dbe2c9828d0bd3a00f770f50/gperftools-2.5.tar.gz \
+SRCREV = "bf840dec0495e17f5c8403e68e10b9d6bf05c559"
+SRC_URI = "git://github.com/gperftools/gperftools \
            file://0001-Support-Atomic-ops-on-clang.patch \
-           file://0001-Fix-build-failure-for-ppc.patch \
            file://0001-Use-ucontext_t-instead-of-struct-ucontext.patch \
+           file://0001-fix-build-with-musl-libc.patch \
+           file://0001-include-fcntl.h-for-loff_t-definition.patch \
            "
 
-SRC_URI[md5sum] = "aa1eaf95dbe2c9828d0bd3a00f770f50"
-SRC_URI[sha256sum] = "6fa2748f1acdf44d750253e160cf6e2e72571329b42e563b455bde09e9e85173"
-
 inherit autotools
 
+S = "${WORKDIR}/git"
+
 # On mips, we have the following error.
 #   do_page_fault(): sending SIGSEGV to ls for invalid read access from 00000008
 #   Segmentation fault (core dumped)
 COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
 # On aarch64, add this option to avoid system hanging when using libtcmalloc.so.
 EXTRA_OECONF_aarch64 += "--disable-libunwind"
+# Disable thumb1
+# {standard input}: Assembler messages:
+# {standard input}:434: Error: lo register required -- `ldr pc,[sp]'
+# Makefile:4538: recipe for target 'src/base/libtcmalloc_la-linuxthreads.lo' failed
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
-- 
2.13.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-networking][PATCH 2/4] openflow: Fix build with musl
  2017-07-22 16:50 [meta-oe][PATCH 1/4 V2] gperftools: Upgrade to 2.6.1 Khem Raj
@ 2017-07-22 16:50 ` Khem Raj
  2017-07-22 16:50 ` [meta-networking][PATCH 3/4] xl2tpd: Update to 1.3.9 Khem Raj
  2017-07-22 16:50 ` [meta-oe][PATCH 4/4] wvstreams: Fix build with musl Khem Raj
  2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-07-22 16:50 UTC (permalink / raw)
  To: openembedded-devel

Regenerate configure before running oe_runconf

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../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

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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+ 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 <stdio.h>
+ #include <string.h>
+ #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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+ 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 <fcntl.h>
+ #include <arpa/inet.h>
+ #include <inttypes.h>
+-#include <linux/if_tun.h>
+ 
+ /* 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 <linux/ethtool.h>
+-#include <linux/rtnetlink.h>
+-#include <linux/sockios.h>
+-#include <linux/version.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+@@ -68,12 +63,16 @@
+ #include <net/ethernet.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
+-#include <net/if_packet.h>
+ #include <net/route.h>
+ #include <netinet/in.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <linux/ethtool.h>
++#include <linux/rtnetlink.h>
++#include <linux/sockios.h>
++#include <linux/version.h>
++#include <linux/if_tun.h>
+ 
+ #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 \
+           "
-- 
2.13.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-networking][PATCH 3/4] xl2tpd: Update to 1.3.9
  2017-07-22 16:50 [meta-oe][PATCH 1/4 V2] gperftools: Upgrade to 2.6.1 Khem Raj
  2017-07-22 16:50 ` [meta-networking][PATCH 2/4] openflow: Fix build with musl Khem Raj
@ 2017-07-22 16:50 ` Khem Raj
  2017-07-22 16:50 ` [meta-oe][PATCH 4/4] wvstreams: Fix build with musl Khem Raj
  2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-07-22 16:50 UTC (permalink / raw)
  To: openembedded-devel

License changes are cosmetic

https://github.com/xelerance/xl2tpd/commit/1611d6f028fe30da4cee5b026fd1de81d97cba48

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../recipes-protocols/xl2tpd/xl2tpd.inc            |   5 +-
 .../fix-inline-functions-errors-with-gcc-5.x.patch | 134 ---------------------
 .../recipes-protocols/xl2tpd/xl2tpd_git.bb         |   4 +-
 3 files changed, 3 insertions(+), 140 deletions(-)
 delete mode 100644 meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch

diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
index 6f7f69330..d037c7cfc 100644
--- a/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
+++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
@@ -6,12 +6,9 @@ DEPENDS = "ppp virtual/kernel"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0636e73ff0215e8d672dc4c32c317bb3"
-
-INC_PR = "r0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 SRC_URI = "git://github.com/xelerance/xl2tpd.git \
-    file://fix-inline-functions-errors-with-gcc-5.x.patch \
 "
 
 S = "${WORKDIR}/git"
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch b/meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch
deleted file mode 100644
index b75c9129d..000000000
--- a/meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-Upstream-Status: Backport
-
-Backport from https://github.com/xelerance/xl2tpd/commit/9098f64950eb22cf049058d40f647bafdb822174
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 9098f64950eb22cf049058d40f647bafdb822174 Mon Sep 17 00:00:00 2001
-From: Kai Kang <kai.kang@windriver.com>
-Date: Wed, 23 Sep 2015 10:41:05 +0800
-Subject: [PATCH] Fix build errors caused by inline function with gcc 5
-
-GCC 5 defaults to -std=gnu11 instead of -std=gnu89. And -std=gnu89
-employs the GNU89 inline semantics, -std=gnu11 uses the C99 inline
-semantics.
-
-For 'inline' fuction, it is NOT exported by C99. So error messages such as:
-
-| control.c:1717: undefined reference to `check_control'
-
-For these functions which is not referred by other compile units, make
-them 'static inline'.
-
-For 'extern inline' function, it fails such as:
-
-| misc.h:68:20: warning: inline function 'swaps' declared but never defined
-|  extern inline void swaps (void *, int);
-|                      ^
-
-Because function swaps() is referred by other compile units, it must be
-exported. The semantics of 'extern inline' are not same between GNU89
-and C99, so remove 'inline' attribute for compatible with GNU89.
-
-Ref:
-https://gcc.gnu.org/gcc-5/porting_to.html
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
- control.c | 8 ++++----
- misc.c    | 2 +-
- misc.h    | 2 +-
- network.c | 4 ++--
- 4 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/control.c b/control.c
-index b2891a9..c4a39b5 100644
---- a/control.c
-+++ b/control.c
-@@ -1140,7 +1140,7 @@ int control_finish (struct tunnel *t, struct call *c)
-     return 0;
- }
- 
--inline int check_control (const struct buffer *buf, struct tunnel *t,
-+static inline int check_control (const struct buffer *buf, struct tunnel *t,
-                           struct call *c)
- {
-     /*
-@@ -1276,7 +1276,7 @@ inline int check_control (const struct buffer *buf, struct tunnel *t,
-     return 0;
- }
- 
--inline int check_payload (struct buffer *buf, struct tunnel *t,
-+static inline int check_payload (struct buffer *buf, struct tunnel *t,
-                           struct call *c)
- {
-     /*
-@@ -1382,7 +1382,7 @@ inline int check_payload (struct buffer *buf, struct tunnel *t,
- #endif
-     return 0;
- }
--inline int expand_payload (struct buffer *buf, struct tunnel *t,
-+static inline int expand_payload (struct buffer *buf, struct tunnel *t,
-                            struct call *c)
- {
-     /*
-@@ -1562,7 +1562,7 @@ void send_zlb (void *data)
-     toss (buf);
- }
- 
--inline int write_packet (struct buffer *buf, struct tunnel *t, struct call *c,
-+static inline int write_packet (struct buffer *buf, struct tunnel *t, struct call *c,
-                          int convert)
- {
-     /*
-diff --git a/misc.c b/misc.c
-index 3092401..af90dbf 100644
---- a/misc.c
-+++ b/misc.c
-@@ -170,7 +170,7 @@ void do_packet_dump (struct buffer *buf)
-     printf ("}\n");
- }
- 
--inline void swaps (void *buf_v, int len)
-+void swaps (void *buf_v, int len)
- {
- #ifdef __alpha
-     /* Reverse byte order alpha is little endian so lest save a step.
-diff --git a/misc.h b/misc.h
-index aafdc62..caab7a1 100644
---- a/misc.h
-+++ b/misc.h
-@@ -65,7 +65,7 @@ extern void l2tp_log (int level, const char *fmt, ...);
- extern struct buffer *new_buf (int);
- extern void udppush_handler (int);
- extern int addfcs (struct buffer *buf);
--extern inline void swaps (void *, int);
-+extern void swaps (void *, int);
- extern void do_packet_dump (struct buffer *);
- extern void status (const char *fmt, ...);
- extern void status_handler (int signal);
-diff --git a/network.c b/network.c
-index b1268c6..d324a71 100644
---- a/network.c
-+++ b/network.c
-@@ -135,7 +135,7 @@ int init_network (void)
-     return 0;
- }
- 
--inline void extract (void *buf, int *tunnel, int *call)
-+static inline void extract (void *buf, int *tunnel, int *call)
- {
-     /*
-      * Extract the tunnel and call #'s, and fix the order of the 
-@@ -155,7 +155,7 @@ inline void extract (void *buf, int *tunnel, int *call)
-     }
- }
- 
--inline void fix_hdr (void *buf)
-+static inline void fix_hdr (void *buf)
- {
-     /*
-      * Fix the byte order of the header
--- 
-2.6.1
-
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb
index 42bc398a1..88ae5d6f8 100644
--- a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb
+++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb
@@ -2,7 +2,7 @@ require xl2tpd.inc
 
 # This is v1.3.6 plus some commits.  There is no tag for this commit.
 #
-PV = "1.3.6+git${SRCPV}"
+PV = "1.3.9+git${SRCPV}"
 
-SRCREV = "a96b345962622ea58490924130675df6db062d11"
+SRCREV = "f114c10ac532051badeca0132b144a2f1596f047"
 
-- 
2.13.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-oe][PATCH 4/4] wvstreams: Fix build with musl
  2017-07-22 16:50 [meta-oe][PATCH 1/4 V2] gperftools: Upgrade to 2.6.1 Khem Raj
  2017-07-22 16:50 ` [meta-networking][PATCH 2/4] openflow: Fix build with musl Khem Raj
  2017-07-22 16:50 ` [meta-networking][PATCH 3/4] xl2tpd: Update to 1.3.9 Khem Raj
@ 2017-07-22 16:50 ` Khem Raj
  2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-07-22 16:50 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-Check-for-limits.h-during-configure.patch |  26 ++++
 ...sk-Dont-use-ucontext-on-non-glibc-systems.patch | 135 +++++++++++++++++++++
 ...k-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch |  27 +++++
 .../0004-wvcrash-Replace-use-of-basename-API.patch |  28 +++++
 ...05-check-for-libexecinfo-during-configure.patch |  30 +++++
 .../wvdial/wvstreams/argp.patch                    |  37 ++++++
 .../recipes-connectivity/wvdial/wvstreams_4.6.1.bb |   9 +-
 7 files changed, 291 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch
 create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch
 create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch
 create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch
 create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch
 create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch

diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch
new file mode 100644
index 000000000..b092ba2fc
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch
@@ -0,0 +1,26 @@
+From 7deaf836d1f1b9e4426818584b4267f8c4a095aa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:04:07 -0700
+Subject: [PATCH 1/5] Check for limits.h during configure
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index fe0fa2b..188adfe 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -139,6 +139,8 @@ int main()
+ 			     [Compiler warning on deprecated functions])])
+ CPPFLAGS="$CPPFLAGS_save"
+ 
++AC_CHECK_HEADERS(limits.h)
++
+ # argp
+ USE_WVSTREAMS_ARGP=0
+ AC_CHECK_HEADERS(argp.h)
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch
new file mode 100644
index 000000000..232db9e63
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch
@@ -0,0 +1,135 @@
+From 0e054339c1422168a7f4a9dcf090268053a33b1f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:05:37 -0700
+Subject: [PATCH 2/5] wvtask: Dont use ucontext on non-glibc systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/wvtask.cc | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/utils/wvtask.cc b/utils/wvtask.cc
+index cdcd544..c0bff7d 100644
+--- a/utils/wvtask.cc
++++ b/utils/wvtask.cc
+@@ -199,7 +199,9 @@ WvTaskMan::WvTaskMan()
+     stacktop = (char *)alloca(0);
+     
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&get_stack_return) == 0);
++#endif
+     if (context_return == 0)
+     {
+ 	// initial setup - start the stackmaster() task (never returns!)
+@@ -265,13 +267,17 @@ int WvTaskMan::run(WvTask &task, int val)
+ 	state = &old_task->mystate;
+     
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(state) == 0);
++#endif
+     int newval = context_return;
+     if (newval == 0)
+     {
+ 	// saved the state, now run the task.
+         context_return = val;
++#ifdef __GLIBC__
+         setcontext(&task.mystate);
++#endif
+         return -1;
+     }
+     else
+@@ -319,13 +325,17 @@ int WvTaskMan::yield(int val)
+ #endif
+ 		
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&current_task->mystate) == 0);
++#endif
+     int newval = context_return;
+     if (newval == 0)
+     {
+ 	// saved the task state; now yield to the toplevel.
+         context_return = val;
++#ifdef __GLIBC__
+         setcontext(&toplevel);
++#endif
+         return -1;
+     }
+     else
+@@ -341,7 +351,9 @@ int WvTaskMan::yield(int val)
+ void WvTaskMan::get_stack(WvTask &task, size_t size)
+ {
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&get_stack_return) == 0);
++#endif
+     if (context_return == 0)
+     {
+ 	assert(magic_number == -WVTASK_MAGIC);
+@@ -371,7 +383,9 @@ void WvTaskMan::get_stack(WvTask &task, size_t size)
+ 	// initial setup
+ 	stack_target = &task;
+ 	context_return = size/1024 + (size%1024 > 0);
++#ifdef __GLIBC__
+ 	setcontext(&stackmaster_task);
++#endif
+     }
+     else
+     {
+@@ -409,7 +423,9 @@ void WvTaskMan::_stackmaster()
+ 	assert(magic_number == -WVTASK_MAGIC);
+ 	
+         context_return = 0;
++#ifdef __GLIBC__
+         assert(getcontext(&stackmaster_task) == 0);
++#endif
+         val = context_return;
+ 	if (val == 0)
+ 	{
+@@ -419,7 +435,9 @@ void WvTaskMan::_stackmaster()
+ 	    // all current stack allocations) and go back to get_stack
+ 	    // (or the constructor, if that's what called us)
+             context_return = 1;
++#ifdef __GLIBC__
+             setcontext(&get_stack_return);
++#endif
+ 	}
+ 	else
+ 	{
+@@ -474,7 +492,9 @@ void WvTaskMan::do_task()
+ 	
+     // back here from longjmp; someone wants stack space.    
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&task->mystate) == 0);
++#endif
+     if (context_return == 0)
+     {
+ 	// done the setjmp; that means the target task now has
+@@ -510,7 +530,9 @@ void WvTaskMan::do_task()
+                 }
+                 else
+                 {
++#ifdef __GLIBC__
+                     assert(getcontext(&task->func_call) == 0);
++#endif
+                     task->func_call.uc_stack.ss_size = task->stacksize;
+                     task->func_call.uc_stack.ss_sp = task->stack;
+                     task->func_call.uc_stack.ss_flags = 0;
+@@ -521,9 +543,11 @@ void WvTaskMan::do_task()
+                             (void (*)(void))call_func, 1, task);
+ 
+                     context_return = 0;
++#ifdef __GLIBC__
+                     assert(getcontext(&task->func_return) == 0);
+                     if (context_return == 0)
+                         setcontext(&task->func_call);
++#endif
+                 }
+ 		
+ 		// the task's function terminated.
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch
new file mode 100644
index 000000000..f9304197a
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch
@@ -0,0 +1,27 @@
+From f1fc9f4d523dd8b773a4535176547b0619ec05c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:08:57 -0700
+Subject: [PATCH 3/5] wvtask: Check for HAVE_LIBC_STACK_END only on glibc
+ systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/wvtask.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/wvtask.cc b/utils/wvtask.cc
+index c0bff7d..716344b 100644
+--- a/utils/wvtask.cc
++++ b/utils/wvtask.cc
+@@ -563,7 +563,7 @@ void WvTaskMan::do_task()
+ 
+ const void *WvTaskMan::current_top_of_stack()
+ {
+-#ifdef HAVE_LIBC_STACK_END
++#if defined(HAVE_LIBC_STACK_END) && defined(__GLIBC__)
+     extern const void *__libc_stack_end;
+     if (use_shared_stack() || current_task == NULL)
+         return __libc_stack_end;
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch
new file mode 100644
index 000000000..6f3fbffbd
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch
@@ -0,0 +1,28 @@
+From bfe68126693f9159f7ac66a69217e0b5f43e5781 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:11:21 -0700
+Subject: [PATCH 4/5] wvcrash: Replace use of basename API
+
+musl does not have this API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/wvcrash.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/wvcrash.cc b/utils/wvcrash.cc
+index 0417759..3d160b7 100644
+--- a/utils/wvcrash.cc
++++ b/utils/wvcrash.cc
+@@ -404,7 +404,7 @@ extern void __wvcrash_init_buffers(const char *program_name);
+ void wvcrash_setup(const char *_argv0, const char *_desc)
+ {
+     if (_argv0)
+-	argv0 = basename(_argv0);
++	argv0 = strrchr(_argv0, '/') ? strrchr(_argv0, '/')+1 : _argv0;
+     __wvcrash_init_buffers(argv0);
+     if (_desc)
+     {
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch
new file mode 100644
index 000000000..25e9ee236
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch
@@ -0,0 +1,30 @@
+From fd9515f08dcdafea6ae03413fbe5a43a6438fe3e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:25:48 -0700
+Subject: [PATCH 5/5] check for libexecinfo during configure
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 188adfe..1ab4d3c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,6 +159,12 @@ AC_SEARCH_LIBS([argp_parse], [argp c], [], [
+       USE_WVSTREAMS_ARGP=1
+   fi
+ ])
++
++USE_LIBEXECINFO=0
++AC_SEARCH_LIBS([backtrace], [execinfo], [], [
++USE_LIBEXECINFO=1
++])
++
+ # Function checks
+ AC_HEADER_DIRENT
+ 
+-- 
+2.13.3
+
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch
new file mode 100644
index 000000000..e85721363
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch
@@ -0,0 +1,37 @@
+Check for argp_parse in libargp and then in libc before using internal version
+
+Index: wvstreams-4.6.1/configure.ac
+===================================================================
+--- wvstreams-4.6.1.orig/configure.ac
++++ wvstreams-4.6.1/configure.ac
+@@ -142,20 +142,21 @@ CPPFLAGS="$CPPFLAGS_save"
+ # argp
+ USE_WVSTREAMS_ARGP=0
+ AC_CHECK_HEADERS(argp.h)
+-AC_CHECK_FUNC(argp_parse)
+-if test "$ac_cv_func_argp_parse" != yes \
+-    -o "$ac_cv_header_argp_h" != yes ; then
+-    (
+-    	echo
++AC_SEARCH_LIBS([argp_parse], [argp c], [], [
++
++  if test "$ac_cv_func_argp_parse" != yes \
++      -o "$ac_cv_header_argp_h" != yes ; then
++      (
++       	echo
+     	echo 'configuring argp...'
+     	cd argp
+     	./configure --host=$host_cpu-$host_os || exit $?
+     	echo 'argp configured.'
+     	echo
+-    ) || exit $?
+-    USE_WVSTREAMS_ARGP=1
+-fi
+-
++      ) || exit $?
++      USE_WVSTREAMS_ARGP=1
++  fi
++])
+ # Function checks
+ AC_HEADER_DIRENT
+ 
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb b/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
index 607a6178f..0ac175251 100644
--- a/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
@@ -5,6 +5,7 @@ LICENSE = "LGPLv2"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=55ca817ccb7d5b5b66355690e9abc605"
 
 DEPENDS = "zlib openssl (>= 0.9.8) dbus readline"
+DEPENDS_append_libc-musl = " argp-standalone libexecinfo"
 
 SRC_URI = "http://${BPN}.googlecode.com/files/${BP}.tar.gz \
            file://04_signed_request.diff \
@@ -12,7 +13,13 @@ SRC_URI = "http://${BPN}.googlecode.com/files/${BP}.tar.gz \
            file://06_gcc-4.7.diff \
            file://07_buildflags.diff \
            file://gcc-6.patch \
-          "
+           file://argp.patch \
+           file://0001-Check-for-limits.h-during-configure.patch \
+           file://0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch \
+           file://0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch \
+           file://0004-wvcrash-Replace-use-of-basename-API.patch \
+           file://0005-check-for-libexecinfo-during-configure.patch \
+           "
 
 SRC_URI[md5sum] = "2760dac31a43d452a19a3147bfde571c"
 SRC_URI[sha256sum] = "8403f5fbf83aa9ac0c6ce15d97fd85607488152aa84e007b7d0621b8ebc07633"
-- 
2.13.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-22 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-22 16:50 [meta-oe][PATCH 1/4 V2] gperftools: Upgrade to 2.6.1 Khem Raj
2017-07-22 16:50 ` [meta-networking][PATCH 2/4] openflow: Fix build with musl Khem Raj
2017-07-22 16:50 ` [meta-networking][PATCH 3/4] xl2tpd: Update to 1.3.9 Khem Raj
2017-07-22 16:50 ` [meta-oe][PATCH 4/4] wvstreams: Fix build with musl Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.