Skip to contentSkip to conversation

musl fixes 3

PATCH In review Khem Raj 6 participants 84 messages Jan 8, 2016 – Jan 10, 2016

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover musl fixes 3

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato and core-image-weston

Here is a qemuarm world build results.

http://errors.yoctoproject.org/Errors/Build/11421/

Few fixes are also for uclibc

The following changes since commit 5661d8cb7849df62358368743134c0aaf523965e:

image: Really remove lockfiles flag (2016-01-07 13:41:47 +0000)

are available in the git repository at:

git://github.com/kraj/openembedded-core kraj/musl-fixes
https://github.com/kraj/openembedded-core/tree/kraj/musl-fixes

Kai Kang (1):
Revert "glib-2.0: build dependency cleanup"

Khem Raj (52):
powertop: Include right headers for timval struct
dhcp: Include sys/types.h for u_int* defs
blktrace: Include <sys/types.h for dev_t
ppp: Fix build with musl
tcp-wrappers: Fix build with musl
fts: Add recipe
connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
libcgroup: Add dependency on fts when building on musl
linux-libc-headers: Port patches for linux-headers for musl
xserver-xorg: Fix build with musl
gdk-pixbuf: Fix latent build issue exposed by musl
argp-standalone: Add recipe
gnutls: Link with libargp on musl and depend on argp-standalone
util-linux: Fix ptest builds on musl
webkitgtk: Fix build with clang
elfutils: Fix build with uclibc packagegroup-self-hosted.bb: Move glibc-gconv-ibm850 to glibc only
case
guile: Fix build with uclibc
gnutls: Link with libuargp on uclibc
mtools: Fix build with uclibc
parted: Fix build with uclibc
net-tools: Link with libintl on uclibc
libdrm: Upgrade 2.4.65 -> 2.4.66
directfb: Fix build with musl
gzip: Fix build with musl
watchdog: Fix build with musl
xinetd: Fix build with musl
dpkg: Add musleabi to known architectures
puzzles: Zero'ise structs before use
apt: Add support for building for musl targets
libunwind: backtrace APIs are glibc specific
babeltrace: Add missing header for MAXNAMLEN define
elfutils: Fix build with musl
sysklogd: untangle header inclusion maze
console-tools: Include sys/types.h for u_char and u_short defs
webkitgtk: Fix build on non-glibc linux systems
rt-tests: Fix build with non-gcc compilers
webkitgtk: Update patch status
tar: Fix build for musl based targets
net-tools: Fix build on musl
pax: Fix build with musl
iputils: Fix build with musl
libuser: Fix build when secure getenv is not there
iproute2: Fix build with musl
irda-utils: Fix header inclusions
nspr: Drop older glibc code
chkconfig: Avoid using caddr_t
tcf-agent: Implement canonicalize_file_name() for musl as well bsd-headers,musl: Add recipe for bsd missing features
nfs-utils: Disable tcp-wrappers for musl
portmap: Point to tirpc headers and libraries on musl
elfutils: Add ALLOW_EMPTY for musl

 .../0003-Fix-header-inclusions-for-musl.patch      |   79 +-
 .../dhcp/0001-include-missing-sys-types.h.patch    |   58 +
 meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb       |    1 +
 .../iproute2/iproute2/iproute2-4.3.0-musl.patch    |   97 ++
 .../iproute2/iproute2_4.3.0.bb                     |    1 +
 .../irda-utils/irda-utils-0.9.18/musl.patch        |   29 +
 .../irda-utils/irda-utils_0.9.18.bb                |    1 +
 .../nfs-utils/nfs-utils_1.3.3.bb                   |    1 +
 meta/recipes-connectivity/portmap/portmap_6.0.bb   |    4 +
 .../ppp/ppp/0001-Fix-build-with-musl.patch         |  163 +++
 meta/recipes-connectivity/ppp/ppp_2.4.7.bb         |    3 +
 meta/recipes-core/bsd-headers/bsd-headers.bb       |   25 +
 .../bsd-headers/bsd-headers/sys-queue.h            |  846 ++++++++++++
 .../bsd-headers/bsd-headers/sys-tree.h             |  761 +++++++++++
 ...clude-sys-types.h-for-u_char-and-u_short-.patch |   44 +
 .../console-tools/console-tools_0.3.2.bb           |    1 +
 meta/recipes-core/fts/fts.bb                       |   39 +
 .../fts/fts/fts-header-correctness.patch           |   25 +
 meta/recipes-core/fts/fts/fts-uclibc.patch         |   50 +
 meta/recipes-core/fts/fts/gcc5.patch               | 1368 ++++++++++++++++++++
 meta/recipes-core/fts/fts/remove_cdefs.patch       |   69 +
 meta/recipes-core/fts/fts/stdint.patch             |   15 +
 meta/recipes-core/glib-2.0/glib.inc                |    6 +-
 .../libcgroup/libcgroup/musl-decls-compat.patch    |  235 ++++
 meta/recipes-core/libcgroup/libcgroup_0.41.bb      |    4 +
 meta/recipes-core/musl/musl_git.bb                 |    1 +
 .../packagegroups/packagegroup-self-hosted.bb      |    2 +-
 .../util-linux/uuid-test-error-api.patch           |   92 ++
 meta/recipes-core/util-linux/util-linux_2.27.1.bb  |    1 +
 meta/recipes-devtools/apt/apt.inc                  |    1 +
 ....mak-musl-based-systems-can-generate-shar.patch |   29 +
 meta/recipes-devtools/apt/apt_1.0.10.1.bb          |    3 +-
 ...0006-add-musleabi-to-known-target-tripets.patch |   42 +
 meta/recipes-devtools/dpkg/dpkg_1.18.2.bb          |    3 +-
 ...de-alternatives-for-glibc-assumptions-hel.patch |  132 ++
 .../uclibc-support-for-elfutils-0.161.patch        |   79 +-
 .../elfutils/elfutils/mempcpy.patch                |   24 -
 meta/recipes-devtools/elfutils/elfutils_0.148.bb   |    1 -
 meta/recipes-devtools/elfutils/elfutils_0.163.bb   |    8 +-
 .../guile/files/remove_strcase_l_funcs.patch       |   38 +
 meta/recipes-devtools/guile/guile_2.0.11.bb        |    3 +-
 meta/recipes-devtools/mtools/mtools_4.0.18.bb      |    3 +
 ...nonicalize_file_name-is-specific-to-glibc.patch |   46 +
 meta/recipes-devtools/tcf-agent/tcf-agent_git.bb   |    1 +
 .../chkconfig/chkconfig/replace_caddr_t.patch      |   33 +
 .../recipes-extended/chkconfig/chkconfig_1.3.58.bb |    4 +-
 meta/recipes-extended/gzip/gzip.inc                |    7 +
 .../files/0001-Fix-header-inclusion-for-musl.patch |   92 ++
 meta/recipes-extended/iputils/iputils_s20121221.bb |    1 +
 .../libuser/libuser/0001-Check-for-issetugid.patch |   62 +
 .../libuser/0002-remove-unused-execinfo.h.patch    |   27 +
 meta/recipes-extended/libuser/libuser_0.62.bb      |    4 +-
 .../net-tools/net-tools/musl-fixes.patch           |  100 ++
 .../net-tools/net-tools_1.60-26.bb                 |    3 +-
 meta/recipes-extended/parted/parted_3.2.bb         |    3 +-
 .../pax/pax/0001-Fix-build-with-musl.patch         | 1287 ++++++++++++++++++
 .../pax/0001-use-strtoll-instead-of-strtoq.patch   |   33 +
 meta/recipes-extended/pax/pax_3.4.bb               |   10 +
 .../sysklogd/files/0001-Fix-build-with-musl.patch  |  132 ++
 meta/recipes-extended/sysklogd/sysklogd.inc        |    1 +
 meta/recipes-extended/tar/tar/musl_dirent.patch    |   19 +
 meta/recipes-extended/tar/tar_1.28.bb              |    6 +
 .../tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch |   31 +
 .../tcp-wrappers/tcp-wrappers_7.6.bb               |    4 +
 ...d-issues-found-with-non-glibc-C-libraries.patch |   99 ++
 meta/recipes-extended/watchdog/watchdog_5.14.bb    |    8 +-
 ...se-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch |  100 ++
 meta/recipes-extended/xinetd/xinetd_2.3.15.bb      |    5 +
 .../gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch      |   63 +
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb |    1 +
 meta/recipes-graphics/directfb/directfb.inc        |    5 +
 .../directfb/directfb/compar_fn_t.patch            |   62 +
 .../directfb/directfb/union-sigval.patch           |   19 +
 .../directfb/use-PTHREAD_MUTEX_RECURSIVE.patch     |   19 +
 ...tests-kms-steal-crtc-Include-sys-select.h.patch |   33 +
 .../recipes-graphics/drm/libdrm/installtests.patch |   24 +-
 .../drm/{libdrm_2.4.65.bb => libdrm_2.4.66.bb}     |    8 +-
 .../xserver-xorg/musl-arm-inb-outb.patch           |   18 +
 .../xorg-xserver/xserver-xorg_1.18.0.bb            |    4 +-
 ...-include-sys-types.h-for-dev_t-definition.patch |   30 +
 meta/recipes-kernel/blktrace/blktrace_git.bb       |    4 +-
 ...mpat.h-fix-some-issues-arising-from-in6.h.patch |   82 ++
 ...t.h-prevent-redefinition-of-struct-ethhdr.patch |   59 +
 ...remove-inclusion-of-sysinfo.h-in-kernel.h.patch |   32 +
 .../linux-libc-headers/linux-libc-headers_4.1.bb   |    5 +
 ...Include-sys-param.h-for-MAXNAMLEN-definti.patch |   29 +
 meta/recipes-kernel/lttng/babeltrace_1.3.1.bb      |    5 +-
 ...0001-include-rquired-headers-for-typedefs.patch |   47 +
 meta/recipes-kernel/powertop/powertop_2.8.bb       |    4 +-
 ...t-CC-AR-variable-only-if-it-doesn-t-have-.patch |   30 +
 meta/recipes-rt/rt-tests/rt-tests_0.96.bb          |    3 +-
 ...mpiler-errors-about-uninitialized-use-of-.patch |   32 +
 meta/recipes-sato/puzzles/puzzles_git.bb           |    1 +
 ...nable-backtrace-on-linux-when-using-glibc.patch |   39 +
 ...x-build-with-non-glibc-libraries-on-linux.patch |   61 +
 meta/recipes-sato/webkit/webkitgtk/clang.patch     |   25 +
 meta/recipes-sato/webkit/webkitgtk_2.10.4.bb       |    3 +
 .../argp-standalone/argp-standalone_1.3.bb         |   28 +
 .../files/0001-throw-in-funcdef.patch              |   84 ++
 .../argp-standalone/files/0002-isprint.patch       |   51 +
 meta/recipes-support/gnutls/gnutls.inc             |    5 +-
 ...-backtrace-Use-only-with-glibc-and-uclibc.patch |   45 +
 meta/recipes-support/libunwind/libunwind_1.1.bb    |    1 +
 ...001-Remove-the-check-for-LINUX-glibc-case.patch |   35 +
 meta/recipes-support/nspr/nspr_4.11.bb             |    9 +
 105 files changed, 7393 insertions(+), 117 deletions(-)
 create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch
 create mode 100644 meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch
 create mode 100644 meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch
 create mode 100644 meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
 create mode 100644 meta/recipes-core/bsd-headers/bsd-headers.bb
 create mode 100644 meta/recipes-core/bsd-headers/bsd-headers/sys-queue.h
 create mode 100644 meta/recipes-core/bsd-headers/bsd-headers/sys-tree.h
 create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch
 create mode 100644 meta/recipes-core/fts/fts.bb
 create mode 100644 meta/recipes-core/fts/fts/fts-header-correctness.patch
 create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
 create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
 create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
 create mode 100644 meta/recipes-core/fts/fts/stdint.patch
 create mode 100644 meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
 create mode 100644 meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch
 create mode 100644 meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
 create mode 100644 meta/recipes-devtools/elfutils/elfutils-0.163/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
 delete mode 100644 meta/recipes-devtools/elfutils/elfutils/mempcpy.patch
 create mode 100644 meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch
 create mode 100644 meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch
 create mode 100644 meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
 create mode 100644 meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch
 create mode 100644 meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
 create mode 100644 meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
 create mode 100644 meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
 create mode 100644 meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch
 create mode 100644 meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch
 create mode 100644 meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
 create mode 100644 meta/recipes-extended/tar/tar/musl_dirent.patch
 create mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
 create mode 100644 meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch
 create mode 100644 meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch
 create mode 100644 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/compar_fn_t.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/union-sigval.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch
 create mode 100644 meta/recipes-graphics/drm/libdrm/0001-tests-kms-steal-crtc-Include-sys-select.h.patch
 rename meta/recipes-graphics/drm/{libdrm_2.4.65.bb => libdrm_2.4.66.bb} (86%)
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
 create mode 100644 meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
 create mode 100644 meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch
 create mode 100644 meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
 create mode 100644 meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch
 create mode 100644 meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/clang.patch
 create mode 100644 meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
 create mode 100644 meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
 create mode 100644 meta/recipes-support/argp-standalone/files/0002-isprint.patch
 create mode 100644 meta/recipes-support/libunwind/libunwind-1.1/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
 create mode 100644 meta/recipes-support/nspr/nspr/0001-Remove-the-check-for-LINUX-glibc-case.patch
Signature · 1 line
2.7.0
author
#1 lore raw

PATCH 1/53 powertop: Include right headers for timval struct

---
 ...0001-include-rquired-headers-for-typedefs.patch | 47 ++++++++++++++++++++++
 meta/recipes-kernel/powertop/powertop_2.8.bb       |  4 +-
 2 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch new file +47 -0
new file mode 100644
index 0000000..0fd6310
@@ -0,0 +1,47 @@
+From 0856d8145d187a7e5a49625247abe43a13f95acc Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 15 Sep 2015 19:36:28 +0000
+Subject: [PATCH] include rquired headers for typedefs
+
+timeval struct needs to include sys/time.h and sprintf() usage requires
+to include stdio.h headers from system
+
+Fixes
+src/perf/perf_bundle.cpp:141:2: error: use of undeclared identifier 'sprintf'; did you mean 'vswprintf'?
+src/devices/devfreq.h:35:18: error: field has incomplete type 'struct timeval'
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ src/devices/devfreq.h    | 1 +
+ src/perf/perf_bundle.cpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/devices/devfreq.h b/src/devices/devfreq.h
+index 16a60fb..4bede7c 100644
+--- a/src/devices/devfreq.h
++++ b/src/devices/devfreq.h
+@@ -25,6 +25,7 @@
+ #ifndef _INCLUDE_GUARD_DEVFREQ_H
+ #define _INCLUDE_GUARD_DEVFREQ_H
+ 
++#include <sys/time.h>
+ #include "device.h"
+ #include "../parameters/parameters.h"
+ 
+diff --git a/src/perf/perf_bundle.cpp b/src/perf/perf_bundle.cpp
+index cf1ae11..232f894 100644
+--- a/src/perf/perf_bundle.cpp
++++ b/src/perf/perf_bundle.cpp
+@@ -27,6 +27,7 @@
+ #include <algorithm>
+ #include <string.h>
+ #include <stdint.h>
++#include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+-- 
+2.5.2
+
meta/recipes-kernel/powertop/powertop_2.8.bb +3 -1
index a466067..1f2dfb8 100644
@@ -6,7 +6,9 @@ DEPENDS = "ncurses libnl pciutils"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
 
-SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz"
+SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz \
+           file://0001-include-rquired-headers-for-typedefs.patch \
+"
 
 SRC_URI[md5sum] = "c55fedb69203e480801b18bd7b886241"
 SRC_URI[sha256sum] = "a87b563f73106babfa3e74dcf92f252938c061e309ace20a361358bbfa579c5a"
Signature · 1 line
2.7.0
author
#2 lore raw

PATCH 2/53 dhcp: Include sys/types.h for u_int* defs

---
 .../dhcp/0001-include-missing-sys-types.h.patch    | 58 ++++++++++++++++++++++
 meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb       |  1 +
 2 files changed, 59 insertions(+)
 create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch
meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch new file +58 -0
new file mode 100644
index 0000000..64f2bdd
@@ -0,0 +1,58 @@
+From 971491b6d7ab47d2f92f34269a129d0347fba15a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 14 Sep 2015 23:51:38 +0000
+Subject: [PATCH] include missing sys/types.h
+
+Code uses plain typedefs defines in this header but does not include it
+Fixes
+
+error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ dst/dst_api.c     | 1 +
+ dst/dst_support.c | 1 +
+ dst/hmac_link.c   | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/dst/dst_api.c b/dst/dst_api.c
+index a77abd2..7885538 100644
+--- a/dst/dst_api.c
++++ b/dst/dst_api.c
+@@ -49,6 +49,7 @@
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ 
+ #include "cdefs.h"
+diff --git a/dst/dst_support.c b/dst/dst_support.c
+index 8e08a0c..f353ec6 100644
+--- a/dst/dst_support.c
++++ b/dst/dst_support.c
+@@ -25,6 +25,7 @@
+ #include <sys/stat.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ 
+ #include "cdefs.h"
+ #include "osdep.h"
+diff --git a/dst/hmac_link.c b/dst/hmac_link.c
+index b812c1c..a7de622 100644
+--- a/dst/hmac_link.c
++++ b/dst/hmac_link.c
+@@ -31,6 +31,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ 
+ #include "cdefs.h"
+ #include "osdep.h"
+-- 
+2.5.2
+
meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb +1 -0
index b4a05fc..436a32e 100644
@@ -6,6 +6,7 @@ SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
             file://fixsepbuild.patch \
             file://dhclient-script-drop-resolv.conf.dhclient.patch \
             file://replace-ifconfig-route.patch \
+            file://0001-include-missing-sys-types.h.patch \
            "
 
 SRC_URI[md5sum] = "5a284875dd2c12ddd388416d69156a67"
Signature · 1 line
2.7.0
author
#3 lore raw

PATCH 3/53 blktrace: Include <sys/types.h for dev_t

In reply to Khem Raj
---
 ...-include-sys-types.h-for-dev_t-definition.patch | 30 ++++++++++++++++++++++
 meta/recipes-kernel/blktrace/blktrace_git.bb       |  4 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch new file +30 -0
new file mode 100644
index 0000000..a4b7157
@@ -0,0 +1,30 @@
+From 6b5bbdfaac7f216fe8a02c4cf29e5eb2aee5a409 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 15 Sep 2015 00:01:00 +0000
+Subject: [PATCH] include sys/types.h for dev_t definition
+
+Avoids the build failures when sys/types.h does not get included
+indirectly through other headers.
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Submitted
+
+ blktrace.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/blktrace.h b/blktrace.h
+index 380aec7..944fc08 100644
+--- a/blktrace.h
++++ b/blktrace.h
+@@ -5,6 +5,7 @@
+ #include <limits.h>
+ #include <byteswap.h>
+ #include <endian.h>
++#include <sys/types.h>
+ 
+ #include "blktrace_api.h"
+ #include "rbtree.h"
+-- 
+2.5.2
+
meta/recipes-kernel/blktrace/blktrace_git.bb +3 -1
index 5b0be42..957cb70 100644
@@ -9,7 +9,9 @@ SRCREV = "43fc870ce04e963def45dfc0d1ed4ea21ef10d4b"
 PV = "1.1.0+git${SRCPV}"
 
 SRC_URI = "git://git.kernel.dk/blktrace.git \
-           file://ldflags.patch"
+           file://ldflags.patch \
+           file://0001-include-sys-types.h-for-dev_t-definition.patch \
+"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.7.0
author
#4 lore raw

PATCH 4/53 ppp: Fix build with musl

In reply to Khem Raj

Therer are assumptions about glibc headers and features which needs to be addressed for musl

---
 .../ppp/ppp/0001-Fix-build-with-musl.patch         | 163 +++++++++++++++++++++
 meta/recipes-connectivity/ppp/ppp_2.4.7.bb         |   3 +
 2 files changed, 166 insertions(+)
 create mode 100644 meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch new file +163 -0
new file mode 100644
index 0000000..763e374
@@ -0,0 +1,163 @@
+From 52a1e41d7541b2c936285844c59bd1be21797860 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+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 <[email protected]>
+---
+Upstream-Status: Pending
+
+ 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 <sys/time.h>
++
+ /*
+  * The basic PPP frame.
+  */
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index 8ab2102..d7e2564 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 <net/ethernet.h> header file.  */
++#ifdef __GLIBC__
+ #define HAVE_NET_ETHERNET_H 1
+-
++#endif
+ /* Define if you have the <net/if.h> header file.  */
+ #define HAVE_NET_IF_H 1
+ 
+@@ -102,7 +103,9 @@
+ #define HAVE_NETPACKET_PACKET_H 1
+ 
+ /* Define if you have the <sys/cdefs.h> header file.  */
++#ifdef __GLIBC__
+ #define HAVE_SYS_CDEFS_H 1
++#endif
+ 
+ /* Define if you have the <sys/dlpi.h> 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 <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <net/ethernet.h>
+ #include <net/if_arp.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_pppox.h>
+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 <linux/if_packet.h>
+ #endif
+ 
+-#ifdef HAVE_NET_ETHERNET_H
+-#include <net/ethernet.h>
+-#endif
+-
+ #ifdef HAVE_ASM_TYPES_H
+ #include <asm/types.h>
+ #endif
+@@ -47,6 +43,10 @@
+ #include <net/if_arp.h>
+ #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 <sys/socket.h>
+ #endif
+-#ifndef HAVE_SYS_DLPI_H
++#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H
+ #include <netinet/if_ether.h>
+ #endif
+ #endif
+diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+index a105505..49b0273 100644
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -112,7 +112,7 @@
+ #include <linux/types.h>
+ #include <linux/if.h>
+ #include <linux/if_arp.h>
+-#include <linux/route.h>
++/* #include <linux/route.h> */
+ #include <linux/if_ether.h>
+ #endif
+ #include <netinet/in.h>
+@@ -145,6 +145,7 @@
+ #endif
+ 
+ #ifdef INET6
++#include <net/route.h>
+ #ifndef _LINUX_IN6_H
+ /*
+  *    This is in linux/include/net/ipv6.h.
+-- 
+2.1.4
+
meta/recipes-connectivity/ppp/ppp_2.4.7.bb +3 -0
index 5f06034..4437b5c 100644
@@ -32,6 +32,9 @@ SRC_URI = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.tar.gz \
            file://fix-CVE-2015-3310.patch \
 "
 
+SRC_URI_append_libc-musl = "\
+           file://0001-Fix-build-with-musl.patch \
+"
 SRC_URI[md5sum] = "78818f40e6d33a1d1de68a1551f6595a"
 SRC_URI[sha256sum] = "02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30"
 
Signature · 1 line
2.7.0
author
#5 lore raw

PATCH 5/53 tcp-wrappers: Fix build with musl

In reply to Khem Raj
---
 .../tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch | 31 ++++++++++++++++++++++
 .../tcp-wrappers/tcp-wrappers_7.6.bb               |  4 +++
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch new file +31 -0
new file mode 100644
index 0000000..eee640e
@@ -0,0 +1,31 @@
+__BEGIN_DECLS/__END_DECLS are BSD specific and not defined in musl
+glibc and uclibc had sys/cdefs.h doing it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: tcp_wrappers_7.6/tcpd.h
+===================================================================
+--- tcp_wrappers_7.6.orig/tcpd.h
++++ tcp_wrappers_7.6/tcpd.h
+@@ -11,7 +11,9 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* Structure to describe one communications endpoint. */
+ 
+@@ -252,6 +254,8 @@ extern char *fix_strtok();
+ extern char *my_strtok();
+ #endif
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb +4 -0
index 2630478..5fdbbce 100644
@@ -43,6 +43,7 @@ SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
            file://try-from.8 \
            file://safe_finger.8 \
            file://makefile-fix-parallel.patch \
+           file://musl-decls.patch \
            "
 
 SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
@@ -73,6 +74,9 @@ EXTRA_OEMAKE = "'CC=${CC}' \
 
 EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
 EXTRA_OEMAKE_NETGROUP_libc-uclibc = "-DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_libc-musl = "-DUSE_GETDOMAIN"
+
+EXTRA_OEMAKE_append_libc-musl = " 'LIBS='"
 
 do_compile () {
 	oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
Signature · 1 line
2.7.0
author
#6 lore raw

PATCH 6/53 fts: Add recipe

In reply to Khem Raj

fts is not implemented in musl but many packages depend on it glibc implements it even though posix does not requir it to do so. So provide an alternative provider for fts

---
 meta/recipes-core/fts/fts.bb                       |   39 +
 .../fts/fts/fts-header-correctness.patch           |   25 +
 meta/recipes-core/fts/fts/fts-uclibc.patch         |   50 +
 meta/recipes-core/fts/fts/gcc5.patch               | 1368 ++++++++++++++++++++
 meta/recipes-core/fts/fts/remove_cdefs.patch       |   69 +
 meta/recipes-core/fts/fts/stdint.patch             |   15 +
 6 files changed, 1566 insertions(+)
 create mode 100644 meta/recipes-core/fts/fts.bb
 create mode 100644 meta/recipes-core/fts/fts/fts-header-correctness.patch
 create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
 create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
 create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
 create mode 100644 meta/recipes-core/fts/fts/stdint.patch
meta/recipes-core/fts/fts.bb new file +39 -0
new file mode 100644
index 0000000..d8b4ed2
@@ -0,0 +1,39 @@
+# Copyright (C) 2015 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "keith bostic's POSIX file tree stream operations library"
+HOMEPAGE = "https://sites.google.com/a/bostic.com/keithbostic"
+LICENSE = "BSD-4-Clause"
+LIC_FILES_CHECKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-4-Clause;md5=624d9e67e8ac41a78f6b6c2c55a83a2b"
+SECTION = "libs"
+
+SRC_URI = "https://sites.google.com/a/bostic.com/keithbostic/files/fts.tar.gz \
+           file://fts-header-correctness.patch \
+           file://fts-uclibc.patch \
+           file://remove_cdefs.patch \
+           file://stdint.patch \
+           file://gcc5.patch \
+"
+
+SRC_URI[md5sum] = "120c14715485ec6ced14f494d059d20a"
+SRC_URI[sha256sum] = "3df9b9b5a45aeaf16f33bb84e692a10dc662e22ec8a51748f98767d67fb6f342"
+
+S = "${WORKDIR}/${BPN}"
+
+do_configure[noexec] = "1"
+
+VER = "0"
+do_compile () {
+    ${CC} -I${S} -fPIC -shared -o libfts.so.${VER} -Wl,-soname,libfts.so.${VER} ${S}/fts.c
+}
+
+do_install() {
+    install -Dm755 ${B}/libfts.so.${VER} ${D}${libdir}/libfts.so.${VER}
+    ln -sf libfts.so.${VER} ${D}${libdir}/libfts.so
+    install -Dm644 ${S}/fts.h ${D}${includedir}/fts.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
meta/recipes-core/fts/fts/fts-header-correctness.patch new file +25 -0
new file mode 100644
index 0000000..c73ddc9
@@ -0,0 +1,25 @@
+Included needed headers for compiling with musl
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Inappropriate
+
+--- fts.orig/fts.h
++++ fts/fts.h
+@@ -38,6 +38,17 @@
+ #ifndef	_FTS_H_
+ #define	_FTS_H_
+ 
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/stat.h>
++
++#include <dirent.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
+ typedef struct {
+ 	struct _ftsent *fts_cur;	/* current node */
+ 	struct _ftsent *fts_child;	/* linked list of children */
meta/recipes-core/fts/fts/fts-uclibc.patch new file +50 -0

50 lines not on this page · raw message

meta/recipes-core/fts/fts/gcc5.patch new file +1368 -0

1,368 lines not on this page · raw message

meta/recipes-core/fts/fts/remove_cdefs.patch new file +69 -0

69 lines not on this page · raw message

meta/recipes-core/fts/fts/stdint.patch new file +15 -0
new file mode 100644
index 0000000..89e6097
@@ -0,0 +1,15 @@
+Include stdint.h for u_* typedefs
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Inappropriate
+
+--- ./fts.c.orig
++++ ./fts.c
+@@ -46,6 +46,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <fts.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
Signature · 1 line
2.7.0
author
#7 lore raw

PATCH 7/53 connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR

In reply to Khem Raj

We now check at configure time of libc has pktinfo struct

---
 .../0003-Fix-header-inclusions-for-musl.patch      | 79 +++++++++++++++-------
 1 file changed, 56 insertions(+), 23 deletions(-)
meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch +56 -23
index 6327aa2..eefc683 100644
@@ -14,10 +14,10 @@ Upstream-Status: Pending
  tools/dnsproxy-test.c | 1 +
  5 files changed, 3 insertions(+), 5 deletions(-)
 
-diff --git a/gweb/gresolv.c b/gweb/gresolv.c
-index 3ad8e70..61d6fe8 100644
---- a/gweb/gresolv.c
-+++ b/gweb/gresolv.c
+Index: connman-1.30/gweb/gresolv.c
+===================================================================
+--- connman-1.30.orig/gweb/gresolv.c
++++ connman-1.30/gweb/gresolv.c
 @@ -28,6 +28,7 @@
  #include <stdarg.h>
  #include <string.h>
@@ -26,10 +26,10 @@ index 3ad8e70..61d6fe8 100644
  #include <resolv.h>
  #include <sys/types.h>
  #include <sys/socket.h>
-diff --git a/plugins/wifi.c b/plugins/wifi.c
-index dfe849f..99cff3f 100644
---- a/plugins/wifi.c
-+++ b/plugins/wifi.c
+Index: connman-1.30/plugins/wifi.c
+===================================================================
+--- connman-1.30.orig/plugins/wifi.c
++++ connman-1.30/plugins/wifi.c
 @@ -30,9 +30,8 @@
  #include <string.h>
  #include <sys/ioctl.h>
@@ -41,10 +41,10 @@ index dfe849f..99cff3f 100644
  
  #ifndef IFF_LOWER_UP
  #define IFF_LOWER_UP	0x10000
-diff --git a/src/tethering.c b/src/tethering.c
-index ceeec74..c44cb36 100644
---- a/src/tethering.c
-+++ b/src/tethering.c
+Index: connman-1.30/src/tethering.c
+===================================================================
+--- connman-1.30.orig/src/tethering.c
++++ connman-1.30/src/tethering.c
 @@ -31,10 +31,8 @@
  #include <stdio.h>
  #include <sys/ioctl.h>
@@ -56,10 +56,10 @@ index ceeec74..c44cb36 100644
  #include <netinet/in.h>
  #include <linux/if_bridge.h>
  
-diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
-index c34e10a..eae66fc 100644
---- a/tools/dhcp-test.c
-+++ b/tools/dhcp-test.c
+Index: connman-1.30/tools/dhcp-test.c
+===================================================================
+--- connman-1.30.orig/tools/dhcp-test.c
++++ connman-1.30/tools/dhcp-test.c
 @@ -33,7 +33,6 @@
  #include <arpa/inet.h>
  #include <net/route.h>
@@ -68,10 +68,10 @@ index c34e10a..eae66fc 100644
  
  #include <gdhcp/gdhcp.h>
  
-diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
-index 551cae9..226ba86 100644
---- a/tools/dnsproxy-test.c
-+++ b/tools/dnsproxy-test.c
+Index: connman-1.30/tools/dnsproxy-test.c
+===================================================================
+--- connman-1.30.orig/tools/dnsproxy-test.c
++++ connman-1.30/tools/dnsproxy-test.c
 @@ -27,6 +27,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -80,6 +80,39 @@ index 551cae9..226ba86 100644
  #include <arpa/inet.h>
  #include <netinet/in.h>
  #include <sys/types.h>
--- 
-2.5.1
-
+Index: connman-1.30/configure.ac
+===================================================================
+--- connman-1.30.orig/configure.ac
++++ connman-1.30/configure.ac
+@@ -173,6 +173,8 @@ AM_CONDITIONAL(PPTP_BUILTIN, test "${ena
+ 
+ AC_CHECK_HEADERS([execinfo.h])
+ 
++AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include <netinet/in.h>]])
++
+ AC_CHECK_HEADERS(resolv.h, dummy=yes,
+ 	AC_MSG_ERROR(resolver header files are required))
+ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+Index: connman-1.30/gdhcp/common.h
+===================================================================
+--- connman-1.30.orig/gdhcp/common.h
++++ connman-1.30/gdhcp/common.h
+@@ -19,6 +19,7 @@
+  *
+  */
+ 
++#include <config.h>
+ #include <netinet/udp.h>
+ #include <netinet/ip.h>
+ 
+@@ -170,8 +171,8 @@ static const uint8_t dhcp_option_lengths
+ 	[OPTION_U32]	= 4,
+ };
+ 
+-/* already defined within netinet/in.h if using GNU compiler */
+-#ifndef __USE_GNU
++/* already defined within netinet/in.h if using GNU or musl libc */
++#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
+ struct in6_pktinfo {
+ 	struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
+ 	unsigned int ipi6_ifindex;  /* send/recv interface index */
Signature · 1 line
2.7.0
author
#8 lore raw

PATCH 8/53 libcgroup: Add dependency on fts when building on musl

In reply to Khem Raj
---
 .../libcgroup/libcgroup/musl-decls-compat.patch    | 235 +++++++++++++++++++++
 meta/recipes-core/libcgroup/libcgroup_0.41.bb      |   4 +
 2 files changed, 239 insertions(+)
 create mode 100644 meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch new file +235 -0
new file mode 100644
index 0000000..65f4ef9
@@ -0,0 +1,235 @@
+commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa
+Author: Isaac Dunham <[email protected]>
+Date:   Fri Sep 5 22:35:32 2014 -0700
+
+    Remove __.*DECLS nonsense
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: libcgroup-0.41/include/libcgroup/config.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/config.h
++++ libcgroup-0.41/include/libcgroup/config.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_config 5. Configuration
+@@ -107,6 +109,8 @@ int cgroup_config_create_template_group(
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /*_LIBCGROUP_CONFIG_H*/
+Index: libcgroup-0.41/include/libcgroup/error.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/error.h
++++ libcgroup-0.41/include/libcgroup/error.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_errors 6. Error handling
+@@ -99,6 +101,8 @@ int cgroup_get_last_errno(void);
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/groups.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/groups.h
++++ libcgroup-0.41/include/libcgroup/groups.h
+@@ -11,7 +11,9 @@
+ #include <stdbool.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * Flags for cgroup_delete_cgroup_ext().
+@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro
+  */
+ 
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_GROUPS_H */
+Index: libcgroup-0.41/include/libcgroup/init.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/init.h
++++ libcgroup-0.41/include/libcgroup/init.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_init 1. Initialization
+@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/iterators.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/iterators.h
++++ libcgroup-0.41/include/libcgroup/iterators.h
+@@ -11,7 +11,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_iterators 3. Iterators
+@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo
+  * @}
+  */
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_ITERATORS_H */
+Index: libcgroup-0.41/include/libcgroup/tasks.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/tasks.h
++++ libcgroup-0.41/include/libcgroup/tasks.h
+@@ -12,7 +12,9 @@
+ #include <stdbool.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /** Flags for cgroup_change_cgroup_uid_gid(). */
+ enum cgflags {
+@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_TASKS_H */
+Index: libcgroup-0.41/src/daemon/cgrulesengd.h
+===================================================================
+--- libcgroup-0.41.orig/src/daemon/cgrulesengd.h
++++ libcgroup-0.41/src/daemon/cgrulesengd.h
+@@ -17,7 +17,9 @@
+ 
+ #include <features.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ #include "config.h"
+ #include "libcgroup.h"
+@@ -119,7 +121,9 @@ void cgre_flash_templates(int signum);
+  */
+ void cgre_catch_term(int signum);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _CGRULESENGD_H */
+ 
+Index: libcgroup-0.41/src/libcgroup-internal.h
+===================================================================
+--- libcgroup-0.41.orig/src/libcgroup-internal.h
++++ libcgroup-0.41/src/libcgroup-internal.h
+@@ -16,7 +16,9 @@
+ 
+ #define __LIBCG_INTERNAL
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ #include "config.h"
+ #include <fts.h>
+@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e
+  */
+ int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
+Index: libcgroup-0.41/include/libcgroup/log.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/log.h
++++ libcgroup-0.41/include/libcgroup/log.h
+@@ -11,7 +11,9 @@
+ 
+ #include <stdarg.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_log 7. Logging
+@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_LOG_H */
meta/recipes-core/libcgroup/libcgroup_0.41.bb +4 -0
index 287aecd..9597963 100644
@@ -11,12 +11,16 @@ inherit autotools pkgconfig
 DEPENDS = "bison-native flex-native ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2"
+SRC_URI_append_libc-musl = " file://musl-decls-compat.patch"
 
 SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
 SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
 
 UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libcg/files/libcgroup/"
 
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = "LIBS=-lfts"
+
 EXTRA_OECONF = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}"
 
 PACKAGES =+ "cgroups-pam-plugin"
Signature · 1 line
2.7.0
author
#9 lore raw

PATCH 9/53 linux-libc-headers: Port patches for linux-headers for musl

In reply to Khem Raj

These patches have revealed issues with linux kernel headers which has been proposed upstream but hasnt been applied yet

---
 ...mpat.h-fix-some-issues-arising-from-in6.h.patch | 82 ++++++++++++++++++++++
 ...t.h-prevent-redefinition-of-struct-ethhdr.patch | 59 ++++++++++++++++
 ...remove-inclusion-of-sysinfo.h-in-kernel.h.patch | 32 +++++++++
 .../linux-libc-headers/linux-libc-headers_4.1.bb   |  5 ++
 4 files changed, 178 insertions(+)
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch new file +82 -0
new file mode 100644
index 0000000..3db52cf
@@ -0,0 +1,82 @@
+From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001
+From: rofl0r <[email protected]>
+Date: Wed, 22 Jan 2014 00:48:28 +0100
+Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h
+
+namely redefinition of some structs provided by netinet/in.h.
+---
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Submitted
+
+ include/uapi/linux/libc-compat.h | 25 ++++++++-----------------
+ 1 file changed, 8 insertions(+), 17 deletions(-)
+
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index fa673e9..afe15c2 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -48,24 +48,15 @@
+ #ifndef _UAPI_LIBC_COMPAT_H
+ #define _UAPI_LIBC_COMPAT_H
+ 
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#ifndef __KERNEL__ /* we're used from userspace */
+ 
+-/* Coordinate with glibc netinet/in.h header. */
++/* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+ 
+-/* GLIBC headers included first so don't define anything
++/* libc headers included first so don't define anything
+  * that would already be defined. */
+ #define __UAPI_DEF_IN6_ADDR		0
+-/* The exception is the in6_addr macros which must be defined
+- * if the glibc code didn't define them. This guard matches
+- * the guard in glibc/inet/netinet/in.h which defines the
+- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
+-#if defined(__USE_MISC) || defined (__USE_GNU)
+ #define __UAPI_DEF_IN6_ADDR_ALT		0
+-#else
+-#define __UAPI_DEF_IN6_ADDR_ALT		1
+-#endif
+ #define __UAPI_DEF_SOCKADDR_IN6		0
+ #define __UAPI_DEF_IPV6_MREQ		0
+ #define __UAPI_DEF_IPPROTO_V6		0
+@@ -73,13 +64,13 @@
+ #define __UAPI_DEF_IN6_PKTINFO		0
+ #define __UAPI_DEF_IP6_MTUINFO		0
+ 
+-#else
++#else /* defined(_NETINET_IN_H) */
+ 
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that the libc will check the
+  * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN6_ADDR		1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and libc must
+  * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
+ #define __UAPI_DEF_SOCKADDR_IN6		1
+@@ -101,7 +92,7 @@
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+  * that we need. */
+-#else /* !defined(__GLIBC__) */
++#else /* __KERNEL__ */
+ 
+ /* Definitions for in6.h */
+ #define __UAPI_DEF_IN6_ADDR		1
+@@ -116,6 +107,6 @@
+ /* Definitions for xattr.h */
+ #define __UAPI_DEF_XATTR		1
+ 
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+ 
+ #endif /* _UAPI_LIBC_COMPAT_H */
+-- 
+2.6.4
+
meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch new file +59 -0

59 lines not on this page · raw message

meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch new file +32 -0
new file mode 100644
index 0000000..6d9e8d8
@@ -0,0 +1,32 @@
+From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001
+From: rofl0r <[email protected]>
+Date: Mon, 20 Jan 2014 21:31:34 +0100
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
+
+the declaration of struct sysinfo clashes with userspace.
+it's not quite clear why that header was included from kernel.h,
+as none of its functionality is needed.
+---
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Submitted
+
+ include/uapi/linux/kernel.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
+index 321e399..e8ff821 100644
+--- a/include/uapi/linux/kernel.h
++++ b/include/uapi/linux/kernel.h
+@@ -1,7 +1,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+ 
++#ifdef __GLIBC__
+ #include <linux/sysinfo.h>
++#endif
+ 
+ /*
+  * 'kernel.h' contains some often-used function prototypes etc
+-- 
+2.6.4
+
meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb +5 -0
index 01037c1..6f2c427 100644
@@ -1,4 +1,9 @@
 require linux-libc-headers.inc
 
+SRC_URI_append_libc-musl = "\
+    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
+    file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
+    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
+   "
 SRC_URI[md5sum] = "fe9dc0f6729f36400ea81aa41d614c37"
 SRC_URI[sha256sum] = "caf51f085aac1e1cea4d00dbbf3093ead07b551fc07b31b2a989c05f8ea72d9f"
Signature · 1 line
2.7.0
author
#10 lore raw

PATCH 10/53 xserver-xorg: Fix build with musl

In reply to Khem Raj

inb/outb are implemented for ARM on glibc but not on linux in general therefore the conditional has to reflect that

---
 .../xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch  | 18 ++++++++++++++++++
 .../xorg-xserver/xserver-xorg_1.18.0.bb                |  4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch new file +18 -0
new file mode 100644
index 0000000..4be441f
@@ -0,0 +1,18 @@
+inb/outb family for arm is only implemented on glibc
+so assumption across linux is wrong
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+Index: xorg-server-1.18.0/hw/xfree86/common/compiler.h
+===================================================================
+--- xorg-server-1.18.0.orig/hw/xfree86/common/compiler.h
++++ xorg-server-1.18.0/hw/xfree86/common/compiler.h
+@@ -758,7 +758,7 @@ inl(unsigned short port)
+     return xf86ReadMmio32Le((void *) ioBase, port);
+ }
+ 
+-#elif defined(__arm__) && defined(__linux__)
++#elif defined(__arm__) && defined(__GLIBC__)
+ 
+ /* for Linux on ARM, we use the LIBC inx/outx routines */
+ /* note that the appropriate setup via "ioperm" needs to be done */
meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb +3 -1
index 60973c5..e606dac 100644
@@ -1,6 +1,8 @@
 require xserver-xorg.inc
 
-SRC_URI += "file://configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch"
+SRC_URI += "file://configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch \
+            file://musl-arm-inb-outb.patch \
+           "
 SRC_URI[md5sum] = "3c1c1057d3ad27380d8dd87ffcc182cd"
 SRC_URI[sha256sum] = "195670819695d9cedd8dde95fbe069be0d0f488a77797a2d409f9f702daf312e"
 
Signature · 1 line
2.7.0
author
#11 lore raw

PATCH 11/53 gdk-pixbuf: Fix latent build issue exposed by musl

In reply to Khem Raj
---
 .../gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch      | 63 ++++++++++++++++++++++
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb |  1 +
 2 files changed, 64 insertions(+)
 create mode 100644 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch new file +63 -0
new file mode 100644
index 0000000..82a27c3
@@ -0,0 +1,63 @@
+From 205a3b04e1216c1df199aec95185f7f48b8e0491 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <[email protected]>
+Date: Tue, 6 Oct 2015 09:11:38 +0200
+Subject: Run only pixbuf-lowmem test on GNU libc
+
+The test case depends on GNU libc specific internals so we only run it
+on GNU libc.
+
+This fixes build on Linux with musl libc.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=756078
+---
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Backport
+
+ tests/Makefile.am     | 5 -----
+ tests/pixbuf-lowmem.c | 8 ++++++++
+ 2 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index bdd68f3..c122188 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -19,13 +19,8 @@ LDADD = \
+ noinst_PROGRAMS += 			\
+ 	pixbuf-read			\
+ 	pixbuf-random			\
+-	$(NULL)
+-
+-if OS_LINUX
+-noinst_PROGRAMS += 			\
+ 	pixbuf-lowmem			\
+ 	$(NULL)
+-endif
+ 
+ test_programs = 			\
+ 	animation			\
+diff --git a/tests/pixbuf-lowmem.c b/tests/pixbuf-lowmem.c
+index ae71788..9e9571f 100644
+--- a/tests/pixbuf-lowmem.c
++++ b/tests/pixbuf-lowmem.c
+@@ -24,6 +24,7 @@
+ #include <time.h>
+ #include <string.h>
+ 
++#ifdef __GLIBC__
+ #define PRETEND_MEM_SIZE (16 * 1024 * 1024)
+ #define REMAINING_MEM_SIZE 100000
+ 
+@@ -225,3 +226,10 @@ main (int argc, char **argv)
+   
+   return 0;
+ }
++#else
++int
++main (int argc, char **argv)
++{
++	return 0;
++}
++#endif
+-- 
+cgit v0.11.2
+
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb +1 -0
index 084fe36..104c743 100644
@@ -17,6 +17,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
            file://extending-libinstall-dependencies.patch \
            file://run-ptest \
            file://fatal-loader.patch \
+           file://libc_memfuncs.patch \
            "
 
 SRC_URI[md5sum] = "b1590189a2e89fab9f871959c168508c"
Signature · 1 line
2.7.0
author
#12 lore raw

PATCH 12/53 argp-standalone: Add recipe

In reply to Khem Raj

This helps packages like gnutls to compile with musl any package that needs glibc's implementation of argp can link to this library

---
 .../argp-standalone/argp-standalone_1.3.bb         | 28 ++++++++
 .../files/0001-throw-in-funcdef.patch              | 84 ++++++++++++++++++++++
 .../argp-standalone/files/0002-isprint.patch       | 51 +++++++++++++
 3 files changed, 163 insertions(+)
 create mode 100644 meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
 create mode 100644 meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
 create mode 100644 meta/recipes-support/argp-standalone/files/0002-isprint.patch
meta/recipes-support/argp-standalone/argp-standalone_1.3.bb new file +28 -0
new file mode 100644
index 0000000..a5d20d3
@@ -0,0 +1,28 @@
+# Copyright (C) 2015 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Glibc hierarchical argument parsing standalone library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/misc/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://argp.h;beginline=1;endline=20;md5=008b7e53dea6f9e1d9fdef0d9cf3184a"
+SECTION = "libs"
+
+SRC_URI = "http://www.lysator.liu.se/~nisse/misc/argp-standalone-${PV}.tar.gz \
+           file://0001-throw-in-funcdef.patch \
+           file://0002-isprint.patch \
+          "
+SRC_URI[md5sum] = "720704bac078d067111b32444e24ba69"
+SRC_URI[sha256sum] = "dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be"
+
+inherit autotools
+
+CFLAGS += "-fPIC -U__OPTIMIZE__"
+
+do_install() {
+	install -D -m 0644 ${B}/libargp.a ${D}${libdir}/libargp.a
+	install -D -m 0644 ${S}/argp.h ${D}${includedir}/argp.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch new file +84 -0

84 lines not on this page · raw message

meta/recipes-support/argp-standalone/files/0002-isprint.patch new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
2.7.0
author
#13 lore raw

PATCH 13/53 gnutls: Link with libargp on musl and depend on argp-standalone

In reply to Khem Raj
---
 meta/recipes-support/gnutls/gnutls.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-support/gnutls/gnutls.inc +2 -0
index c1ec120..5bcfc9c 100644
@@ -2,6 +2,7 @@ SUMMARY = "GNU Transport Layer Security Library"
 HOMEPAGE = "http://www.gnu.org/software/gnutls/"
 BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
 DEPENDS = "nettle libidn"
+DEPENDS_append_libc-musl = " argp-standalone "
 
 LICENSE = "GPLv3+ & LGPLv2.1+"
 LICENSE_${PN} = "LGPLv2.1+"
@@ -28,6 +29,7 @@ EXTRA_OECONF="--disable-rpath \
               --without-p11-kit \
               --enable-openssl-compatibility \
               "
+LDFLAGS_append_libc-musl = " -largp "
 
 do_configure_prepend() {
 	for dir in . lib; do
Signature · 1 line
2.7.0
author
#14 lore raw

PATCH 14/53 util-linux: Fix ptest builds on musl

In reply to Khem Raj

musl doesnt implement error() API, hence provide one

---
 .../util-linux/uuid-test-error-api.patch           | 92 ++++++++++++++++++++++
 meta/recipes-core/util-linux/util-linux_2.27.1.bb  |  1 +
 2 files changed, 93 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch new file +92 -0
new file mode 100644
index 0000000..1b0ff79
@@ -0,0 +1,92 @@
+This patch adds error() API implementation for non-glibc system C libs
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: util-linux-2.27.1/tests/helpers/test_uuidd.c
+===================================================================
+--- util-linux-2.27.1.orig/tests/helpers/test_uuidd.c
++++ util-linux-2.27.1/tests/helpers/test_uuidd.c
+@@ -23,7 +23,6 @@
+  *
+  *	make uuidd uuidgen localstatedir=/var
+  */
+-#include <error.h>
+ #include <libgen.h>
+ #include <pthread.h>
+ #include <stdio.h>
+@@ -39,6 +38,17 @@
+ #include "xalloc.h"
+ #include "strutils.h"
+ 
++#ifdef __GLIBC__
++#include <error.h>
++#else
++extern void (*error_print_progname)(void);
++extern unsigned int error_message_count;
++extern int error_one_per_line;
++
++void error(int, int, const char *, ...);
++void error_at_line(int, int, const char *, unsigned int, const char *, ...);
++#endif
++
+ #define LOG(level,args) if (loglev >= level) { fprintf args; }
+ 
+ size_t nprocesses = 4;
+@@ -257,6 +267,56 @@ static void object_dump(size_t idx, obje
+ 	fprintf(stderr, "}\n");
+ }
+ 
++#ifndef __GLIBC__
++extern char *__progname;
++
++void (*error_print_progname)(void) = 0;
++unsigned int error_message_count = 0;
++int error_one_per_line = 0;
++
++static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
++{
++	if (file && error_one_per_line) {
++		static const char *oldfile;
++		static unsigned int oldline;
++		if (line == oldline && strcmp(file, oldfile) == 0)
++			return;
++		oldfile = file;
++		oldline = line;
++	}
++	if (error_print_progname)
++		error_print_progname();
++	else
++		fprintf(stderr, "%s: ", __progname);
++	if (file)
++		fprintf(stderr, "%s:%u: ", file, line);
++	vfprintf(stderr, fmt, ap);
++	if (e)
++		fprintf(stderr, ": %s", strerror(e));
++	putc('\n', stderr);
++	fflush(stderr);
++	error_message_count++;
++	if (status)
++		exit(status);
++}
++
++void error(int status, int e, const char *fmt, ...)
++{
++	va_list ap;
++	va_start(ap,fmt);
++	eprint(status, e, 0, 0, fmt, ap);
++	va_end(ap);
++}
++
++void error_at_line(int status, int e, const char *file, unsigned int line, const char *fmt, ...)
++{
++	va_list ap;
++	va_start(ap,fmt);
++	eprint(status, e, file, line, fmt, ap);
++	va_end(ap);
++}
++#endif /* __GLIBC__ */
++
+ int main(int argc, char *argv[])
+ {
+ 	size_t i, nfailed = 0, nignored = 0;
meta/recipes-core/util-linux/util-linux_2.27.1.bb +1 -0
index 14a77ca..7549158 100644
@@ -19,6 +19,7 @@ SRC_URI += "file://util-linux-ng-2.16-mount_lock_path.patch \
             file://avoid_unsupported_grep_opts.patch \
             file://display_testname_for_subtest.patch \
             file://avoid_parallel_tests.patch \
+            file://uuid-test-error-api.patch \
 "
 SRC_URI[md5sum] = "3cd2698d1363a2c64091c2dadc974647"
 SRC_URI[sha256sum] = "0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290"
Signature · 1 line
2.7.0
author
#15 lore raw

PATCH 15/53 webkitgtk: Fix build with clang

In reply to Khem Raj

backtrace is glibc only feature on linux so check for glibc before using it
Clangs clear_cache has different signature than gcc provided builtin make it compatible for both

---
 ...nable-backtrace-on-linux-when-using-glibc.patch | 39 ++++++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk/clang.patch     | 25 ++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.10.4.bb       |  2 ++
 3 files changed, 66 insertions(+)
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/clang.patch
meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch new file +39 -0
new file mode 100644
index 0000000..146087b
@@ -0,0 +1,39 @@
+From 0b68ad206d2d90df78d91cad4da19152084014cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 16 Sep 2015 05:15:04 +0000
+Subject: [PATCH] Enable backtrace on linux when using glibc
+
+We dont have backtrace() implemented on non-glibc libc's on linux
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ Source/WTF/wtf/Assertions.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp
+index 191d53f..a4d86b5 100644
+--- a/Source/WTF/wtf/Assertions.cpp
++++ b/Source/WTF/wtf/Assertions.cpp
+@@ -68,7 +68,7 @@
+ #include <unistd.h>
+ #endif
+ 
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+ #include <cxxabi.h>
+ #include <dlfcn.h>
+ #include <execinfo.h>
+@@ -225,7 +225,7 @@ void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
+ 
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+     *size = backtrace(stack, *size);
+ #elif OS(WINDOWS)
+     // The CaptureStackBackTrace function is available in XP, but it is not defined
+-- 
+2.5.2
+
meta/recipes-sato/webkit/webkitgtk/clang.patch new file +25 -0
new file mode 100644
index 0000000..ef77755
@@ -0,0 +1,25 @@
+Clang's builtin for clear_cache accepts char* and errors out when using void*,
+using char* work on both gcc and clang since char* is auto-converted to void* in gcc case
+
+Source/JavaScriptCore/assembler/ARM64Assembler.h:2857:33: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'void *'
+        __builtin___clear_cache(reinterpret_cast<void*>(begin), reinterpret_cast<void*>(end));
+                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1 error generated.
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Pending
+
+Index: webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h
+===================================================================
+--- webkitgtk-2.8.5.orig/Source/JavaScriptCore/assembler/ARM64Assembler.h
++++ webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h
+@@ -2854,7 +2854,7 @@ public:
+ #if OS(LINUX) && COMPILER(GCC)
+     static inline void linuxPageFlush(uintptr_t begin, uintptr_t end)
+     {
+-        __builtin___clear_cache(reinterpret_cast<void*>(begin), reinterpret_cast<void*>(end));
++        __builtin___clear_cache(reinterpret_cast<char*>(begin), reinterpret_cast<char*>(end));
+     }
+ #endif
+ 
meta/recipes-sato/webkit/webkitgtk_2.10.4.bb +2 -0
index 4d5aeb4..f5add32 100644
@@ -12,6 +12,8 @@ LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d842
 
 SRC_URI = "\
   http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
+  file://clang.patch \
+  file://0001-Enable-backtrace-on-linux-when-using-glibc.patch \
   "
 SRC_URI[md5sum] = "fb010031c6f61c3a1a00793b112badb5"
 SRC_URI[sha256sum] = "dbf8260da5cac0c74de2d3cce1fe7c519da3cd816a2c769cb6c6d56addd2f055"
Signature · 1 line
2.7.0
author
#16 lore raw

PATCH 16/53 elfutils: Fix build with uclibc

In reply to Khem Raj

Remove mempcpy patch its already in uclibc now
refresh libargp patch to match latest elfutils

---
 .../uclibc-support-for-elfutils-0.161.patch        | 79 ++++++++++++++--------
 .../elfutils/elfutils/mempcpy.patch                | 24 -------
 meta/recipes-devtools/elfutils/elfutils_0.148.bb   |  1 -
 meta/recipes-devtools/elfutils/elfutils_0.163.bb   |  3 +-
 4 files changed, 52 insertions(+), 55 deletions(-)
 delete mode 100644 meta/recipes-devtools/elfutils/elfutils/mempcpy.patch
meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch +51 -28
index f1533bf..7167965 100644
@@ -25,11 +25,11 @@ Signed-off-by: Junling Zheng <[email protected]>
  libelf/Makefile.am | 5 +++++
  4 files changed, 23 insertions(+), 1 deletion(-)
 
-diff --git a/configure.ac b/configure.ac
-index a1ad6db..81fc33f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -70,6 +70,14 @@ AS_IF([test "$use_locks" = yes],
+Index: elfutils-0.163/configure.ac
+===================================================================
+--- elfutils-0.163.orig/configure.ac
++++ elfutils-0.163/configure.ac
+@@ -64,6 +64,14 @@ AS_IF([test "$use_locks" = yes],
  
  AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
  
@@ -44,63 +44,86 @@ index a1ad6db..81fc33f 100644
  AC_PROG_CC
  AC_PROG_RANLIB
  AC_PROG_YACC
-diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
-index 3beccf3..9ba6c04 100644
---- a/libcpu/Makefile.am
-+++ b/libcpu/Makefile.am
-@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
+@@ -346,18 +354,13 @@ AC_LINK_IFELSE(
+ )
+ 
+ dnl If our libc doesn't provide argp, then test for libargp
+-if test "$libc_has_argp" = "false" ; then
+-	AC_MSG_WARN("libc does not have argp")
+-	AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
+-
+-	if test "$have_argp" = "false"; then
+-		AC_MSG_ERROR("no libargp found")
+-	else
+-		argp_LDADD="-largp"
+-	fi
+-else
+-	argp_LDADD=""
+-fi
++AS_IF([test "x$libc_has_argp" = "xfalse"],
++	[AC_MSG_WARN("libc does not have argp")
++	AC_CHECK_LIB([argp], [argp_parse], [have_argp="true" argp_LDADD="-largp"], [have_argp="false"])], [argp_LDADD=""])
++
++AS_IF([test "x$libc_has_argp" = "xfalse" -a "x$have_argp" = "xfalse"],
++	AC_CHECK_LIB([uargp], [argp_parse], [have_uargp="true" argp_LDADD="-luargp"], [have_uargp="false"])], [argp_LDADD=""])
++
+ AC_SUBST([argp_LDADD])
+ 
+ dnl The directories with content.
+Index: elfutils-0.163/libcpu/Makefile.am
+===================================================================
+--- elfutils-0.163.orig/libcpu/Makefile.am
++++ elfutils-0.163/libcpu/Makefile.am
+@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
  i386_lex.o: i386_parse.h
  i386_gendis_LDADD = $(libeu) -lm
  
 +if USE_UCLIBC
-+i386_gendis_LDADD += -luargp -lintl
++i386_gendis_LDADD += -lintl
 +endif
 +
  i386_parse.h: i386_parse.c ;
  
  EXTRA_DIST = defs/i386
-diff --git a/libdw/Makefile.am b/libdw/Makefile.am
-index 887da6b..d31b428 100644
---- a/libdw/Makefile.am
-+++ b/libdw/Makefile.am
+Index: elfutils-0.163/libdw/Makefile.am
+===================================================================
+--- elfutils-0.163.orig/libdw/Makefile.am
++++ elfutils-0.163/libdw/Makefile.am
 @@ -102,6 +102,11 @@ endif
  libdw_pic_a_SOURCES =
  am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
  
 +libdw_so_LDLIBS =
 +if USE_UCLIBC
-+libdw_so_LDLIBS += -lintl -luargp
++libdw_so_LDLIBS += -lintl
 +endif
 +
  libdw_so_SOURCES =
  libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
  	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
-@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
  		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
  		-Wl,--version-script,$<,--no-undefined \
  		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
--		-ldl $(zip_LIBS)
-+		-ldl $(zip_LIBS) $(libdw_so_LDLIBS)
+-		-ldl $(argp_LDADD) $(zip_LIBS)
++		-ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
  	@$(textrel_check)
  	ln -fs $@ $@.$(VERSION)
  
-diff --git a/libelf/Makefile.am b/libelf/Makefile.am
-index afcb2aa..02836a1 100644
---- a/libelf/Makefile.am
-+++ b/libelf/Makefile.am
-@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
+Index: elfutils-0.163/libelf/Makefile.am
+===================================================================
+--- elfutils-0.163.orig/libelf/Makefile.am
++++ elfutils-0.163/libelf/Makefile.am
+@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_has
  libelf_pic_a_SOURCES =
  am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
  
 +
  libelf_so_LDLIBS =
 +if USE_UCLIBC
-+libelf_so_LDLIBS += -lintl -luargp
++libelf_so_LDLIBS += -lintl
 +endif
 +
  if USE_LOCKS
  libelf_so_LDLIBS += -lpthread
  endif
--- 
-1.8.3.4
-
meta/recipes-devtools/elfutils/elfutils/mempcpy.patch deleted +0 -24
deleted file mode 100644
index 24e31fa..0000000
@@ -1,24 +0,0 @@
-
-uclibc does not export __mempcpy like glibc so we alias it here.
-This patch may make sense for upstream but elfutils uses more
-glibc specific features like obstack_printf which are missing in
-uclibc they need to be fixed along to make it work all the way
-
-Upstream-Status: Inappropriate[Elfutils uses more glibc specific features]
-
-Signed-off-by: Khem Raj <[email protected]>
-
-Index: elfutils-0.148/libelf/elf_begin.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf_begin.c
-+++ elfutils-0.148/libelf/elf_begin.c
-@@ -68,6 +68,9 @@
- #include "libelfP.h"
- #include "common.h"
- 
-+#ifdef __UCLIBC__
-+#define __mempcpy mempcpy
-+#endif
- 
- /* Create descriptor for archive in memory.  */
- static inline Elf *
meta/recipes-devtools/elfutils/elfutils_0.148.bb +0 -1
index 0d8490d..ff53257 100644
@@ -27,7 +27,6 @@ SRC_URI += "\
         file://elf_additions.diff \
         file://elfutils-fsize.patch \
         file://remove-unused.patch \
-        file://mempcpy.patch \
         file://fix_for_gcc-4.7.patch \
         file://dso-link-change.patch \
         file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \
meta/recipes-devtools/elfutils/elfutils_0.163.bb +1 -2
index e391813..41bfbdc 100644
@@ -11,7 +11,6 @@ SRC_URI[md5sum] = "77ce87f259987d2e54e4d87b86cbee41"
 SRC_URI[sha256sum] = "7c774f1eef329309f3b05e730bdac50013155d437518a2ec0e24871d312f2e23"
 
 SRC_URI += "\
-        file://mempcpy.patch \
         file://dso-link-change.patch \
         file://Fix_elf_cvt_gunhash.patch \
         file://fixheadercheck.patch \
@@ -51,7 +50,7 @@ EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
 
 do_install_append() {
 	if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
-		rm ${D}${bindir}/eu-objdump
+		rm -f ${D}${bindir}/eu-objdump
 	fi
 }
 
Signature · 1 line
2.7.0
author
#17 lore raw

PATCH 17/53 packagegroup-self-hosted.bb: Move glibc-gconv-ibm850 to glibc only case

In reply to Khem Raj

This package is not provided by non-glibc libcs therefore add it only when libc is glibc

---
 meta/recipes-core/packagegroups/packagegroup-self-hosted.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/packagegroups/packagegroup-self-hosted.bb +1 -1
index d38be26..bb8371e 100644
@@ -67,7 +67,6 @@ RDEPENDS_packagegroup-self-hosted-sdk = "\
     cpp \
     cpp-symlinks \
     distcc \
-    glibc-gconv-ibm850 \
     file \
     findutils \
     g++ \
@@ -93,6 +92,7 @@ RDEPENDS_packagegroup-self-hosted-sdk = "\
     "
 # glibc-utils: for rpcgen
 RDEPENDS_packagegroup-self-hosted-sdk_append_libc-glibc = "\
+    glibc-gconv-ibm850 \
     glibc-utils \
     "
 RDEPENDS_packagegroup-self-hosted-debug = " \
Signature · 1 line
2.7.0
author
#18 lore raw

PATCH 18/53 guile: Fix build with uclibc

In reply to Khem Raj
---
 .../guile/files/remove_strcase_l_funcs.patch       | 38 ++++++++++++++++++++++
 meta/recipes-devtools/guile/guile_2.0.11.bb        |  3 +-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch
meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch new file +38 -0
new file mode 100644
index 0000000..e7a06fe
@@ -0,0 +1,38 @@
+These unused functions cause build failures with uclibc since they reference __uclibc_locale_struct
+and this is exposed by uclibc API headers only if C locales are built, but for OE we build full locale
+support
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+Index: guile-2.0.11/libguile/i18n.c
+===================================================================
+--- guile-2.0.11.orig/libguile/i18n.c
++++ guile-2.0.11/libguile/i18n.c
+@@ -851,27 +851,6 @@ str_downcase (register char *dst, regist
+   *dst = '\0';
+ }
+ 
+-#ifdef USE_GNU_LOCALE_API
+-static inline void
+-str_upcase_l (register char *dst, register const char *src,
+-	      scm_t_locale locale)
+-{
+-  for (; *src != '\0'; src++, dst++)
+-    *dst = toupper_l (*src, locale);
+-  *dst = '\0';
+-}
+-
+-static inline void
+-str_downcase_l (register char *dst, register const char *src,
+-		scm_t_locale locale)
+-{
+-  for (; *src != '\0'; src++, dst++)
+-    *dst = tolower_l (*src, locale);
+-  *dst = '\0';
+-}
+-#endif
+-
+-
+ SCM_DEFINE (scm_string_locale_lt, "string-locale<?", 2, 1, 0,
+ 	    (SCM s1, SCM s2, SCM locale),
+ 	    "Compare strings @var{s1} and @var{s2} in a locale-dependent way."
meta/recipes-devtools/guile/guile_2.0.11.bb +2 -1
index fa45008..413c81d 100644
@@ -23,6 +23,7 @@ SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
            file://workaround-ice-ssa-corruption.patch \
            file://libguile-Makefile.am-hook.patch \
            file://libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch \
+           file://remove_strcase_l_funcs.patch \
            "
 
 #           file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
@@ -50,7 +51,7 @@ EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without
 EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
                                      --with-libgmp-prefix=${STAGING_LIBDIR} \
                                      --with-libltdl-prefix=${STAGING_LIBDIR}"
-
+EXTRA_OECONF_append_libc-uclibc = " guile_cv_use_csqrt=no "
 do_configure_prepend() {
 	mkdir -p po
 }
Signature · 1 line
2.7.0
author
#19 lore raw

PATCH 19/53 gnutls: Link with libuargp on uclibc

In reply to Khem Raj

uclibc has its own implementation for libargp

---
 meta/recipes-support/gnutls/gnutls.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-support/gnutls/gnutls.inc +2 -1
index 5bcfc9c..90597db 100644
@@ -1,7 +1,7 @@
 SUMMARY = "GNU Transport Layer Security Library"
 HOMEPAGE = "http://www.gnu.org/software/gnutls/"
 BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
-DEPENDS = "nettle libidn"
+DEPENDS = "nettle libidn virtual/libiconv"
 DEPENDS_append_libc-musl = " argp-standalone "
 
 LICENSE = "GPLv3+ & LGPLv2.1+"
@@ -30,6 +30,7 @@ EXTRA_OECONF="--disable-rpath \
               --enable-openssl-compatibility \
               "
 LDFLAGS_append_libc-musl = " -largp "
+LDFLAGS_append_libc-uclibc = " -luargp "
 
 do_configure_prepend() {
 	for dir in . lib; do
Signature · 1 line
2.7.0
author
#20 lore raw

PATCH 20/53 mtools: Fix build with uclibc

In reply to Khem Raj

unlike glibc, uclibc does not have internal APIs implemented for libiconv, so it needs to depend upon libiconv

---
 meta/recipes-devtools/mtools/mtools_4.0.18.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/mtools/mtools_4.0.18.bb +3 -0
index bc9b79c..479fd32 100644
@@ -5,6 +5,7 @@ SECTION = "optional"
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
+DEPENDS += "virtual/libiconv"
 
 RDEPENDS_${PN}_libc-glibc = "glibc-gconv-ibm850"
 RRECOMMENDS_${PN}_libc-glibc = "\
@@ -35,6 +36,8 @@ inherit autotools texinfo
 
 EXTRA_OECONF = "--without-x"
 
+LDFLAGS_append_libc-uclibc = " -liconv "
+
 BBCLASSEXTEND = "native nativesdk"
 
 PACKAGECONFIG ??= ""
Signature · 1 line
2.7.0
#21 lore raw

Re: [PATCH 20/53] mtools: Fix build with uclibc

Quoted 2 lines · Khem Raj

+DEPENDS += "virtual/libiconv"

Update: this breaks all builds for x86 hardware:

ERROR: Nothing PROVIDES 'virtual/libiconv-native' (but virtual:native:/home/ross/Yocto/poky/meta/recipes-devtools/mtools/ mtools_4.0.18.bb DEPENDS on or otherwise requires it). Close matches:
virtual/libiconv
virtual/libx11-native
virtual/libsdl-native

It appears to be the first time that virtual/libiconv-native appears. Should we just ASSUME_PROVIDED that?

Ross

#22 lore raw

Re: [PATCH 20/53] mtools: Fix build with uclibc

Quoted 3 lines · Ross

It appears to be the first time that virtual/libiconv-native appears. Should we just ASSUME_PROVIDED that?

I think this is the right solution - patch sent.

Ross

author
#23 lore raw

Re: [PATCH 20/53] mtools: Fix build with uclibc

Quoted 8 lines · Ross
Quoted 3 lines · Ross

It appears to be the first time that virtual/libiconv-native appears. Should we just ASSUME_PROVIDED that?

I think this is the right solution - patch sent.

yes thats the right solution , I havent done builds for qemux86/64 for sometime after RPs change in the bbclassextend area. Since I had reverted that fix in my tree I did not see this error.

Quoted 2 lines

Ross

author
#24 lore raw

PATCH 21/53 parted: Fix build with uclibc

In reply to Khem Raj

unlike glibc, uclibc does not have internal APIs implemented for libiconv, so it needs to depend upon libiconv

---
 meta/recipes-extended/parted/parted_3.2.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-extended/parted/parted_3.2.bb +2 -1
index ff8ae09..30c00c8 100644
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.gnu.org/software/parted/parted.html"
 LICENSE = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
 SECTION = "console/tools"
-DEPENDS = "ncurses readline util-linux"
+DEPENDS = "ncurses readline util-linux virtual/libiconv"
 PR = "r1"
 
 SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
@@ -21,6 +21,7 @@ SRC_URI[md5sum] = "0247b6a7b314f8edeb618159fa95f9cb"
 SRC_URI[sha256sum] = "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
 
 EXTRA_OECONF = "--disable-device-mapper"
+LDFLAGS_append_libc-uclibc = " -liconv "
 
 inherit autotools pkgconfig gettext texinfo ptest
 
Signature · 1 line
2.7.0
author
#25 lore raw

PATCH 22/53 net-tools: Link with libintl on uclibc

In reply to Khem Raj

libintl is needed explicitly on linker cmdline on uclibc since the APIs are not in libc itelf.

---
 meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/net-tools/net-tools_1.60-26.bb +1 -1
index 923d048..04ea76f 100644
@@ -30,7 +30,7 @@ SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e4
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/"
 
 inherit gettext
-
+LDFLAGS_append_libc-uclibc = " -lintl "
 # The Makefile is lame, no parallel build
 PARALLEL_MAKE = ""
 
Signature · 1 line
2.7.0
author
#26 lore raw

PATCH 23/53 libdrm: Upgrade 2.4.65 -> 2.4.66

In reply to Khem Raj

Fix test build failures

---
 ...tests-kms-steal-crtc-Include-sys-select.h.patch | 33 ++++++++++++++++++++++
 .../recipes-graphics/drm/libdrm/installtests.patch | 24 +++++-----------
 .../drm/{libdrm_2.4.65.bb => libdrm_2.4.66.bb}     |  8 ++++--
 3 files changed, 45 insertions(+), 20 deletions(-)
 create mode 100644 meta/recipes-graphics/drm/libdrm/0001-tests-kms-steal-crtc-Include-sys-select.h.patch
 rename meta/recipes-graphics/drm/{libdrm_2.4.65.bb => libdrm_2.4.66.bb} (86%)
meta/recipes-graphics/drm/libdrm/0001-tests-kms-steal-crtc-Include-sys-select.h.patch new file +33 -0
new file mode 100644
index 0000000..c18228e
@@ -0,0 +1,33 @@
+From 46fb5516fb0ab17bcf46a0306a11e8966bb36e14 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Dec 2015 22:17:21 +0000
+Subject: [PATCH] tests/kms-steal-crtc: Include sys/select.h
+
+Fixes errors e.g.
+
+error: implicit declaration of function 'select'
+
+and missing definitions of FD_* defines
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Submitted
+
+ tests/kms/kms-steal-crtc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/kms/kms-steal-crtc.c b/tests/kms/kms-steal-crtc.c
+index 2f7f327..24d70ab 100644
+--- a/tests/kms/kms-steal-crtc.c
++++ b/tests/kms/kms-steal-crtc.c
+@@ -31,6 +31,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <sys/select.h>
+ 
+ #include <drm_fourcc.h>
+ 
+-- 
+2.6.4
+
meta/recipes-graphics/drm/libdrm/installtests.patch +7 -17
index f460ef5..30e0a61 100644
@@ -4,22 +4,12 @@ Upstream-Status: Inappropriate [configuration]
 
 Signed-off-by: Yu Ke <[email protected]>
 
-Index: libdrm-2.4.65/tests/Makefile.am
+Index: libdrm-2.4.66/tests/Makefile.am
 ===================================================================
---- libdrm-2.4.65.orig/tests/Makefile.am
-+++ libdrm-2.4.65/tests/Makefile.am
-@@ -29,9 +29,11 @@ AM_CFLAGS = \
- 
- LDADD = $(top_builddir)/libdrm.la
- 
--check_PROGRAMS = \
--	dristat \
--	drmstat
-+bin_PROGRAMS = \
-+        dristat \
-+        drmstat
-+ 
-+check_PROGRAMS =
- 
- dristat_LDADD = -lm
+--- libdrm-2.4.66.orig/tests/Makefile.am
++++ libdrm-2.4.66/tests/Makefile.am
+@@ -73,3 +73,4 @@ TESTS +=					\
+ endif
  
+ check_PROGRAMS += $(TESTS)
++bin_PROGRAMS = $(check_PROGRAMS)
meta/recipes-graphics/drm/libdrm_2.4.66.bb renamed from meta/recipes-graphics/drm/libdrm_2.4.65.bb +5 -3
similarity index 86%
rename from meta/recipes-graphics/drm/libdrm_2.4.65.bb
rename to meta/recipes-graphics/drm/libdrm_2.4.66.bb
index e5ed260..214dccc 100644
@@ -11,10 +11,12 @@ PROVIDES = "drm"
 DEPENDS = "libpthread-stubs udev libpciaccess"
 
 SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
-           file://installtests.patch "
+           file://installtests.patch \
+           file://0001-tests-kms-steal-crtc-Include-sys-select.h.patch \
+          "
 
-SRC_URI[md5sum] = "de49916e5f8aef4eba55223c79709b05"
-SRC_URI[sha256sum] = "71960ac8bde7d710992b1bc8879935e8300a870c36bd06f22412d0447e3d96c4"
+SRC_URI[md5sum] = "c6809c48538d6e5999588832045ff014"
+SRC_URI[sha256sum] = "79cb8e988749794edfb2d777b298d5292eff353bbbb71ed813589e61d2bc2d76"
 
 inherit autotools pkgconfig
 
Signature · 1 line
2.7.0
author
#27 lore raw

PATCH 24/53 directfb: Fix build with musl

In reply to Khem Raj

compar_fn_t, sigval_t and non-posix recursive mutexes are not available in musl

---
 meta/recipes-graphics/directfb/directfb.inc        |  5 ++
 .../directfb/directfb/compar_fn_t.patch            | 62 ++++++++++++++++++++++
 .../directfb/directfb/union-sigval.patch           | 19 +++++++
 .../directfb/use-PTHREAD_MUTEX_RECURSIVE.patch     | 19 +++++++
 4 files changed, 105 insertions(+)
 create mode 100644 meta/recipes-graphics/directfb/directfb/compar_fn_t.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/union-sigval.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch
meta/recipes-graphics/directfb/directfb.inc +5 -0
index 603aba3..3a79a8f 100644
@@ -16,7 +16,12 @@ SRC_URI = "http://www.directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${PV}.ta
            file://fusion.patch \
            file://bashism.patch \
            file://0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch \
+           file://compar_fn_t.patch \
           "
+SRC_URI_append_libc-musl = "\
+                            file://union-sigval.patch \
+                            file://use-PTHREAD_MUTEX_RECURSIVE.patch \
+                           "
 
 S = "${WORKDIR}/DirectFB-${PV}"
 
meta/recipes-graphics/directfb/directfb/compar_fn_t.patch new file +62 -0

62 lines not on this page · raw message

meta/recipes-graphics/directfb/directfb/union-sigval.patch new file +19 -0
new file mode 100644
index 0000000..29f45c7
@@ -0,0 +1,19 @@
+This patch is taken from gentoo musl overlay
+sigval_t is glibc only construct, we use a union of sigval
+which pretty much is same effect as sigval_t
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/system.c DirectFB-1.7.6/lib/direct/os/linux/glibc/system.c
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/system.c	2014-07-15 02:54:58.000000000 -0400
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/system.c	2015-07-18 16:55:35.077989166 -0400
+@@ -111,7 +111,7 @@
+ void
+ direct_trap( const char *domain, int sig )
+ {
+-     sigval_t val;
++     union sigval val;
+ 
+      if (direct_config->delay_trap_ms) {
+           D_LOG( Direct_Trap, VERBOSE, "NOT RAISING signal %d from %s, waiting for %dms... attach gdb --pid=%d\n", sig, domain, direct_config->delay_trap_ms, getpid() );
meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file +19 -0
new file mode 100644
index 0000000..e65f59e
@@ -0,0 +1,19 @@
+This patch is taken from gentoo musl overlay
+uses recursive mutex directly instead of non-posix version
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h	2013-12-18 19:16:24.000000000 -0500
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h	2015-07-18 16:57:47.178982835 -0400
+@@ -46,7 +46,7 @@
+ /**********************************************************************************************************************/
+ 
+ #define DIRECT_MUTEX_INITIALIZER(name)            { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
++#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_MUTEX_RECURSIVE }
+ 
+ #endif
+ 
Signature · 1 line
2.7.0
#28 lore raw

Re: [PATCH 24/53] directfb: Fix build with musl

Quoted 19 lines · Khem Raj

compar_fn_t, sigval_t and non-posix recursive mutexes are not available in musl

---
 meta/recipes-graphics/directfb/directfb.inc        |  5 ++
 .../directfb/directfb/compar_fn_t.patch            | 62 ++++++++++++++++++++++
 .../directfb/directfb/union-sigval.patch           | 19 +++++++
 .../directfb/use-PTHREAD_MUTEX_RECURSIVE.patch     | 19 +++++++
 4 files changed, 105 insertions(+)
 create mode 100644 meta/recipes-graphics/directfb/directfb/compar_fn_t.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/union-sigval.patch
 create mode 100644 meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch
meta/recipes-graphics/directfb/directfb.inc +0 -0
index 603aba3..3a79a8f 100644

meta/recipes-graphics/directfb/directfb.inc SRC_URI = "http://www.directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${PV}.ta · line 24

Quoted 9 lines
meta/recipes-graphics/directfb/directfb.inc +5 -0
@@ -16,7 +16,12 @@ SRC_URI = "http://www.directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${PV}.ta
            file://fusion.patch \
            file://bashism.patch \
            file://0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch \
+           file://compar_fn_t.patch \
           "
+SRC_URI_append_libc-musl = "\
+                            file://union-sigval.patch \
+                            file://use-PTHREAD_MUTEX_RECURSIVE.patch \
+                           "

For patches which fix 'correctness' issues uncovered by musl maybe it's better to apply the patches unconditionally, so they get some test cover from non-musl builds?

Especially true in this case - see below.

Quoted 107 lines
meta/recipes-graphics/directfb/directfb.inc +0 -0
 S = "${WORKDIR}/DirectFB-${PV}"
 
meta/recipes-graphics/directfb/directfb/compar_fn_t.patch new file +62 -0
new file mode 100644
index 0000000..ee4d900
@@ -0,0 +1,62 @@
+test for __compar_fn_t and if not defined by libc then define it
+help make directfb compile with musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: DirectFB-1.7.7/configure.in
+===================================================================
+--- DirectFB-1.7.7.orig/configure.in
++++ DirectFB-1.7.7/configure.in
+@@ -112,6 +112,17 @@ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)
+ AC_CHECK_FUNCS(fork)
+
++AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [
++    AC_TRY_COMPILE(
++        [#include <stdlib.h>],
++        [void test_fn(void) { qsort(NULL, 0, 0, (__compar_fn_t)NULL); }],
++        ccache_cv_COMPAR_FN_T=yes,
++        ccache_cv_COMPAR_FN_T=no)])
++if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then
++   AC_DEFINE(HAVE_COMPAR_FN_T, 1,
++             Define to 1 if you have the `__compar_fn_t' typedef.)
++fi
++
+ AC_PATH_PROGS(PERL, perl5 perl)
+
+ AC_PATH_PROG(MAN2HTML, man2html, no)
+Index: DirectFB-1.7.7/inputdrivers/lirc/lirc.c
+===================================================================
+--- DirectFB-1.7.7.orig/inputdrivers/lirc/lirc.c
++++ DirectFB-1.7.7/inputdrivers/lirc/lirc.c
+@@ -59,6 +59,11 @@
+
+ #include <core/input_driver.h>
+
++#if HAVE_COMPAR_FN_T
++#define COMPAR_FN_T __compar_fn_t
++#else
++typedef int (*COMPAR_FN_T)(const void *, const void *);
++#endif
+
+ DFB_INPUT_DRIVER( lirc )
+
+@@ -97,7 +102,7 @@ static DFBInputDeviceKeySymbol lirc_pars
+           qsort ( keynames,
+                   D_ARRAY_SIZE( keynames ),
+                   sizeof(keynames[0]),
+-                  (__compar_fn_t) keynames_sort_compare );
++                  (COMPAR_FN_T) keynames_sort_compare );
+           keynames_sorted = true;
+      }
+
+@@ -124,7 +129,7 @@ static DFBInputDeviceKeySymbol lirc_pars
+                symbol_name = bsearch( name, keynames,
+                                       D_ARRAY_SIZE( keynames ),
+                                       sizeof(keynames[0]),
+-                                      (__compar_fn_t) keynames_compare );
++                                      (COMPAR_FN_T) keynames_compare );
+                if (symbol_name)
+                     return symbol_name->symbol;
+                break;
meta/recipes-graphics/directfb/directfb/union-sigval.patch new file +19 -0
new file mode 100644
index 0000000..29f45c7
@@ -0,0 +1,19 @@
+This patch is taken from gentoo musl overlay
+sigval_t is glibc only construct, we use a union of sigval
+which pretty much is same effect as sigval_t
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/system.c DirectFB-1.7.6/lib/direct/os/linux/glibc/system.c
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/system.c     2014-07-15 02:54:58.000000000 -0400
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/system.c  2015-07-18 16:55:35.077989166 -0400
+@@ -111,7 +111,7 @@
+ void
+ direct_trap( const char *domain, int sig )
+ {
+-     sigval_t val;
++     union sigval val;
+
+      if (direct_config->delay_trap_ms) {
+           D_LOG( Direct_Trap, VERBOSE, "NOT RAISING signal %d from %s, waiting for %dms... attach gdb --pid=%d\n", sig, domain, direct_config->delay_trap_ms, getpid() );
meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file +6 -0
new file mode 100644
index 0000000..e65f59e
@@ -0,0 +1,19 @@
+This patch is taken from gentoo musl overlay
+uses recursive mutex directly instead of non-posix version
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+

meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch line 16

Quoted 10 lines
meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file +10 -0
+
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h      2013-12-18 19:16:24.000000000 -0500
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h   2015-07-18 16:57:47.178982835 -0400
+@@ -46,7 +46,7 @@
+ /**********************************************************************************************************************/
+
+ #define DIRECT_MUTEX_INITIALIZER(name)            { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
++#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_MUTEX_RECURSIVE }

This looks completely bogus.

PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP initialises a pthread_mutex_t structure and PTHREAD_MUTEX_RECURSIVE is an enum. You can't just replace one with the other.

Quoted 11 lines
meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file +3 -1
+
+ #endif
+
--

2.7.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#29 lore raw

Re: [PATCH 24/53] directfb: Fix build with musl

Quoted 12 lines · Andre McCurdy

meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch line 16

Quoted 9 lines
meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file +9 -0
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h      2013-12-18 19:16:24.000000000 -0500
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h   2015-07-18 16:57:47.178982835 -0400
+@@ -46,7 +46,7 @@
+ /**********************************************************************************************************************/
+
+ #define DIRECT_MUTEX_INITIALIZER(name)            { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
++#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_MUTEX_RECURSIVE }

This looks completely bogus.

Quoted 3 lines

PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP initialises a pthread_mutex_t structure and PTHREAD_MUTEX_RECURSIVE is an enum. You can't just replace one with the other.

It indeed is bogus. I took it as a stepstone to get it compiling but in reality what we need is a portable way to initialize recursive mutex instead of _NP
something like using pthread_once during lock initialization. Let me see what can be done.

author
#30 lore raw

Re: [PATCH 24/53] directfb: Fix build with musl

Quoted 17 lines · Khem Raj
Quoted 12 lines · Andre McCurdy

meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch line 16

Quoted 9 lines
meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file +9 -0
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/mutex.h      2013-12-18 19:16:24.000000000 -0500
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/mutex.h   2015-07-18 16:57:47.178982835 -0400
+@@ -46,7 +46,7 @@
+ /**********************************************************************************************************************/
+
+ #define DIRECT_MUTEX_INITIALIZER(name)            { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
++#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name)  { PTHREAD_MUTEX_RECURSIVE }

This looks completely bogus.

Quoted 3 lines

PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP initialises a pthread_mutex_t structure and PTHREAD_MUTEX_RECURSIVE is an enum. You can't just replace one with the other.

Quoted 5 lines

It indeed is bogus. I took it as a stepstone to get it compiling but in reality what we need is a portable way to initialize recursive mutex instead of _NP
something like using pthread_once during lock initialization. Let me see what can be done.

Please try out https://github.com/kraj/openembedded-core/commit/4104b7cdd0b58e24a926cdcf6415f3da3f48624e
which should be the right fix and portable one.

#31 lore raw

Re: [PATCH 24/53] directfb: Fix build with musl

In reply to Andre McCurdy
Quoted 6 lines · Andre McCurdy

For patches which fix 'correctness' issues uncovered by musl maybe it's better to apply the patches unconditionally, so they get some test cover from non-musl builds?

Especially true in this case - see below.

Agreed. Patches should only be applied on overrides if they negatively impact other configurations, so a strict correctness patch should always be applied whereas a patch that stubs out glibc-specific code would be applied on specific configurations.

Ross

author
#32 lore raw

PATCH 25/53 gzip: Fix build with musl

In reply to Khem Raj

gzip 1.6 uses an older version of gnulib when cross compiling it treats fseeko as broken since it cant do runtime checks for it during configure this only shows up on musl since for glibc since it has special check for gnu c library, so we aid the system by telling it that fflush on stdin works well with musl

Use NO_ASM to avoid textrels

Delete charset.alias for musl which is again another issue in gnulib not knowing musl platform

---
 meta/recipes-extended/gzip/gzip.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta/recipes-extended/gzip/gzip.inc +7 -0
index 58e5e0c..6e81883 100644
@@ -6,8 +6,10 @@ SECTION = "console/utils"
 # change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12
 
 inherit autotools texinfo
+export DEFS="NO_ASM"
 
 EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep"
+EXTRA_OECONF_append_libc-musl = " gl_cv_func_fflush_stdin=yes "
 
 do_install_append () {
 	if [ "${base_bindir}" != "${bindir}" ]; then
@@ -20,6 +22,11 @@ do_install_append () {
 	fi
 }
 
+do_install_append_libc-musl () {
+	rm ${D}${libdir}/charset.alias
+	rmdir ${D}${libdir}
+}
+
 inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "100"
Signature · 1 line
2.7.0
author
#33 lore raw

PATCH 26/53 watchdog: Fix build with musl

In reply to Khem Raj

This patch is generic but is found during compiling watchdog with musl

---
 ...d-issues-found-with-non-glibc-C-libraries.patch | 99 ++++++++++++++++++++++
 meta/recipes-extended/watchdog/watchdog_5.14.bb    |  8 +-
 2 files changed, 106 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch
meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch new file +99 -0
new file mode 100644
index 0000000..8afed5c
@@ -0,0 +1,99 @@
+From 83ec34df357218a1c9cfc13a23d3367d333652c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 30 Dec 2015 01:01:15 +0000
+Subject: [PATCH] Fix build issues found with non glibc C libraries
+
+Add time.h for getting time_t definition
+limits.h for PATH_MAX
+linux/param.h for EXEC_PAGESIZE
+Replace deprecated MNTTAB with _PATH_MNTTAB
+include ext2_mnt.h for MNTOPT_USRQUOTA and MNTOPT_GRPQUOTA and
+MNTTYPE_EXT2
+Include sys/types.h for u_char definition
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+
+Upstream-Status: Submitted
+
+ include/extern.h | 1 +
+ src/configfile.c | 1 +
+ src/memory.c     | 3 +++
+ src/net.c        | 1 +
+ src/shutdown.c   | 3 ++-
+ 5 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/include/extern.h b/include/extern.h
+index 21db11b..04b16bc 100644
+--- a/include/extern.h
++++ b/include/extern.h
+@@ -3,6 +3,7 @@
+ 
+ #include <netinet/in.h>
+ #include <stdio.h>
++#include <time.h>
+ 
+ #include "logmessage.h"
+ #include "xmalloc.h"
+diff --git a/src/configfile.c b/src/configfile.c
+index be5d7b3..7c1d1dd 100644
+--- a/src/configfile.c
++++ b/src/configfile.c
+@@ -16,6 +16,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <sys/stat.h>
+ 
+ #include "extern.h"
+diff --git a/src/memory.c b/src/memory.c
+index e9607e4..b5e08aa 100644
+--- a/src/memory.c
++++ b/src/memory.c
+@@ -21,6 +21,9 @@
+ #include <sys/stat.h>
+ #include <sys/param.h>
+ #include <sys/mman.h>
++#ifdef __linux__
++#include <linux/param.h>
++#endif
+ 
+ #include "extern.h"
+ #include "watch_err.h"
+diff --git a/src/net.c b/src/net.c
+index 21823ae..8930caf 100644
+--- a/src/net.c
++++ b/src/net.c
+@@ -17,6 +17,7 @@
+ #include <string.h>
+ #include <unistd.h>		/* for gethostname() etc */
+ #include <netdb.h>		/* for gethostbyname() */
++#include <sys/types.h>
+ #include <sys/param.h>	/* for MAXHOSTNAMELEN */
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+diff --git a/src/shutdown.c b/src/shutdown.c
+index 74aafa5..46b99cf 100644
+--- a/src/shutdown.c
++++ b/src/shutdown.c
+@@ -25,6 +25,7 @@
+ 
+ #include "watch_err.h"
+ #include "extern.h"
++#include "ext2_mnt.h"
+ 
+ #if defined __GLIBC__
+ #include "ext2_mnt.h"
+@@ -123,7 +124,7 @@ static void mnt_off()
+ 	FILE *fp;
+ 	struct mntent *mnt;
+ 
+-	fp = setmntent(MNTTAB, "r");
++	fp = setmntent(_PATH_MNTTAB, "r");
+ 	/* in some rare cases fp might be NULL so be careful */
+ 	while (fp != NULL && ((mnt = getmntent(fp)) != (struct mntent *)0)) {
+ 		/* First check if swap */
+-- 
+2.6.4
+
meta/recipes-extended/watchdog/watchdog_5.14.bb +7 -1
index 9cb89d5..fc717bc 100644
@@ -12,7 +12,9 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \
            file://fixsepbuild.patch \
 	   file://fix-ping-failure.patch \
 	   file://watchdog-init.patch \
-	   file://watchdog-conf.patch"
+	   file://watchdog-conf.patch \
+	   file://0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch \
+"
 
 SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4"
 SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1"
@@ -23,6 +25,10 @@ UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/"
 inherit autotools
 inherit update-rc.d
 
+DEPENDS_append_libc-musl = " libtirpc "
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+
 INITSCRIPT_NAME = "watchdog.sh"
 INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ."
 
Signature · 1 line
2.7.0
author
#34 lore raw

PATCH 27/53 xinetd: Fix build with musl

In reply to Khem Raj

musl relies on external rpc implemetation (libtirpc) and exposed a bug in configury when checking for rlim_t

---
 ...se-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch | 100 +++++++++++++++++++++
 meta/recipes-extended/xinetd/xinetd_2.3.15.bb      |   5 ++
 2 files changed, 105 insertions(+)
 create mode 100644 meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch
meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch new file +100 -0
new file mode 100644
index 0000000..3c1b2f6
@@ -0,0 +1,100 @@
+From e8b0ffc7ea04cc71dba97a38e1a134aaf2285c2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 30 Dec 2015 07:14:50 +0000
+Subject: [PATCH] configure: Use HAVE_SYS_RESOURCE_H to guard sys/resource.h
+ inclusion
+
+HAVE_RLIM_T check will not let sys/resource.h to be checked and
+rlim_t is defined in sys/resource.h so the check would fail.
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ aclocal.m4 |  2 +-
+ configure  | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 6e6f32c..70e7076 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -11,7 +11,7 @@ AC_CACHE_VAL(xinetd_cv_type_$1,
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+diff --git a/configure b/configure
+index b507d38..bec56ea 100755
+--- a/configure
++++ b/configure
+@@ -7640,7 +7640,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7686,7 +7686,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7732,7 +7732,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7778,7 +7778,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7824,7 +7824,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7870,7 +7870,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7916,7 +7916,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+-- 
+2.6.4
+
meta/recipes-extended/xinetd/xinetd_2.3.15.bb +5 -0
index 652fe91..6bfaabe 100644
@@ -7,6 +7,7 @@ LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8ad8615198542444f84d28a6cf226dd8"
 
 DEPENDS = ""
+DEPENDS_append_libc-musl = " libtirpc "
 PR = "r2"
 
 # Blacklist a bogus tag in upstream check
@@ -20,6 +21,7 @@ SRC_URI = "git://github.com/xinetd-org/xinetd.git;protocol=https \
       file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \
       file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \
       file://xinetd-CVE-2013-4342.patch \
+      file://0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch \
       file://xinetd.service \
       "
 
@@ -39,6 +41,9 @@ EXTRA_OECONF="--disable-nls"
 PACKAGECONFIG ??= "tcp-wrappers"
 PACKAGECONFIG[tcp-wrappers] = "--with-libwrap,,tcp-wrappers"
 
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+
 do_configure() {
 	# Looks like configure.in is broken, so we are skipping
 	# rebuilding configure and are just using the shipped one
Signature · 1 line
2.7.0
author
#35 lore raw

PATCH 28/53 dpkg: Add musleabi to known architectures

In reply to Khem Raj

Remove a glibc specific patch to be applied only for native version, this is a dpkg-native specific patch needed for Centos 5.8, this patch should be redone to be glibc independent for it to be applied to all types of dpkg recipes

---
 ...0006-add-musleabi-to-known-target-tripets.patch | 42 ++++++++++++++++++++++
 meta/recipes-devtools/dpkg/dpkg_1.18.2.bb          |  3 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch new file +42 -0
new file mode 100644
index 0000000..a6b0088
@@ -0,0 +1,42 @@
+From f8910022dc3ec622272f168cd0022dbdf6dff93a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 30 Dec 2015 23:05:41 +0000
+Subject: [PATCH] add musleabi to known target tripets
+
+helps compiling dpkg for musl/arm-softfloat
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ ostable      | 1 +
+ triplettable | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/ostable b/ostable
+index 3bb6819..d0ffdc7 100644
+--- a/ostable
++++ b/ostable
+@@ -15,6 +15,7 @@
+ uclibceabi-linux	linux-uclibceabi	linux[^-]*-uclibceabi
+ uclibc-linux		linux-uclibc		linux[^-]*-uclibc
+ musleabihf-linux	linux-musleabihf	linux[^-]*-musleabihf
++musleabi-linux		linux-musleabi		linux[^-]*-musleabi
+ musl-linux		linux-musl		linux[^-]*-musl
+ gnueabihf-linux		linux-gnueabihf		linux[^-]*-gnueabihf
+ gnueabi-linux		linux-gnueabi		linux[^-]*-gnueabi
+diff --git a/triplettable b/triplettable
+index 1213584..70d24c1 100644
+--- a/triplettable
++++ b/triplettable
+@@ -6,6 +6,7 @@
+ uclibceabi-linux-arm	uclibc-linux-armel
+ uclibc-linux-<cpu>	uclibc-linux-<cpu>
+ musleabihf-linux-arm	musl-linux-armhf
++musleabi-linux-arm	musl-linux-armel
+ musl-linux-<cpu>	musl-linux-<cpu>
+ gnueabihf-linux-arm	armhf
+ gnueabi-linux-arm	armel
+-- 
+2.6.4
+
meta/recipes-devtools/dpkg/dpkg_1.18.2.bb +2 -1
index 4c3fa4f..dd1109b 100644
@@ -1,17 +1,18 @@
 require dpkg.inc
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
+SRC_URI_append_class-native =" file://glibc2.5-sync_file_range.patch "
 SRC_URI += "file://noman.patch \
             file://remove-tar-no-timestamp.patch \
             file://fix-abs-redefine.patch \
             file://arch_pm.patch \
             file://dpkg-configure.service \
-            file://glibc2.5-sync_file_range.patch \
             file://add_armeb_triplet_entry.patch \
 	    file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
 	    file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
 	    file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
 	    file://0005-dpkg-compiler.m4-remove-Wvla.patch \
+	    file://0006-add-musleabi-to-known-target-tripets.patch \
            "
 
 SRC_URI[md5sum] = "63b9d869081ec49adeef6c5ff62d6576"
Signature · 1 line
2.7.0
author
#36 lore raw

PATCH 29/53 puzzles: Zero'ise structs before use

In reply to Khem Raj

Fixes build failures with musl where gcc5 flags it used before initialized.

---
 ...mpiler-errors-about-uninitialized-use-of-.patch | 32 ++++++++++++++++++++++
 meta/recipes-sato/puzzles/puzzles_git.bb           |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch
meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch new file +32 -0
new file mode 100644
index 0000000..0b971c4
@@ -0,0 +1,32 @@
+From 78d6d1706c21ad467520075ff7a8bf15cfbd68b3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 30 Dec 2015 22:13:16 +0000
+Subject: [PATCH] rect: Fix compiler errors about uninitialized use of
+ variables
+
+error: 'r2.x' may be used uninitialized in this function
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Submitted
+
+ rect.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/rect.c b/rect.c
+index 55667c0..fa3a786 100644
+--- a/rect.c
++++ b/rect.c
+@@ -1317,7 +1317,8 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
+                     if (ndirs > 0) {
+                         int which, dir;
+                         struct rect r1, r2;
+-
++                        memset(&r1, 0, sizeof(struct rect));
++                        memset(&r2, 0, sizeof(struct rect));
+                         which = random_upto(rs, ndirs);
+                         dir = dirs[which];
+ 
+-- 
+2.6.4
+
meta/recipes-sato/puzzles/puzzles_git.bb +1 -0
index 1e3bac7..9c8170c 100644
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=33bcd4bce8f3c197f2aefbdbd2d299bc"
 SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
            file://fix-compiling-failure-with-option-g-O.patch \
            file://0001-Use-labs-instead-of-abs.patch \
+           file://0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch \
 "
 SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
 PE = "1"
Signature · 1 line
2.7.0
author
#37 lore raw

PATCH 30/53 Revert "glib-2.0: build dependency cleanup"

In reply to Khem Raj

From: Kai Kang <[email protected]>

This reverts commit fcd7494b347423185c883b2897c4908929843a71.

It uses command glib-genmarshal to build glib-2.0 which is from glibc-2.0-native. If the command doesn't exist on host, build fails with error:

| /bin/sh: --prefix=test_marshal: command not found | make[4]: *** [testmarshal.c] Error 127

So add the dependency back.

---
 meta/recipes-core/glib-2.0/glib.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/glib-2.0/glib.inc +3 -3
index 86f7e0e..8e4dcd7 100644
@@ -17,10 +17,10 @@ SECTION = "libs"
 
 BBCLASSEXTEND = "native nativesdk"
 
-DEPENDS = "virtual/libiconv libffi zlib"
-DEPENDS_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', ' glib-2.0-native dbus', '', d)}"
+DEPENDS = "glib-2.0-native virtual/libiconv libffi zlib"
+DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', ' dbus', '', d)}"
 DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native zlib-native"
-DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib"
+DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib ${BPN}-native"
 
 PACKAGES =+ "${PN}-utils ${PN}-bash-completion ${PN}-codegen"
 
Signature · 1 line
2.7.0
#38 lore raw

Re: [PATCH 30/53] Revert "glib-2.0: build dependency cleanup"

Quoted 5 lines · Khem Raj
(quoted diff) +0 -2
-DEPENDS = "virtual/libiconv libffi zlib"
-DEPENDS_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', '

glib-2.0-native dbus', '', d)}"

(quoted diff) +2 -0
+DEPENDS = "glib-2.0-native virtual/libiconv libffi zlib"
+DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES',
Quoted 8 lines

'ptest', ' dbus', '', d)}"
DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native
zlib-native"
-DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib"
+DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib ${BPN}-native"

Don't actually revert the original commit, just add the missing dependencies back. The ptest changes were good and you're reverting those too.

Ross

author
#39 lore raw

Re: [PATCH 30/53] Revert "glib-2.0: build dependency cleanup"

Quoted 19 lines · Ross
Quoted 6 lines · Khem Raj
(quoted diff) +0 -2
-DEPENDS = "virtual/libiconv libffi zlib"
-DEPENDS_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', '

glib-2.0-native dbus', '', d)}"

(quoted diff) +2 -0
+DEPENDS = "glib-2.0-native virtual/libiconv libffi zlib"
+DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES',
Quoted 7 lines

'ptest', ' dbus', '', d)}"
DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native
zlib-native"
-DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib"
+DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib ${BPN}-native"

Don't actually revert the original commit, just add the missing dependencies back. The ptest changes were good and you're reverting those too.

ignore this.
this was a band-aid for my build. I was hoping Kai to address it

Quoted 2 lines

Ross

author
#40 lore raw

PATCH 31/53 apt: Add support for building for musl targets

In reply to Khem Raj

Turn bzip2 support into a PACKAGECONFIG
zlibs is a must have and therefore add it to DEPENDS will make the build consistent

---
 meta/recipes-devtools/apt/apt.inc                  |  1 +
 ....mak-musl-based-systems-can-generate-shar.patch | 29 ++++++++++++++++++++++
 meta/recipes-devtools/apt/apt_1.0.10.1.bb          |  3 ++-
 3 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch
meta/recipes-devtools/apt/apt.inc +1 -0
index 312c6a9..78ef5a7 100644
@@ -11,6 +11,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20150805T094928Z/pool/main/
            file://nodoc.patch \
            file://disable-configure-in-makefile.patch \
            file://disable-test.patch \
+           file://0001-environment.mak-musl-based-systems-can-generate-shar.patch \
            "
 SRC_URI[md5sum] = "6505c4297b338adb2087ce87bbc4a276"
 SRC_URI[sha256sum] = "3fb1de9598363c416591d49e3c285458e095b035e6c06d5b944a54e15fc9b543"
meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch new file +29 -0
new file mode 100644
index 0000000..042372b
@@ -0,0 +1,29 @@
+From 2f8aa21ace375c18977ed908b291c80a210a93c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 31 Dec 2015 08:06:12 +0000
+Subject: [PATCH] environment.mak: musl based systems can generate shared
+ objects too
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ buildlib/environment.mak.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index b0a8d9d..3a52344 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -68,7 +68,7 @@ NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
+ 
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu linux-musl%,$(HOST_OS))),0)
+    SONAME_MAGIC=-Wl,-soname -Wl,
+    LFLAGS_SO=
+ else
+-- 
+2.6.4
+
meta/recipes-devtools/apt/apt_1.0.10.1.bb +2 -1
index bf77e2a..85c0d56 100644
@@ -1,4 +1,4 @@
-DEPENDS = "curl db"
+DEPENDS = "curl db zlib"
 RDEPENDS_${PN} = "dpkg bash debianutils"
 require apt.inc
 
@@ -6,6 +6,7 @@ require apt-package.inc
 
 PACKAGECONFIG ??= "lzma"
 PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
+PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
 
 FILES_${PN} += "${bindir}/apt-key"
 apt-manpages += "doc/apt-key.8"
Signature · 1 line
2.7.0
author
#41 lore raw

PATCH 32/53 libunwind: backtrace APIs are glibc specific

In reply to Khem Raj

Make backtrace() API's use conditional on glibc
this helps make libunwind compile on musl

---
 ...-backtrace-Use-only-with-glibc-and-uclibc.patch | 45 ++++++++++++++++++++++
 meta/recipes-support/libunwind/libunwind_1.1.bb    |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-support/libunwind/libunwind-1.1/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
meta/recipes-support/libunwind/libunwind-1.1/0001-backtrace-Use-only-with-glibc-and-uclibc.patch new file +45 -0
new file mode 100644
index 0000000..9aed419
@@ -0,0 +1,45 @@
+From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 31 Dec 2015 06:44:07 +0000
+Subject: [PATCH] backtrace: Use only with glibc and uclibc
+
+backtrace API is glibc specific not linux specific
+so make it behave so.
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ tests/test-coredump-unwind.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
+index 5254708..8767b42 100644
+--- a/tests/test-coredump-unwind.c
++++ b/tests/test-coredump-unwind.c
+@@ -57,7 +57,9 @@
+ #include <grp.h>
+ 
+ /* For SIGSEGV handler code */
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <sys/ucontext.h>
+ 
+ #include <libunwind-coredump.h>
+@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+ 			ip);
+ 
+   {
++#ifdef __GLIBC__
+     /* glibc extension */
+     void *array[50];
+     int size;
+     size = backtrace(array, 50);
+-#ifdef __linux__
+     backtrace_symbols_fd(array, size, 2);
+ #endif
+   }
+-- 
+2.6.4
+
meta/recipes-support/libunwind/libunwind_1.1.bb +1 -0
index aa62bcc..7df9f5e 100644
@@ -7,6 +7,7 @@ SRC_URI += "\
     file://Link-libunwind-to-libgcc_s-rather-than-libgcc.patch \
     file://0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch \
     file://Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch \
+    file://0001-backtrace-Use-only-with-glibc-and-uclibc.patch \
 "
 
 SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce"
Signature · 1 line
2.7.0
author
#42 lore raw

PATCH 33/53 babeltrace: Add missing header for MAXNAMLEN define

In reply to Khem Raj

Fix bug exposed on musl

---
 ...Include-sys-param.h-for-MAXNAMLEN-definti.patch | 29 ++++++++++++++++++++++
 meta/recipes-kernel/lttng/babeltrace_1.3.1.bb      |  5 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch
meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch new file +29 -0
new file mode 100644
index 0000000..eb16cd1
@@ -0,0 +1,29 @@
+From 8331b87845cafdda40e59a682f2ca8120ed0c472 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 31 Dec 2015 08:17:40 +0000
+Subject: [PATCH] lttng-live: Include sys/param.h for MAXNAMLEN defintion
+
+exposed on musl based systems
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: pending
+
+ formats/lttng-live/lttng-live.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/formats/lttng-live/lttng-live.h b/formats/lttng-live/lttng-live.h
+index 4ab641d..808ed2b 100644
+--- a/formats/lttng-live/lttng-live.h
++++ b/formats/lttng-live/lttng-live.h
+@@ -25,6 +25,7 @@
+  */
+ 
+ #include <stdint.h>
++#include <sys/param.h>
+ #include "lttng-viewer-abi.h"
+ 
+ #define LTTNG_DEFAULT_NETWORK_VIEWER_PORT	5344
+-- 
+2.6.4
+
meta/recipes-kernel/lttng/babeltrace_1.3.1.bb +3 -2
index 36345e3..1766026 100644
@@ -6,14 +6,15 @@ BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
 LICENSE = "MIT & GPLv2"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
 
-inherit autotools pkgconfig
-
 DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
 
+inherit autotools pkgconfig
+
 SRCREV = "6e2b9096c77138593097335b9b27202d98918089"
 
 SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.3 \
            file://0001-Fix-invalid-pointer-free-with-trace-collection.patch \
+           file://0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch \
 "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.7.0
author
#43 lore raw

PATCH 34/53 elfutils: Fix build with musl

In reply to Khem Raj

Just compile libelf on musl similar to uclibc
Provide alternatives to glibc assumptions

---
 ...de-alternatives-for-glibc-assumptions-hel.patch | 132 +++++++++++++++++++++
 meta/recipes-devtools/elfutils/elfutils_0.163.bb   |   3 +
 2 files changed, 135 insertions(+)
 create mode 100644 meta/recipes-devtools/elfutils/elfutils-0.163/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
meta/recipes-devtools/elfutils/elfutils-0.163/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch new file +132 -0
new file mode 100644
index 0000000..29d9c84
@@ -0,0 +1,132 @@
+From 43c2c618d205f4fdffbc8d75217c127c824cdb67 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 31 Dec 2015 06:35:34 +0000
+Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
+ compiling it on musl
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ lib/fixedsizehash.h              | 4 ++--
+ lib/system.h                     | 4 ++++
+ libdwfl/dwfl_build_id_find_elf.c | 2 +-
+ libdwfl/find-debuginfo.c         | 2 +-
+ libelf/elf.h                     | 9 ++++++---
+ libelf/libelf.h                  | 1 +
+ libelf/libelfP.h                 | 1 +
+ 7 files changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
+index 06ce6a2..566def2 100644
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,12 +30,12 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+ #include <sys/param.h>
+ 
+ #include <system.h>
+ 
+-#define CONCAT(t1,t2) __CONCAT (t1,t2)
++#define CONCAT1(x,y) x##y
++#define CONCAT(x,y) CONCAT1(x,y)
+ 
+ /* Before including this file the following macros must be defined:
+ 
+diff --git a/lib/system.h b/lib/system.h
+index f31cfd0..78b629a 100644
+--- a/lib/system.h
++++ b/lib/system.h
+@@ -49,6 +49,10 @@
+ #else
+ # error "Unknown byte order"
+ #endif
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(x) x
++#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
++#endif
+ 
+ extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+ extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
+diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
+index 99a5059..a796ef9 100644
+--- a/libdwfl/dwfl_build_id_find_elf.c
++++ b/libdwfl/dwfl_build_id_find_elf.c
+@@ -94,7 +94,7 @@ __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name,
+ 	{
+ 	  if (*file_name != NULL)
+ 	    free (*file_name);
+-	  *file_name = canonicalize_file_name (name);
++	  *file_name = realpath (name, NULL);
+ 	  if (*file_name == NULL)
+ 	    {
+ 	      *file_name = name;
+diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
+index 1faa494..6932402 100644
+--- a/libdwfl/find-debuginfo.c
++++ b/libdwfl/find-debuginfo.c
+@@ -361,7 +361,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
+       /* If FILE_NAME is a symlink, the debug file might be associated
+ 	 with the symlink target name instead.  */
+ 
+-      char *canon = canonicalize_file_name (file_name);
++      char *canon = realpath (file_name, NULL);
+       if (canon != NULL && strcmp (file_name, canon))
+ 	fd = find_debuginfo_in_path (mod, canon,
+ 				     debuglink_file, debuglink_crc,
+diff --git a/libelf/elf.h b/libelf/elf.h
+index aff6edc..0bd4f55 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -21,7 +21,9 @@
+ 
+ #include <features.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* Standard ELF types.  */
+ 
+@@ -3552,7 +3554,8 @@ enum
+ 
+ #define R_TILEGX_NUM		130
+ 
+-
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif	/* elf.h */
+diff --git a/libelf/libelf.h b/libelf/libelf.h
+index 5a2b3af..5705e9c 100644
+--- a/libelf/libelf.h
++++ b/libelf/libelf.h
+@@ -29,6 +29,7 @@
+ #ifndef _LIBELF_H
+ #define _LIBELF_H 1
+ 
++#include <fcntl.h>
+ #include <sys/types.h>
+ 
+ /* Get the ELF types.  */
+diff --git a/libelf/libelfP.h b/libelf/libelfP.h
+index 3f4d654..5c811ec 100644
+--- a/libelf/libelfP.h
++++ b/libelf/libelfP.h
+@@ -36,6 +36,7 @@
+ 
+ #include <ar.h>
+ #include <gelf.h>
++#include <libelf.h>
+ 
+ #include <errno.h>
+ #include <stdint.h>
+-- 
+2.6.4
+
meta/recipes-devtools/elfutils/elfutils_0.163.bb +3 -0
index 41bfbdc..0a7dd88 100644
@@ -4,6 +4,7 @@ SECTION = "base"
 LICENSE = "(GPLv3 & Elfutils-Exception)"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 DEPENDS = "libtool bzip2 zlib virtual/libintl"
+DEPENDS_append_libc-musl = " argp-standalone "
 
 SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2"
 
@@ -37,6 +38,7 @@ SRC_URI += "\
 
 # Only apply when building uclibc based target recipe
 SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.161.patch"
+SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
 
 # The buildsystem wants to generate 2 .h files from source using a binary it just built,
 # which can not pass the cross compiling, so let's work around it by adding 2 .h files
@@ -59,6 +61,7 @@ do_install_append() {
 # build only libelf for uclibc case
 
 EXTRA_OEMAKE_libc-uclibc = "-C libelf"
+EXTRA_OEMAKE_libc-musl = "-C libelf"
 EXTRA_OEMAKE_class-native = ""
 EXTRA_OEMAKE_class-nativesdk = ""
 
Signature · 1 line
2.7.0
author
#44 lore raw

PATCH 35/53 sysklogd: untangle header inclusion maze

In reply to Khem Raj

wait is not union per posix it is int
remove assumption about glibc is linux

---
 .../sysklogd/files/0001-Fix-build-with-musl.patch  | 132 +++++++++++++++++++++
 meta/recipes-extended/sysklogd/sysklogd.inc        |   1 +
 2 files changed, 133 insertions(+)
 create mode 100644 meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch new file +132 -0
new file mode 100644
index 0000000..9567946
@@ -0,0 +1,132 @@
+From f0af5bcfd753691652eac35efbcb208c933253f1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 31 Aug 2015 05:11:53 +0000
+Subject: [PATCH] Fix build with musl
+
+Explicitly include fcntl.h since with glibc is comes in as indirect
+include but not with musl
+
+linux/time.h inclusion is not required on musl so using !__GLIBC__ is
+not right for musl here
+
+wait type is glibc specific
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ klogd.c    | 10 +---------
+ ksym_mod.c |  5 +----
+ pidfile.c  |  1 +
+ syslog.c   |  3 ++-
+ syslogd.c  |  4 +---
+ 5 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/klogd.c b/klogd.c
+index 6cc80ed..9219671 100644
+--- a/klogd.c
++++ b/klogd.c
+@@ -260,11 +260,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
+@@ -277,13 +274,8 @@
+ 
+ #define __LIBRARY__
+ #include <linux/unistd.h>
+-#if !defined(__GLIBC__)
+-# define __NR_ksyslog __NR_syslog
+-_syscall3(int,ksyslog,int, type, char *, buf, int, len);
+-#else
+ #include <sys/klog.h>
+ #define ksyslog klogctl
+-#endif
+ 
+ #define LOG_BUFFER_SIZE 4096
+ #define LOG_LINE_LENGTH 1000
+diff --git a/ksym_mod.c b/ksym_mod.c
+index 68cd6b6..6e26da1 100644
+--- a/ksym_mod.c
++++ b/ksym_mod.c
+@@ -113,12 +113,9 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include "module.h"
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <linux/version.h>
+diff --git a/pidfile.c b/pidfile.c
+index e0959a0..6daa2e0 100644
+--- a/pidfile.c
++++ b/pidfile.c
+@@ -31,6 +31,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <fcntl.h>
+ 
+ /* read_pid
+  *
+diff --git a/syslog.c b/syslog.c
+index bdb3ff2..ef7b34e 100644
+--- a/syslog.c
++++ b/syslog.c
+@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c	5.28 (Berkeley) 6/27/90";
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/file.h>
+-#include <sys/signal.h>
++//#include <sys/signal.h>
+ #include <sys/syslog.h>
+ #if 0
+ #include "syslog.h"
+@@ -72,6 +72,7 @@ static char sccsid[] = "@(#)syslog.c	5.28 (Berkeley) 6/27/90";
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdio.h>
++#include <fcntl.h>
+ 
+ #define	_PATH_LOGNAME	"/dev/log"
+ 
+diff --git a/syslogd.c b/syslogd.c
+index ea73ea5..1ca0595 100644
+--- a/syslogd.c
++++ b/syslogd.c
+@@ -818,9 +818,7 @@ void doexit(int sig);
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+@@ -2094,7 +2092,7 @@ void reapchild()
+ 	(void) signal(SIGCHLD, reapchild);	/* reset signal handler -ASP */
+ 	wait ((int *)0);
+ #else
+-	union wait status;
++	int status;
+ 
+ 	while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
+ 		;
+-- 
+2.5.1
+
meta/recipes-extended/sysklogd/sysklogd.inc +1 -0
index 85b3cdc..f789c54 100644
@@ -15,6 +15,7 @@ inherit update-rc.d update-alternatives
 
 SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
            file://no-strip-install.patch \
+           file://0001-Fix-build-with-musl.patch \
            file://sysklogd \
            file://syslog.conf \
            "
Signature · 1 line
2.7.0
author
#45 lore raw

PATCH 36/53 console-tools: Include sys/types.h for u_char and u_short defs

In reply to Khem Raj
---
 ...clude-sys-types.h-for-u_char-and-u_short-.patch | 44 ++++++++++++++++++++++
 .../console-tools/console-tools_0.3.2.bb           |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch
meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch new file +44 -0
new file mode 100644
index 0000000..64b5b04
@@ -0,0 +1,44 @@
+From 0fd5dda51d68e1ec2a87e27b5ed0dff3503b4681 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 31 Dec 2015 08:12:38 +0000
+Subject: [PATCH] kbdtools: Include sys/types.h for u_char and u_short
+ definition
+
+on musl this gets exposed since sys/types.h is not
+included via some other indirect inclusion as is the case with glibc
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ kbdtools/dumpkeys.c | 1 +
+ kbdtools/loadkeys.y | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/kbdtools/dumpkeys.c b/kbdtools/dumpkeys.c
+index 6159d49..c19fb21 100644
+--- a/kbdtools/dumpkeys.c
++++ b/kbdtools/dumpkeys.c
+@@ -26,6 +26,7 @@
+ #include <errno.h>
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <linux/types.h>
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+diff --git a/kbdtools/loadkeys.y b/kbdtools/loadkeys.y
+index b6a8e01..4468f77 100644
+--- a/kbdtools/loadkeys.y
++++ b/kbdtools/loadkeys.y
+@@ -71,6 +71,7 @@
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <ctype.h>
+ #include <sysexits.h>
+ #include <signal.h>
+-- 
+2.6.4
+
meta/recipes-core/console-tools/console-tools_0.3.2.bb +1 -0
index 7e14b31..d14d683 100644
@@ -14,6 +14,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \
            file://nodocs.patch \
            file://fix-libconsole-linking.patch \
            file://no-dep-on-libfl.patch \
+           file://0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch \
            file://lcmessage.m4 \
            file://Makevars"
 
Signature · 1 line
2.7.0
author
#46 lore raw

PATCH 37/53 webkitgtk: Fix build on non-glibc linux systems

In reply to Khem Raj
---
 ...x-build-with-non-glibc-libraries-on-linux.patch | 61 ++++++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.10.4.bb       |  1 +
 2 files changed, 62 insertions(+)
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch
meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch new file +61 -0
new file mode 100644
index 0000000..c57fcde
@@ -0,0 +1,61 @@
+From 30e2ef302a329850ba55c7c458c98cbf396186ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 31 Dec 2015 21:47:34 +0000
+Subject: [PATCH] Fix build with non-glibc libraries on linux
+
+qualify isnan() calls with std namespace
+malloc_trim is glibc specific API so guard it with __GLIBC__
+let ctype be used on non-glibc ( musl ) C library
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Submitted
+
+ Source/JavaScriptCore/runtime/Options.cpp                    | 2 +-
+ Source/WTF/wtf/DisallowCType.h                               | 2 +-
+ Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | 2 ++
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
+index fe830b4..c49aade 100644
+--- a/Source/JavaScriptCore/runtime/Options.cpp
++++ b/Source/JavaScriptCore/runtime/Options.cpp
+@@ -610,7 +610,7 @@ bool Option::operator==(const Option& other) const
+     case Options::Type::unsignedType:
+         return m_entry.unsignedVal == other.m_entry.unsignedVal;
+     case Options::Type::doubleType:
+-        return (m_entry.doubleVal == other.m_entry.doubleVal) || (isnan(m_entry.doubleVal) && isnan(other.m_entry.doubleVal));
++        return (m_entry.doubleVal == other.m_entry.doubleVal) || (std::isnan(m_entry.doubleVal) && std::isnan(other.m_entry.doubleVal));
+     case Options::Type::int32Type:
+         return m_entry.int32Val == other.m_entry.int32Val;
+     case Options::Type::optionRangeType:
+diff --git a/Source/WTF/wtf/DisallowCType.h b/Source/WTF/wtf/DisallowCType.h
+index d85e767..dc6bcab 100644
+--- a/Source/WTF/wtf/DisallowCType.h
++++ b/Source/WTF/wtf/DisallowCType.h
+@@ -40,7 +40,7 @@
+ // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
+ // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
+ // isacii(). 
+-#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION)
++#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__)
+ 
+ #include <ctype.h>
+ 
+diff --git a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+index ea61909..1495642 100644
+--- a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
++++ b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+@@ -202,7 +202,9 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchrono
+ void MemoryPressureHandler::platformReleaseMemory(Critical)
+ {
+     ReliefLogger log("Run malloc_trim");
++#ifdef __GLIBC__
+     malloc_trim(0);
++#endif
+ }
+ 
+ void MemoryPressureHandler::ReliefLogger::platformLog()
+-- 
+2.6.4
+
meta/recipes-sato/webkit/webkitgtk_2.10.4.bb +1 -0
index f5add32..098bbbb 100644
@@ -14,6 +14,7 @@ SRC_URI = "\
   http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
   file://clang.patch \
   file://0001-Enable-backtrace-on-linux-when-using-glibc.patch \
+  file://0001-Fix-build-with-non-glibc-libraries-on-linux.patch \
   "
 SRC_URI[md5sum] = "fb010031c6f61c3a1a00793b112badb5"
 SRC_URI[sha256sum] = "dbf8260da5cac0c74de2d3cce1fe7c519da3cd816a2c769cb6c6d56addd2f055"
Signature · 1 line
2.7.0
author
#47 lore raw

PATCH 38/53 rt-tests: Fix build with non-gcc compilers

In reply to Khem Raj

Makery hard sets CC to be some form of gcc, make it set only if CC variable is absent in environment.

---
 ...t-CC-AR-variable-only-if-it-doesn-t-have-.patch | 30 ++++++++++++++++++++++
 meta/recipes-rt/rt-tests/rt-tests_0.96.bb          |  3 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch
meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch new file +30 -0
new file mode 100644
index 0000000..00fcc7d
@@ -0,0 +1,30 @@
+From 9640dde4241e1314b8e8ea35b0c8dab0b30ae51f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 3 Jan 2016 10:50:56 -0800
+Subject: [PATCH] Makefile: Set CC/AR variable only if it doesn't have a value
+
+This helps it compile with clang or any other compilers besides gcc
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Submitted
+
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 1e4b7d1..2c2d396 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ VERSION = 0.96
+-CC=$(CROSS_COMPILE)gcc
+-AR=$(CROSS_COMPILE)ar
++CC?=$(CROSS_COMPILE)gcc
++AR?=$(CROSS_COMPILE)ar
+ 
+ OBJDIR = bld
+ 
+-- 
+2.6.4
+
meta/recipes-rt/rt-tests/rt-tests_0.96.bb +2 -1
index 7d70392..2f96fea 100644
@@ -10,7 +10,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
 require rt-tests.inc
 inherit ptest
 
-SRC_URI += "file://run-ptest \
+SRC_URI += "file://0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch \
+            file://run-ptest \
             file://rt_bmark.py \
            "
 # Do not install hwlatdetect
Signature · 1 line
2.7.0
author
#48 lore raw

PATCH 39/53 webkitgtk: Update patch status

In reply to Khem Raj
---
 .../webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch     | 2 +-
 .../webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch    | 2 +-
 meta/recipes-sato/webkit/webkitgtk/clang.patch                          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch +1 -1
index 146087b..d7e4ef6 100644
@@ -7,7 +7,7 @@ We dont have backtrace() implemented on non-glibc libc's on linux
 
 Signed-off-by: Khem Raj <[email protected]>
 ---
-Upstream-Status: Pending
+Upstream-Status: Accepted
 
  Source/WTF/wtf/Assertions.cpp | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch +1 -1
index c57fcde..77ebf37 100644
@@ -9,7 +9,7 @@ let ctype be used on non-glibc ( musl ) C library
 
 Signed-off-by: Khem Raj <[email protected]>
 ---
-Upstream-Status: Submitted
+Upstream-Status: Accepted
 
  Source/JavaScriptCore/runtime/Options.cpp                    | 2 +-
  Source/WTF/wtf/DisallowCType.h                               | 2 +-
meta/recipes-sato/webkit/webkitgtk/clang.patch +1 -1
index ef77755..e526713 100644
@@ -8,7 +8,7 @@ Source/JavaScriptCore/assembler/ARM64Assembler.h:2857:33: error: cannot initiali
 
 Signed-off-by: Khem Raj <[email protected]>
 
-Upstream-Status: Pending
+Upstream-Status: Accepted
 
 Index: webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h
 ===================================================================
Signature · 1 line
2.7.0
author
#49 lore raw

PATCH 40/53 tar: Fix build for musl based targets

In reply to Khem Raj

It only considered linux-gnu hosts when cross compiling here we add linux-musl to the mix as well

Fixes errors e.g.

1.28-r0/tar-1.28/src/tar.c:1351:5: error: 'SAVEDIR_SORT_INODE' undeclared here (not in a function)

|      SAVEDIR_SORT_INODE
|      ^
---
 meta/recipes-extended/tar/tar/musl_dirent.patch | 19 +++++++++++++++++++
 meta/recipes-extended/tar/tar_1.28.bb           |  6 ++++++
 2 files changed, 25 insertions(+)
 create mode 100644 meta/recipes-extended/tar/tar/musl_dirent.patch
meta/recipes-extended/tar/tar/musl_dirent.patch new file +19 -0
new file mode 100644
index 0000000..b0dc16c
@@ -0,0 +1,19 @@
+musl has valid d_ino implementation
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+
+Index: tar-1.28/m4/d-ino.m4
+===================================================================
+--- tar-1.28.orig/m4/d-ino.m4
++++ tar-1.28/m4/d-ino.m4
+@@ -40,7 +40,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_
+            [gl_cv_struct_dirent_d_ino=no],
+            [case "$host_os" in
+                            # Guess yes on glibc systems with Linux kernel.
+-              linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
++              linux*-gnu*|linux*-musl*)
++                           gl_cv_struct_dirent_d_ino="guessing yes" ;;
+                            # If we don't know, assume the worst.
+               *)           gl_cv_struct_dirent_d_ino="guessing no" ;;
+             esac
meta/recipes-extended/tar/tar_1.28.bb +6 -0
index 8816000..518e622 100644
@@ -7,6 +7,12 @@ LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 SRC_URI += "file://remove-gets.patch \
+            file://musl_dirent.patch \
            "
 SRC_URI[md5sum] = "8f32b2bc1ed7ddf4cf4e4a39711341b0"
 SRC_URI[sha256sum] = "60e4bfe0602fef34cd908d91cf638e17eeb09394d7b98c2487217dc4d3147562"
+
+do_install_append_libc-musl() {
+	rm -f ${D}${libdir}/charset.alias
+	rmdir ${D}${libdir}
+}
Signature · 1 line
2.7.0
author
#50 lore raw

PATCH 41/53 net-tools: Fix build on musl

In reply to Khem Raj
---
 .../net-tools/net-tools/musl-fixes.patch           | 100 +++++++++++++++++++++
 .../net-tools/net-tools_1.60-26.bb                 |   1 +
 2 files changed, 101 insertions(+)
 create mode 100644 meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
meta/recipes-extended/net-tools/net-tools/musl-fixes.patch new file +100 -0
new file mode 100644
index 0000000..f694d59
@@ -0,0 +1,100 @@
+Adjust headers for non-glibc cases
+especially exposed by musl
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+
+Index: net-tools-1.60/lib/inet6_gr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_gr.c
++++ net-tools-1.60/lib/inet6_gr.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h>	/* glibc doesn't have this */
+ #endif
+ #include "version.h"
+Index: net-tools-1.60/lib/inet6_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_sr.c
++++ net-tools-1.60/lib/inet6_sr.c
+@@ -23,10 +23,10 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+-#include <net/route.h>
+-#else
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h>	/* glibc does not have this */
++#else
++#include <net/route.h>
+ #endif
+ #include "version.h"
+ #include "net-support.h"
+Index: net-tools-1.60/lib/inet_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet_sr.c
++++ net-tools-1.60/lib/inet_sr.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/lib/util-ank.c
+===================================================================
+--- net-tools-1.60.orig/lib/util-ank.c
++++ net-tools-1.60/lib/util-ank.c
+@@ -14,6 +14,7 @@
+  * Rani Assaf <[email protected]> 980929:	resolve addresses
+  */
+ 
++#include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+Index: net-tools-1.60/mii-tool.c
+===================================================================
+--- net-tools-1.60.orig/mii-tool.c
++++ net-tools-1.60/mii-tool.c
+@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c
+ #include <net/if.h>
+ #include <linux/sockios.h>
+ 
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include "mii.h"
+ #include "version.h"
+ 
+Index: net-tools-1.60/netstat.c
+===================================================================
+--- net-tools-1.60.orig/netstat.c
++++ net-tools-1.60/netstat.c
+@@ -87,6 +87,7 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <asm-generic/param.h>
+ 
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/slattach.c
+===================================================================
+--- net-tools-1.60.orig/slattach.c
++++ net-tools-1.60/slattach.c
+@@ -44,6 +44,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#include <termios.h>
+ #include <linux/if_slip.h>
+ 
+ #if defined(__GLIBC__)
meta/recipes-extended/net-tools/net-tools_1.60-26.bb +1 -0
index 04ea76f..79c7291 100644
@@ -11,6 +11,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/
            file://net-tools-config.h \
            file://net-tools-config.make \
            file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
+           file://musl-fixes.patch \
 	   "
 
 # for this package we're mostly interested in tracking debian patches,
Signature · 1 line
2.7.0
author
#51 lore raw

PATCH 42/53 pax: Fix build with musl

In reply to Khem Raj

There are several BSD specific assumptions
and some GNU specific ones.

---
 .../pax/pax/0001-Fix-build-with-musl.patch         | 1287 ++++++++++++++++++++
 .../pax/0001-use-strtoll-instead-of-strtoq.patch   |   33 +
 meta/recipes-extended/pax/pax_3.4.bb               |   10 +
 3 files changed, 1330 insertions(+)
 create mode 100644 meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch
 create mode 100644 meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch
meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch new file +1287 -0
new file mode 100644
index 0000000..61bf2de
@@ -0,0 +1,1287 @@
+From 47c4db8d37248d968fac7ee4a71ca64398890723 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 6 Jan 2016 11:57:21 -0800
+Subject: [PATCH] Fix build with musl
+
+Remove BSDisms
+Remove fts, and link to libfts thats provided externally
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Inappropriate[musl specific]
+
+ lib/Makefile.am |    4 +-
+ lib/fts.c       | 1025 -------------------------------------------------------
+ lib/fts.h       |  131 -------
+ lib/vis.h       |   13 +-
+ src/Makefile.am |    2 +-
+ src/extern.h    |    2 -
+ src/file_subs.c |    2 +-
+ src/tables.c    |    2 +-
+ 8 files changed, 14 insertions(+), 1167 deletions(-)
+ delete mode 100644 lib/fts.c
+ delete mode 100644 lib/fts.h
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 56d0859..7f5045a 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -8,8 +8,8 @@ AUTOMAKE_OPTIONS = 1.7 gnits
+ CLEANFILES = *~
+ 
+ noinst_LIBRARIES = libbsdfunc.a
+-noinst_HEADERS = vis.h bsdfunc.h fts.h
++noinst_HEADERS = vis.h bsdfunc.h
+ 
+ AM_CFLAGS = @EXTRA_CFLAGS@
+ 
+-libbsdfunc_a_SOURCES = vis.c strlcpy.c strmode.c fts.c
++libbsdfunc_a_SOURCES = vis.c strlcpy.c strmode.c
+diff --git a/lib/fts.c b/lib/fts.c
+deleted file mode 100644
+index 45e90ca..0000000
+--- a/lib/fts.c
++++ /dev/null
+@@ -1,1025 +0,0 @@
+-/*-
+- * Copyright (c) 1990, 1993, 1994
+- *      The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
+-
+-#include <sys/stat.h>
+-#include <fcntl.h>
+-#include <dirent.h>
+-#include <errno.h>
+-#include <fts.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <unistd.h>
+-
+-/* Largest alignment size needed, minus one.
+-   Usually long double is the worst case.  */
+-#ifndef ALIGNBYTES
+-#define ALIGNBYTES	(__alignof__ (long double) - 1)
+-#endif
+-/* Align P to that size.  */
+-#ifndef ALIGN
+-#define	ALIGN(p)	(((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
+-#endif
+-
+-
+-static FTSENT	*fts_alloc (FTS *, const char *, int);
+-static FTSENT	*fts_build (FTS *, int);
+-static void	 fts_lfree (FTSENT *);
+-static void	 fts_load (FTS *, FTSENT *);
+-static size_t	 fts_maxarglen (char * const *);
+-static void	 fts_padjust (FTS *, FTSENT *);
+-static int	 fts_palloc (FTS *, size_t);
+-static FTSENT	*fts_sort (FTS *, FTSENT *, int);
+-static u_short	 fts_stat (FTS *, FTSENT *, int);
+-static int      fts_safe_changedir (FTS *, FTSENT *, int, const char *);
+-
+-#ifndef MAX
+-#define MAX(a, b)	(a > b ? a : b)
+-#endif
+-
+-#define	ISDOT(a)	(a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
+-
+-#define CLR(opt)	(sp->fts_options &= ~(opt))
+-#define	ISSET(opt)	(sp->fts_options & (opt))
+-#define	SET(opt)	(sp->fts_options |= (opt))
+-
+-#define	FCHDIR(sp, fd)	(!ISSET(FTS_NOCHDIR) && fchdir(fd))
+-
+-#define	BREAD		3		/* fts_read */
+-
+-FTS *
+-fts_open(argv, koptions, compar)
+-	char * const *argv;
+-	register int koptions;
+-	int (*compar) (const FTSENT **, const FTSENT **);
+-{
+-	register FTS *sp;
+-	register FTSENT *p, *root;
+-	register int nitems;
+-	FTSENT *parent, *tmp;
+-	int len;
+-
+-tmp = NULL;	/* stop compiler whinging */
+-	/* Options check. */
+-	if (koptions & ~FTS_OPTIONMASK) {
+-		errno = EINVAL;
+-		return (NULL);
+-	}
+-
+-	/* Allocate/initialize the stream */
+-	if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
+-		return (NULL);
+-	memset(sp, 0, sizeof(FTS));
+-	sp->fts_compar = (int (*) (const void *, const void *)) compar;
+-	sp->fts_options = koptions;
+-
+-	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+-	if (ISSET(FTS_LOGICAL))
+-		SET(FTS_NOCHDIR);
+-
+-	/*
+-	 * Start out with 1K of path space, and enough, in any case,
+-	 * to hold the user's paths.
+-	 */
+-#ifndef MAXPATHLEN
+-#define MAXPATHLEN 1024
+-#endif
+-	if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+-		goto mem1;
+-
+-	/* Allocate/initialize root's parent. */
+-	if ((parent = fts_alloc(sp, "", 0)) == NULL)
+-		goto mem2;
+-	parent->fts_level = FTS_ROOTPARENTLEVEL;
+-
+-	/* Allocate/initialize root(s). */
+-	for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
+-		/* Don't allow zero-length paths. */
+-		if ((len = strlen(*argv)) == 0) {
+-			errno = ENOENT;
+-			goto mem3;
+-		}
+-
+-		p = fts_alloc(sp, *argv, len);
+-		p->fts_level = FTS_ROOTLEVEL;
+-		p->fts_parent = parent;
+-		p->fts_accpath = p->fts_name;
+-		p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
+-
+-		/* Command-line "." and ".." are real directories. */
+-		if (p->fts_info == FTS_DOT)
+-			p->fts_info = FTS_D;
+-
+-		/*
+-		 * If comparison routine supplied, traverse in sorted
+-		 * order; otherwise traverse in the order specified.
+-		 */
+-		if (compar) {
+-			p->fts_link = root;
+-			root = p;
+-		} else {
+-			p->fts_link = NULL;
+-			if (root == NULL)
+-				tmp = root = p;
+-			else {
+-				tmp->fts_link = p;
+-				tmp = p;
+-			}
+-		}
+-	}
+-	if (compar && nitems > 1)
+-		root = fts_sort(sp, root, nitems);
+-
+-	/*
+-	 * Allocate a dummy pointer and make fts_read think that we've just
+-	 * finished the node before the root(s); set p->fts_info to FTS_INIT
+-	 * so that everything about the "current" node is ignored.
+-	 */
+-	if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+-		goto mem3;
+-	sp->fts_cur->fts_link = root;
+-	sp->fts_cur->fts_info = FTS_INIT;
+-
+-	/*
+-	 * If using chdir(2), grab a file descriptor pointing to dot to ensure
+-	 * that we can get back here; this could be avoided for some paths,
+-	 * but almost certainly not worth the effort.  Slashes, symbolic links,
+-	 * and ".." are all fairly nasty problems.  Note, if we can't get the
+-	 * descriptor we run anyway, just more slowly.
+-	 */
+-	if (!ISSET(FTS_NOCHDIR)
+-	    && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
+-		SET(FTS_NOCHDIR);
+-
+-	return (sp);
+-
+-mem3:	fts_lfree(root);
+-	free(parent);
+-mem2:	free(sp->fts_path);
+-mem1:	free(sp);
+-	return (NULL);
+-}
+-
+-static void
+-fts_load(sp, p)
+-	FTS *sp;
+-	register FTSENT *p;
+-{
+-	register int len;
+-	register char *cp;
+-
+-	/*
+-	 * Load the stream structure for the next traversal.  Since we don't
+-	 * actually enter the directory until after the preorder visit, set
+-	 * the fts_accpath field specially so the chdir gets done to the right
+-	 * place and the user can access the first node.  From fts_open it's
+-	 * known that the path will fit.
+-	 */
+-	len = p->fts_pathlen = p->fts_namelen;
+-	memmove(sp->fts_path, p->fts_name, len + 1);
+-	if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
+-		len = strlen(++cp);
+-		memmove(p->fts_name, cp, len + 1);
+-		p->fts_namelen = len;
+-	}
+-	p->fts_accpath = p->fts_path = sp->fts_path;
+-	sp->fts_dev = p->fts_dev;
+-}
+-
+-int
+-fts_close(sp)
+-	FTS *sp;
+-{
+-	register FTSENT *freep, *p;
+-	int saved_errno;
+-
+-	/*
+-	 * This still works if we haven't read anything -- the dummy structure
+-	 * points to the root list, so we step through to the end of the root
+-	 * list which has a valid parent pointer.
+-	 */
+-	if (sp->fts_cur) {
+-		for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+-			freep = p;
+-			p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
+-			free(freep);
+-		}
+-		free(p);
+-	}
+-
+-	/* Free up child linked list, sort array, path buffer. */
+-	if (sp->fts_child)
+-		fts_lfree(sp->fts_child);
+-	if (sp->fts_array)
+-		free(sp->fts_array);
+-	free(sp->fts_path);
+-
+-	/* Return to original directory, save errno if necessary. */
+-	if (!ISSET(FTS_NOCHDIR)) {
+-		saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
+-		(void)close(sp->fts_rfd);
+-
+-		/* Set errno and return. */
+-		if (saved_errno != 0) {
+-			/* Free up the stream pointer. */
+-			free(sp);
+-			errno = saved_errno;
+-			return (-1);
+-		}
+-	}
+-
+-	/* Free up the stream pointer. */
+-	free(sp);
+-	return (0);
+-}
+-
+-/*
+- * Special case of "/" at the end of the path so that slashes aren't
+- * appended which would cause paths to be written as "....//foo".
+- */
+-#define	NAPPEND(p)							\
+-	(p->fts_path[p->fts_pathlen - 1] == '/'				\
+-	    ? p->fts_pathlen - 1 : p->fts_pathlen)
+-
+-FTSENT *
+-fts_read(sp)
+-	register FTS *sp;
+-{
+-	register FTSENT *p, *tmp;
+-	register int instr;
+-	register char *t;
+-	int saved_errno;
+-
+-	/* If finished or unrecoverable error, return NULL. */
+-	if (sp->fts_cur == NULL || ISSET(FTS_STOP))
+-		return (NULL);
+-
+-	/* Set current node pointer. */
+-	p = sp->fts_cur;
+-
+-	/* Save and zero out user instructions. */
+-	instr = p->fts_instr;
+-	p->fts_instr = FTS_NOINSTR;
+-
+-	/* Any type of file may be re-visited; re-stat and re-turn. */
+-	if (instr == FTS_AGAIN) {
+-		p->fts_info = fts_stat(sp, p, 0);
+-		return (p);
+-	}
+-
+-	/*
+-	 * Following a symlink -- SLNONE test allows application to see
+-	 * SLNONE and recover.  If indirecting through a symlink, have
+-	 * keep a pointer to current location.  If unable to get that
+-	 * pointer, follow fails.
+-	 */
+-	if (instr == FTS_FOLLOW &&
+-	    (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+-		p->fts_info = fts_stat(sp, p, 1);
+-		if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+-			if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
+-				p->fts_errno = errno;
+-				p->fts_info = FTS_ERR;
+-			} else
+-				p->fts_flags |= FTS_SYMFOLLOW;
+-		}
+-		return (p);
+-	}
+-
+-	/* Directory in pre-order. */
+-	if (p->fts_info == FTS_D) {
+-		/* If skipped or crossed mount point, do post-order visit. */
+-		if (instr == FTS_SKIP ||
+-		    (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
+-			if (p->fts_flags & FTS_SYMFOLLOW)
+-				(void)close(p->fts_symfd);
+-			if (sp->fts_child) {
+-				fts_lfree(sp->fts_child);
+-				sp->fts_child = NULL;
+-			}
+-			p->fts_info = FTS_DP;
+-			return (p);
+-		}
+-
+-		/* Rebuild if only read the names and now traversing. */
+-		if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
+-			CLR(FTS_NAMEONLY);
+-			fts_lfree(sp->fts_child);
+-			sp->fts_child = NULL;
+-		}
+-
+-		/*
+-		 * Cd to the subdirectory.
+-		 *
+-		 * If have already read and now fail to chdir, whack the list
+-		 * to make the names come out right, and set the parent errno
+-		 * so the application will eventually get an error condition.
+-		 * Set the FTS_DONTCHDIR flag so that when we logically change
+-		 * directories back to the parent we don't do a chdir.
+-		 *
+-		 * If haven't read do so.  If the read fails, fts_build sets
+-		 * FTS_STOP or the fts_info field of the node.
+-		 */
+-		if (sp->fts_child != NULL) {
+-			if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
+-				p->fts_errno = errno;
+-				p->fts_flags |= FTS_DONTCHDIR;
+-				for (p = sp->fts_child; p != NULL;
+-				     p = p->fts_link)
+-					p->fts_accpath =
+-					    p->fts_parent->fts_accpath;
+-			}
+-		} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+-			if (ISSET(FTS_STOP))
+-				return (NULL);
+-			return (p);
+-		}
+-		p = sp->fts_child;
+-		sp->fts_child = NULL;
+-		goto name;
+-	}
+-
+-	/* Move to the next node on this level. */
+-next:	tmp = p;
+-	if ((p = p->fts_link) != NULL) {
+-		free(tmp);
+-
+-		/*
+-		 * If reached the top, return to the original directory (or
+-		 * the root of the tree), and load the paths for the next root.
+-		 */
+-		if (p->fts_level == FTS_ROOTLEVEL) {
+-			if (FCHDIR(sp, sp->fts_rfd)) {
+-				SET(FTS_STOP);
+-				return (NULL);
+-			}
+-			fts_load(sp, p);
+-			return (sp->fts_cur = p);
+-		}
+-
+-		/*
+-		 * User may have called fts_set on the node.  If skipped,
+-		 * ignore.  If followed, get a file descriptor so we can
+-		 * get back if necessary.
+-		 */
+-		if (p->fts_instr == FTS_SKIP)
+-			goto next;
+-		if (p->fts_instr == FTS_FOLLOW) {
+-			p->fts_info = fts_stat(sp, p, 1);
+-			if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+-				if ((p->fts_symfd =
+-				    open(".", O_RDONLY, 0)) < 0) {
+-					p->fts_errno = errno;
+-					p->fts_info = FTS_ERR;
+-				} else
+-					p->fts_flags |= FTS_SYMFOLLOW;
+-			}
+-			p->fts_instr = FTS_NOINSTR;
+-		}
+-
+-name:		t = sp->fts_path + NAPPEND(p->fts_parent);
+-		*t++ = '/';
+-		memmove(t, p->fts_name, p->fts_namelen + 1);
+-		return (sp->fts_cur = p);
+-	}
+-
+-	/* Move up to the parent node. */
+-	p = tmp->fts_parent;
+-	free(tmp);
+-
+-	if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+-		/*
+-		 * Done; free everything up and set errno to 0 so the user
+-		 * can distinguish between error and EOF.
+-		 */
+-		free(p);
+-		errno = 0;
+-		return (sp->fts_cur = NULL);
+-	}
+-
+-	/* NUL terminate the pathname. */
+-	sp->fts_path[p->fts_pathlen] = '\0';
+-
+-	/*
+-	 * Return to the parent directory.  If at a root node or came through
+-	 * a symlink, go back through the file descriptor.  Otherwise, cd up
+-	 * one directory.
+-	 */
+-	if (p->fts_level == FTS_ROOTLEVEL) {
+-		if (FCHDIR(sp, sp->fts_rfd)) {
+-			SET(FTS_STOP);
+-			return (NULL);
+-		}
+-	} else if (p->fts_flags & FTS_SYMFOLLOW) {
+-		if (FCHDIR(sp, p->fts_symfd)) {
+-			saved_errno = errno;
+-			(void)close(p->fts_symfd);
+-			errno = saved_errno;
+-			SET(FTS_STOP);
+-			return (NULL);
+-		}
+-		(void)close(p->fts_symfd);
+-	} else if (!(p->fts_flags & FTS_DONTCHDIR) &&
+-		   fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
+-		SET(FTS_STOP);
+-		return (NULL);
+-	}
+-	p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+-	return (sp->fts_cur = p);
+-}
+-
+-/*
+- * Fts_set takes the stream as an argument although it's not used in this
+- * implementation; it would be necessary if anyone wanted to add global
+- * semantics to fts using fts_set.  An error return is allowed for similar
+- * reasons.
+- */
+-/* ARGSUSED */
+-int
+-fts_set(sp, p, instr)
+-	FTS __attribute__((__unused__)) *sp;
+-	FTSENT *p;
+-	int instr;
+-{
+-sp = NULL;	/* stop compiler whinging */
+-	if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+-	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
+-		errno = EINVAL;
+-		return (1);
+-	}
+-	p->fts_instr = instr;
+-	return (0);
+-}
+-
+-/*
+- * This is the tricky part -- do not casually change *anything* in here.  The
+- * idea is to build the linked list of entries that are used by fts_children
+- * and fts_read.  There are lots of special cases.
+- *
+- * The real slowdown in walking the tree is the stat calls.  If FTS_NOSTAT is
+- * set and it's a physical walk (so that symbolic links can't be directories),
+- * we can do things quickly.  First, if it's a 4.4BSD file system, the type
+- * of the file is in the directory entry.  Otherwise, we assume that the number
+- * of subdirectories in a node is equal to the number of links to the parent.
+- * The former skips all stat calls.  The latter skips stat calls in any leaf
+- * directories and for any files after the subdirectories in the directory have
+- * been found, cutting the stat calls by about 2/3.
+- */
+-static FTSENT *
+-fts_build(sp, type)
+-	register FTS *sp;
+-	int type;
+-{
+-	register struct dirent *dp;
+-	register FTSENT *p, *head;
+-	register int nitems;
+-	FTSENT *cur, *tail;
+-	DIR *dirp;
+-	void *oldaddr;
+-	int cderrno, descend, len, level, nlinks, saved_errno,
+-	    nostat, doadjust;
+-	size_t maxlen;
+-	char *cp;
+-
+-	/* Set current node pointer. */
+-	cur = sp->fts_cur;
+-
+-	/*
+-	 * Open the directory for reading.  If this fails, we're done.
+-	 * If being called from fts_read, set the fts_info field.
+-	 */
+-       if ((dirp = opendir(cur->fts_accpath)) == NULL) {
+-		if (type == BREAD) {
+-			cur->fts_info = FTS_DNR;
+-			cur->fts_errno = errno;
+-		}
+-		return (NULL);
+-	}
+-
+-	/*
+-	 * Nlinks is the number of possible entries of type directory in the
+-	 * directory if we're cheating on stat calls, 0 if we're not doing
+-	 * any stat calls at all, -1 if we're doing stats on everything.
+-	 */
+-	nlinks = -1;
+-	nostat = 0;
+-
+-	/*
+-	 * If we're going to need to stat anything or we want to descend
+-	 * and stay in the directory, chdir.  If this fails we keep going,
+-	 * but set a flag so we don't chdir after the post-order visit.
+-	 * We won't be able to stat anything, but we can still return the
+-	 * names themselves.  Note, that since fts_read won't be able to
+-	 * chdir into the directory, it will have to return different path
+-	 * names than before, i.e. "a/b" instead of "b".  Since the node
+-	 * has already been visited in pre-order, have to wait until the
+-	 * post-order visit to return the error.  There is a special case
+-	 * here, if there was nothing to stat then it's not an error to
+-	 * not be able to stat.  This is all fairly nasty.  If a program
+-	 * needed sorted entries or stat information, they had better be
+-	 * checking FTS_NS on the returned nodes.
+-	 */
+-	cderrno = 0;
+-	if (nlinks || type == BREAD) {
+-		if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
+-			if (nlinks && type == BREAD)
+-				cur->fts_errno = errno;
+-			cur->fts_flags |= FTS_DONTCHDIR;
+-			descend = 0;
+-			cderrno = errno;
+-			(void)closedir(dirp);
+-			dirp = NULL;
+-		} else
+-			descend = 1;
+-	} else
+-		descend = 0;
+-
+-	/*
+-	 * Figure out the max file name length that can be stored in the
+-	 * current path -- the inner loop allocates more path as necessary.
+-	 * We really wouldn't have to do the maxlen calculations here, we
+-	 * could do them in fts_read before returning the path, but it's a
+-	 * lot easier here since the length is part of the dirent structure.
+-	 *
+-	 * If not changing directories set a pointer so that can just append
+-	 * each new name into the path.
+-	 */
+-	len = NAPPEND(cur);
+-	if (ISSET(FTS_NOCHDIR)) {
+-		cp = sp->fts_path + len;
+-		*cp++ = '/';
+-	} else {
+-		/* GCC, you're too verbose. */
+-		cp = NULL;
+-	}
+-	len++;
+-	maxlen = sp->fts_pathlen - len;
+-
+-	level = cur->fts_level + 1;
+-
+-	/* Read the directory, attaching each entry to the `link' pointer. */
+-	doadjust = 0;
+-	for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
+-		if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+-			continue;
+-
+-		if ((p = fts_alloc(sp, dp->d_name, (int)_D_EXACT_NAMLEN (dp))) == NULL)
+-			goto mem1;
+-		if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
+-			oldaddr = sp->fts_path;
+-			if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
+-				/*
+-				 * No more memory for path or structures.  Save
+-				 * errno, free up the current structure and the
+-				 * structures already allocated.
+-				 */
+-mem1:				saved_errno = errno;
+-				if (p)
+-					free(p);
+-				fts_lfree(head);
+-				(void)closedir(dirp);
+-				cur->fts_info = FTS_ERR;
+-				SET(FTS_STOP);
+-				errno = saved_errno;
+-				return (NULL);
+-			}
+-			/* Did realloc() change the pointer? */
+-			if (oldaddr != sp->fts_path) {
+-				doadjust = 1;
+-				if (ISSET(FTS_NOCHDIR))
+-					cp = sp->fts_path + len;
+-			}
+-			maxlen = sp->fts_pathlen - len;
+-		}
+-
+-		if (len + _D_EXACT_NAMLEN (dp) >= 0x10000) {
+-			/*
+-			 * In an FTSENT, fts_pathlen is a u_short so it is
+-			 * possible to wraparound here.  If we do, free up
+-			 * the current structure and the structures already
+-			 * allocated, then error out with ENAMETOOLONG.
+-			 */
+-			free(p);
+-			fts_lfree(head);
+-			(void)closedir(dirp);
+-			cur->fts_info = FTS_ERR;
+-			SET(FTS_STOP);
+-			errno = ENAMETOOLONG;
+-			return (NULL);
+-		}
+-		p->fts_level = level;
+-		p->fts_parent = sp->fts_cur;
+-		p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
+-
+-#if defined FTS_WHITEOUT && 0
+-		if (dp->d_type == DT_WHT)
+-			p->fts_flags |= FTS_ISW;
+-#endif
+-
+-		if (cderrno) {
+-			if (nlinks) {
+-				p->fts_info = FTS_NS;
+-				p->fts_errno = cderrno;
+-			} else
+-				p->fts_info = FTS_NSOK;
+-			p->fts_accpath = cur->fts_accpath;
+-		} else if (nlinks == 0
+-#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
+-			   || (nostat &&
+-			       dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
+-#endif
+-		    ) {
+-			p->fts_accpath =
+-			    ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
+-			p->fts_info = FTS_NSOK;
+-		} else {
+-			/* Build a file name for fts_stat to stat. */
+-			if (ISSET(FTS_NOCHDIR)) {
+-				p->fts_accpath = p->fts_path;
+-				memmove(cp, p->fts_name, p->fts_namelen + 1);
+-			} else
+-				p->fts_accpath = p->fts_name;
+-			/* Stat it. */
+-			p->fts_info = fts_stat(sp, p, 0);
+-
+-			/* Decrement link count if applicable. */
+-			if (nlinks > 0 && (p->fts_info == FTS_D ||
+-			    p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
+-				--nlinks;
+-		}
+-
+-		/* We walk in directory order so "ls -f" doesn't get upset. */
+-		p->fts_link = NULL;
+-		if (head == NULL)
+-			head = tail = p;
+-		else {
+-			tail->fts_link = p;
+-			tail = p;
+-		}
+-		++nitems;
+-	}
+-	if (dirp)
+-		(void)closedir(dirp);
+-
+-	/*
+-	 * If realloc() changed the address of the path, adjust the
+-	 * addresses for the rest of the tree and the dir list.
+-	 */
+-	if (doadjust)
+-		fts_padjust(sp, head);
+-
+-	/*
+-	 * If not changing directories, reset the path back to original
+-	 * state.
+-	 */
+-	if (ISSET(FTS_NOCHDIR)) {
+-		if (len == sp->fts_pathlen || nitems == 0)
+-			--cp;
+-		*cp = '\0';
+-	}
+-
+-	/*
+-	 * If descended after called from fts_children or after called from
+-	 * fts_read and nothing found, get back.  At the root level we use
+-	 * the saved fd; if one of fts_open()'s arguments is a relative path
+-	 * to an empty directory, we wind up here with no other way back.  If
+-	 * can't get back, we're done.
+-	 */
+-	if (descend && nitems == 0 &&
+-	    (cur->fts_level == FTS_ROOTLEVEL ?
+-	     FCHDIR(sp, sp->fts_rfd) :
+-	     fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
+-		cur->fts_info = FTS_ERR;
+-		SET(FTS_STOP);
+-		return (NULL);
+-	}
+-
+-	/* If didn't find anything, return NULL. */
+-	if (!nitems) {
+-		if (type == BREAD)
+-			cur->fts_info = FTS_DP;
+-		return (NULL);
+-	}
+-
+-	/* Sort the entries. */
+-	if (sp->fts_compar && nitems > 1)
+-		head = fts_sort(sp, head, nitems);
+-	return (head);
+-}
+-
+-static u_short
+-fts_stat(sp, p, follow)
+-	FTS *sp;
+-	register FTSENT *p;
+-	int follow;
+-{
+-	register FTSENT *t;
+-	register dev_t dev;
+-	register ino_t ino;
+-	struct stat *sbp;
+-	int saved_errno;
+-
+-	/* If user needs stat info, stat buffer already allocated. */
+-	sbp = p->fts_statp;
+-
+-#if defined FTS_WHITEOUT && 0
+-	/* check for whiteout */
+-	if (p->fts_flags & FTS_ISW) {
+-		if (sbp != &sb) {
+-			memset(sbp, '\0', sizeof (*sbp));
+-			sbp->st_mode = S_IFWHT;
+-		}
+-		return (FTS_W);
+-       }
+-#endif
+-
+-	/*
+-	 * If doing a logical walk, or application requested FTS_FOLLOW, do
+-	 * a stat(2).  If that fails, check for a non-existent symlink.  If
+-	 * fail, set the errno from the stat call.
+-	 */
+-	if (ISSET(FTS_LOGICAL) || follow) {
+-		if (stat(p->fts_accpath, sbp)) {
+-			saved_errno = errno;
+-			if (!lstat(p->fts_accpath, sbp)) {
+-				errno = 0;
+-				return (FTS_SLNONE);
+-			}
+-			p->fts_errno = saved_errno;
+-			goto err;
+-		}
+-	} else if (lstat(p->fts_accpath, sbp)) {
+-		p->fts_errno = errno;
+-err:		memset(sbp, 0, sizeof(struct stat));
+-		return (FTS_NS);
+-	}
+-
+-	if (S_ISDIR(sbp->st_mode)) {
+-		/*
+-		 * Set the device/inode.  Used to find cycles and check for
+-		 * crossing mount points.  Also remember the link count, used
+-		 * in fts_build to limit the number of stat calls.  It is
+-		 * understood that these fields are only referenced if fts_info
+-		 * is set to FTS_D.
+-		 */
+-		dev = p->fts_dev = sbp->st_dev;
+-		ino = p->fts_ino = sbp->st_ino;
+-		p->fts_nlink = sbp->st_nlink;
+-
+-		if (ISDOT(p->fts_name))
+-			return (FTS_DOT);
+-
+-		/*
+-		 * Cycle detection is done by brute force when the directory
+-		 * is first encountered.  If the tree gets deep enough or the
+-		 * number of symbolic links to directories is high enough,
+-		 * something faster might be worthwhile.
+-		 */
+-		for (t = p->fts_parent;
+-		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+-			if (ino == t->fts_ino && dev == t->fts_dev) {
+-				p->fts_cycle = t;
+-				return (FTS_DC);
+-			}
+-		return (FTS_D);
+-	}
+-	if (S_ISLNK(sbp->st_mode))
+-		return (FTS_SL);
+-	if (S_ISREG(sbp->st_mode))
+-		return (FTS_F);
+-	return (FTS_DEFAULT);
+-}
+-
+-static FTSENT *
+-fts_sort(sp, head, nitems)
+-	FTS *sp;
+-	FTSENT *head;
+-	register int nitems;
+-{
+-	register FTSENT **ap, *p;
+-
+-	/*
+-	 * Construct an array of pointers to the structures and call qsort(3).
+-	 * Reassemble the array in the order returned by qsort.  If unable to
+-	 * sort for memory reasons, return the directory entries in their
+-	 * current order.  Allocate enough space for the current needs plus
+-	 * 40 so don't realloc one entry at a time.
+-	 */
+-	if (nitems > sp->fts_nitems) {
+-		struct _ftsent **a;
+-
+-		sp->fts_nitems = nitems + 40;
+-		if ((a = realloc(sp->fts_array,
+- 		    (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
+-			free(sp->fts_array);
+-			sp->fts_array = NULL;
+-			sp->fts_nitems = 0;
+-			return (head);
+-		}
+-		sp->fts_array = a;
+-	}
+-	for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+-		*ap++ = p;
+-	qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+-	for (head = *(ap = sp->fts_array); --nitems; ++ap)
+-		ap[0]->fts_link = ap[1];
+-	ap[0]->fts_link = NULL;
+-	return (head);
+-}
+-
+-static FTSENT *
+-fts_alloc(sp, name, namelen)
+-	FTS *sp;
+-	const char *name;
+-	register int namelen;
+-{
+-	register FTSENT *p;
+-	size_t len;
+-
+-	/*
+-	 * The file name is a variable length array and no stat structure is
+-	 * necessary if the user has set the nostat bit.  Allocate the FTSENT
+-	 * structure, the file name and the stat structure in one chunk, but
+-	 * be careful that the stat structure is reasonably aligned.  Since the
+-	 * fts_name field is declared to be of size 1, the fts_name pointer is
+-	 * namelen + 2 before the first possible address of the stat structure.
+-	 */
+-	len = sizeof(FTSENT) + namelen;
+-	len += sizeof(struct stat) + ALIGNBYTES;
+-	if ((p = malloc(len)) == NULL)
+-		return (NULL);
+-
+-	/* Copy the name and guarantee NUL termination. */
+-	memmove(p->fts_name, name, namelen);
+-	p->fts_name[namelen] = '\0';
+-
+-	p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
+-	p->fts_namelen = namelen;
+-	p->fts_path = sp->fts_path;
+-	p->fts_errno = 0;
+-	p->fts_flags = 0;
+-	p->fts_instr = FTS_NOINSTR;
+-	p->fts_number = 0;
+-	p->fts_pointer = NULL;
+-	return (p);
+-}
+-
+-static void
+-fts_lfree(head)
+-	register FTSENT *head;
+-{
+-	register FTSENT *p;
+-
+-	/* Free a linked list of structures. */
+-	while ((p = head)) {
+-		head = head->fts_link;
+-		free(p);
+-	}
+-}
+-
+-/*
+- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+- * though the kernel won't resolve them.  Add the size (not just what's needed)
+- * plus 256 bytes so don't realloc the path 2 bytes at a time.
+- */
+-static int
+-fts_palloc(sp, more)
+-	FTS *sp;
+-	size_t more;
+-{
+-	char *p;
+-
+-	sp->fts_pathlen += more + 256;
+-	/*
+-	 * Check for possible wraparound.  In an FTS, fts_pathlen is
+-	 * a signed int but in an FTSENT it is an unsigned short.
+-	 * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
+-	 */
+-	if (sp->fts_pathlen < 0 || sp->fts_pathlen >= 0x10000) {
+-		if (sp->fts_path) {
+-			free(sp->fts_path);
+-			sp->fts_path = NULL;
+-		}
+-		sp->fts_path = NULL;
+-		errno = ENAMETOOLONG;
+-		return (1);
+-	}
+-	p = realloc(sp->fts_path, sp->fts_pathlen);
+-	if (p == NULL) {
+-		free(sp->fts_path);
+-		sp->fts_path = NULL;
+-		return 1;
+-	}
+-	sp->fts_path = p;
+-	return 0;
+-}
+-
+-/*
+- * When the path is realloc'd, have to fix all of the pointers in structures
+- * already returned.
+- */
+-static void
+-fts_padjust(sp, head)
+-	FTS *sp;
+-	FTSENT *head;
+-{
+-	FTSENT *p;
+-	char *addr = sp->fts_path;
+-
+-#define	ADJUST(p) do {							\
+-	if ((p)->fts_accpath != (p)->fts_name) {			\
+-		(p)->fts_accpath =					\
+-		    (char *)addr + ((p)->fts_accpath - (p)->fts_path);	\
+-	}								\
+-	(p)->fts_path = addr;						\
+-} while (0)
+-	/* Adjust the current set of children. */
+-	for (p = sp->fts_child; p; p = p->fts_link)
+-		ADJUST(p);
+-
+-	/* Adjust the rest of the tree, including the current level. */
+-	for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
+-		ADJUST(p);
+-		p = p->fts_link ? p->fts_link : p->fts_parent;
+-	}
+-}
+-
+-static size_t
+-fts_maxarglen(argv)
+-	char * const *argv;
+-{
+-	size_t len, max;
+-
+-	for (max = 0; *argv; ++argv)
+-		if ((len = strlen(*argv)) > max)
+-			max = len;
+-	return (max + 1);
+-}
+-
+-/*
+- * Change to dir specified by fd or p->fts_accpath without getting
+- * tricked by someone changing the world out from underneath us.
+- * Assumes p->fts_dev and p->fts_ino are filled in.
+- */
+-static int
+-fts_safe_changedir(sp, p, fd, path)
+-	FTS *sp;
+-	FTSENT *p;
+-	int fd;
+-	const char *path;
+-{
+-	int ret, oerrno, newfd;
+-	struct stat sb;
+-
+-	newfd = fd;
+-	if (ISSET(FTS_NOCHDIR))
+-		return (0);
+-	if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
+-		return (-1);
+-	if (fstat(newfd, &sb)) {
+-		ret = -1;
+-		goto bail;
+-	}
+-	if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
+-		errno = ENOENT;		/* disinformation */
+-		ret = -1;
+-		goto bail;
+-	}
+-	ret = fchdir(newfd);
+-bail:
+-	oerrno = errno;
+-	if (fd < 0)
+-		(void)close(newfd);
+-	errno = oerrno;
+-	return (ret);
+-}
+diff --git a/lib/fts.h b/lib/fts.h
+deleted file mode 100644
+index 58846b9..0000000
+--- a/lib/fts.h
++++ /dev/null
+@@ -1,131 +0,0 @@
+-/*
+- * Copyright (c) 1989, 1993
+- *	The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- *
+- *	@(#)fts.h	8.3 (Berkeley) 8/14/94
+- */
+-
+-#ifndef	_FTS_H
+-#define	_FTS_H 1
+-
+-#include <features.h>
+-#include <sys/types.h>
+-
+-typedef struct {
+-	struct _ftsent *fts_cur;	/* current node */
+-	struct _ftsent *fts_child;	/* linked list of children */
+-	struct _ftsent **fts_array;	/* sort array */
+-	dev_t fts_dev;			/* starting device # */
+-	char *fts_path;			/* path for this descent */
+-	int fts_rfd;			/* fd for root */
+-	int fts_pathlen;		/* sizeof(path) */
+-	int fts_nitems;			/* elements in the sort array */
+-	int (*fts_compar) (const void *, const void *); /* compare fn */
+-
+-#define	FTS_COMFOLLOW	0x0001		/* follow command line symlinks */
+-#define	FTS_LOGICAL	0x0002		/* logical walk */
+-#define	FTS_NOCHDIR	0x0004		/* don't change directories */
+-#define	FTS_NOSTAT	0x0008		/* don't get stat info */
+-#define	FTS_PHYSICAL	0x0010		/* physical walk */
+-#define	FTS_SEEDOT	0x0020		/* return dot and dot-dot */
+-#define	FTS_XDEV	0x0040		/* don't cross devices */
+-#define FTS_WHITEOUT	0x0080		/* return whiteout information */
+-#define	FTS_OPTIONMASK	0x00ff		/* valid user option mask */
+-
+-#define	FTS_NAMEONLY	0x0100		/* (private) child names only */
+-#define	FTS_STOP	0x0200		/* (private) unrecoverable error */
+-	int fts_options;		/* fts_open options, global flags */
+-} FTS;
+-
+-typedef struct _ftsent {
+-	struct _ftsent *fts_cycle;	/* cycle node */
+-	struct _ftsent *fts_parent;	/* parent directory */
+-	struct _ftsent *fts_link;	/* next file in directory */
+-	long fts_number;	        /* local numeric value */
+-	void *fts_pointer;	        /* local address value */
+-	char *fts_accpath;		/* access path */
+-	char *fts_path;			/* root path */
+-	int fts_errno;			/* errno for this node */
+-	int fts_symfd;			/* fd for symlink */
+-	u_short fts_pathlen;		/* strlen(fts_path) */
+-	u_short fts_namelen;		/* strlen(fts_name) */
+-
+-	ino_t fts_ino;			/* inode */
+-	dev_t fts_dev;			/* device */
+-	nlink_t fts_nlink;		/* link count */
+-
+-#define	FTS_ROOTPARENTLEVEL	-1
+-#define	FTS_ROOTLEVEL		 0
+-	short fts_level;		/* depth (-1 to N) */
+-
+-#define	FTS_D		 1		/* preorder directory */
+-#define	FTS_DC		 2		/* directory that causes cycles */
+-#define	FTS_DEFAULT	 3		/* none of the above */
+-#define	FTS_DNR		 4		/* unreadable directory */
+-#define	FTS_DOT		 5		/* dot or dot-dot */
+-#define	FTS_DP		 6		/* postorder directory */
+-#define	FTS_ERR		 7		/* error; errno is set */
+-#define	FTS_F		 8		/* regular file */
+-#define	FTS_INIT	 9		/* initialized only */
+-#define	FTS_NS		10		/* stat(2) failed */
+-#define	FTS_NSOK	11		/* no stat(2) requested */
+-#define	FTS_SL		12		/* symbolic link */
+-#define	FTS_SLNONE	13		/* symbolic link without target */
+-#define FTS_W		14		/* whiteout object */
+-	u_short fts_info;		/* user flags for FTSENT structure */
+-
+-#define	FTS_DONTCHDIR	 0x01		/* don't chdir .. to the parent */
+-#define	FTS_SYMFOLLOW	 0x02		/* followed a symlink to get here */
+-	u_short fts_flags;		/* private flags for FTSENT structure */
+-
+-#define	FTS_AGAIN	 1		/* read node again */
+-#define	FTS_FOLLOW	 2		/* follow symbolic link */
+-#define	FTS_NOINSTR	 3		/* no instructions */
+-#define	FTS_SKIP	 4		/* discard node */
+-	u_short fts_instr;		/* fts_set() instructions */
+-
+-	struct stat *fts_statp;		/* stat(2) information */
+-	char fts_name[1];		/* file name */
+-} FTSENT;
+-
+-__BEGIN_DECLS
+-
+-#define fts_children pax_fts_children
+-#define fts_close pax_fts_close
+-#define fts_open pax_fts_open
+-#define fts_read pax_fts_read
+-#define fts_set pax_fts_set
+-
+-FTSENT	*fts_children (FTS *, int);
+-int	 fts_close (FTS *);
+-FTS	*fts_open (char * const *, int,
+-		   int (*)(const FTSENT **, const FTSENT **));
+-FTSENT	*fts_read (FTS *);
+-int	 fts_set (FTS *, FTSENT *, int) __THROW;
+-__END_DECLS
+-
+-#endif /* fts.h */
+diff --git a/lib/vis.h b/lib/vis.h
+index d34d342..71fa5f4 100644
+--- a/lib/vis.h
++++ b/lib/vis.h
+@@ -73,14 +73,19 @@
+  */
+ #define	UNVIS_END	1	/* no more characters */
+ 
+-#include <sys/cdefs.h>
++#ifndef __P
++#define __P(x) x
++#endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ char	*vis __P((char *, int, int, int));
+ int	strvis __P((char *, const char *, int));
+ int	strvisx __P((char *, const char *, size_t, int));
+ int	strunvis __P((char *, const char *));
+ int	unvis __P((char *, char, int *, int));
+-__END_DECLS
+-
++#ifdef __cplusplus
++}
++#endif
+ #endif /* !_VIS_H_ */
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 5ef52a3..227cdef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,4 +22,4 @@ pax_SOURCES = ar_io.c ar_subs.c buf_subs.c cache.c cpio.c\
+ 	file_subs.c ftree.c gen_subs.c getoldopt.c options.c\
+ 	pat_rep.c pax.c sel_subs.c tables.c tar.c tty_subs.c
+ 
+-pax_LDADD = $(top_builddir)/lib/libbsdfunc.a
++pax_LDADD = $(top_builddir)/lib/libbsdfunc.a -lfts
+diff --git a/src/extern.h b/src/extern.h
+index 361fa81..3ed365d 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -37,8 +37,6 @@
+  * External references from each source file
+  */
+ 
+-#include <sys/cdefs.h>
+-
+ /*
+  * ar_io.c
+  */
+diff --git a/src/file_subs.c b/src/file_subs.c
+index 5590ff1..15bc339 100644
+--- a/src/file_subs.c
++++ b/src/file_subs.c
+@@ -52,7 +52,7 @@
+ #include "extern.h"
+ 
+ static int
+-mk_link __P((register char *,register struct stat *,register char *, int));
++mk_link (register char *,register struct stat *,register char *, int);
+ 
+ /*
+  * routines that deal with file operations such as: creating, removing;
+diff --git a/src/tables.c b/src/tables.c
+index 2275bf7..8fddca4 100644
+--- a/src/tables.c
++++ b/src/tables.c
+@@ -39,7 +39,7 @@
+ #include <sys/time.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+-- 
+2.6.4
+
meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch new file +33 -0
new file mode 100644
index 0000000..58ac9ce
@@ -0,0 +1,33 @@
+From b1f50320332c9c90fa33ab136ef0ec2d12cda461 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 6 Jan 2016 12:30:52 -0800
+Subject: [PATCH] use strtoll instead of strtoq
+
+Use LLONG_MAX instead of LONG_LONG_MAX
+LONG_LONG_MAX is GNU specific
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ src/options.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/options.c b/src/options.c
+index da8b4cf..c663b4e 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -1547,8 +1547,8 @@ str_offt (char *val)
+ 
+ #if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
+     || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+-  num = strtoq (val, &expr, 0);
+-  if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
++  num = strtoll (val, &expr, 0);
++  if ((num == LLONG_MAX) || (num <= 0) || (expr == val))
+ #else
+   num = strtol (val, &expr, 0);
+   if ((num == LONG_MAX) || (num <= 0) || (expr == val))
+-- 
+2.6.4
+
meta/recipes-extended/pax/pax_3.4.bb +10 -0
index ad04871..cee52e3 100644
@@ -12,11 +12,21 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4b0b674dfdc56daa3832d4069b820ea0 \
 SECTION = "base"
 PR = "r2"
 
+DEPENDS_append_libc-musl = " fts "
+
 SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
 	file://fix_for_compile_with_gcc-4.6.0.patch \
 	file://pax-3.4_fix_for_x32.patch"
 
+SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
+                             file://0001-use-strtoll-instead-of-strtoq.patch \
+                           "
+
 SRC_URI[md5sum] = "fbd9023b590b45ac3ade95870702a0d6"
 SRC_URI[sha256sum] = "ac3c06048e02828077cf7757d3d142241429238893b91d529af29a2e8cc5623b"
 
+# see https://lists.yoctoproject.org/pipermail/poky/2013-December/009435.html
+# We should ideally drop ac_cv_sizeof_off_t from site files but until then
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)}"
+
 inherit autotools
Signature · 1 line
2.7.0
author
#52 lore raw

PATCH 43/53 iputils: Fix build with musl

In reply to Khem Raj
---
 .../files/0001-Fix-header-inclusion-for-musl.patch | 92 ++++++++++++++++++++++
 meta/recipes-extended/iputils/iputils_s20121221.bb |  1 +
 2 files changed, 93 insertions(+)
 create mode 100644 meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch
meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch new file +92 -0
new file mode 100644
index 0000000..20ef07e
@@ -0,0 +1,92 @@
+From be0bb81d72fea4d20da74f4f2236aa145684f332 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 6 Jan 2016 14:14:22 -0800
+Subject: [PATCH] Fix header inclusion for musl
+
+Fix errors e.g.
+
+In file included from tracepath.c:17:0:
+/usr/include/linux/errqueue.h:33:18:
+error: array type has incomplete element type 'struct timespec'
+  struct timespec ts[3];
+                  ^
+tracepath.c: In function 'main':
+tracepath.c:329:16: error: 'INT_MAX' undeclared (first use in this
+function)
+      overhead, INT_MAX);
+                ^
+tracepath.c:329:16: note: each undeclared identifier is reported only
+once for each function it appears in
+Makefile:131: recipe for target 'tracepath.o' failed
+make: *** [tracepath.o] Error 1
+
+ping_common.c: In function 'main_loop':
+ping_common.c:756:15: error: 'HZ' undeclared (first use in this
+function)
+    if (1000 % HZ == 0 ? next <= 1000 / HZ : (next < INT_MAX / HZ &&
+next * HZ <= 1000)) {
+
+protocols/timed.h is not needed and is absent in musl
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ clockdiff.c   | 1 -
+ ping_common.c | 1 +
+ tracepath.c   | 2 ++
+ tracepath6.c  | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/clockdiff.c b/clockdiff.c
+index 7c1ea1b..1d6341e 100644
+--- a/clockdiff.c
++++ b/clockdiff.c
+@@ -14,7 +14,6 @@
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+ #define TSPTYPES
+-#include <protocols/timed.h>
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <arpa/inet.h>
+diff --git a/ping_common.c b/ping_common.c
+index 7f82851..3ce699d 100644
+--- a/ping_common.c
++++ b/ping_common.c
+@@ -2,6 +2,7 @@
+ #include <ctype.h>
+ #include <sched.h>
+ #include <math.h>
++#include <asm-generic/param.h>
+ 
+ int options;
+ 
+diff --git a/tracepath.c b/tracepath.c
+index 89e6d16..c9d6ddd 100644
+--- a/tracepath.c
++++ b/tracepath.c
+@@ -12,6 +12,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
++#include <time.h>
+ #include <sys/socket.h>
+ #include <linux/types.h>
+ #include <linux/errqueue.h>
+diff --git a/tracepath6.c b/tracepath6.c
+index 126fadf..9d5745c 100644
+--- a/tracepath6.c
++++ b/tracepath6.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netinet/icmp6.h>
+-- 
+2.6.4
+
meta/recipes-extended/iputils/iputils_s20121221.bb +1 -0
index 49913d6..225c28b 100644
@@ -19,6 +19,7 @@ SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
            file://debian/targets.diff \
            file://nsgmls-path-fix.patch \
            file://fix-build-command-line-argument-with-gnutls.patch \
+           file://0001-Fix-header-inclusion-for-musl.patch \
           "
 
 SRC_URI[md5sum] = "6072aef64205720dd1893b375e184171"
Signature · 1 line
2.7.0
author
#53 lore raw

PATCH 44/53 libuser: Fix build when secure getenv is not there

In reply to Khem Raj

Fixes build on musl

---
 .../libuser/libuser/0001-Check-for-issetugid.patch | 62 ++++++++++++++++++++++
 .../libuser/0002-remove-unused-execinfo.h.patch    | 27 ++++++++++
 meta/recipes-extended/libuser/libuser_0.62.bb      |  4 +-
 3 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
 create mode 100644 meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch new file +62 -0
new file mode 100644
index 0000000..79756b9
@@ -0,0 +1,62 @@
+From d0537cb7f2dc5877700ad78dfd191515379d4edc Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 7 Jan 2016 02:22:51 +0000
+Subject: [PATCH 1/2] Check for issetugid()
+
+If secure version of getenv is not there then we can use
+issetugid() as aid to call getenv()
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ configure.ac |  1 +
+ lib/config.c | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1ded1a2..ee19e1f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -125,6 +125,7 @@ AC_TYPE_OFF_T
+ AC_TYPE_SIZE_T
+ 
+ AC_CHECK_FUNCS([__secure_getenv secure_getenv])
++AC_CHECK_FUNCS([issetugid])
+ 
+ # Modify CFLAGS after all tests are run (some of them could fail because
+ # of the -Werror).
+diff --git a/lib/config.c b/lib/config.c
+index 29e7120..30f9daf 100644
+--- a/lib/config.c
++++ b/lib/config.c
+@@ -44,8 +44,10 @@
+ #  define safe_getenv(string) secure_getenv(string)
+ #elif defined(HAVE___SECURE_GETENV)
+ #  define safe_getenv(string) __secure_getenv(string)
++#elif defined(HAVE_ISSETUGID)
++#  define safe_getenv(string) safe_getenv_issetugid(string)
+ #else
+-#  error Neither secure_getenv not __secure_getenv are available
++#  error None of secure_getenv, __secure_getenv, or issetugid is available
+ #endif
+ 
+ struct config_config {
+@@ -59,6 +61,14 @@ struct config_key {
+ 	GList *values;
+ };
+ 
++static const char*
++safe_getenv_issetugid(const char* name)
++{
++	if (issetugid ())
++		return 0;
++	return getenv (name);
++}
++
+ /* Compare two section names */
+ static int
+ compare_section_names(gconstpointer a, gconstpointer b)
+-- 
+2.7.0
+
meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch new file +27 -0
new file mode 100644
index 0000000..4bc0219
@@ -0,0 +1,27 @@
+From 4b2f81f307ffeac12956e5c16e894e5ebb937ea5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 7 Jan 2016 02:26:00 +0000
+Subject: [PATCH 2/2] remove unused execinfo.h
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ lib/error.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/lib/error.c b/lib/error.c
+index a5ec30a..443e601 100644
+--- a/lib/error.c
++++ b/lib/error.c
+@@ -18,7 +18,6 @@
+ #include <config.h>
+ #include <sys/types.h>
+ #include <errno.h>
+-#include <execinfo.h>
+ #include <libintl.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+-- 
+2.7.0
+
meta/recipes-extended/libuser/libuser_0.62.bb +3 -1
index 4caa8a1..2d5bd35 100644
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
 SECTION = "base"
 
 SRC_URI = "https://fedorahosted.org/releases/l/i/libuser/libuser-${PV}.tar.xz \
-           "
+           file://0001-Check-for-issetugid.patch \
+           file://0002-remove-unused-execinfo.h.patch \
+          "
 
 SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2"
 SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b"
Signature · 1 line
2.7.0
author
#54 lore raw

PATCH 45/53 iproute2: Fix build with musl

In reply to Khem Raj
---
 .../iproute2/iproute2/iproute2-4.3.0-musl.patch    | 97 ++++++++++++++++++++++
 .../iproute2/iproute2_4.3.0.bb                     |  1 +
 2 files changed, 98 insertions(+)
 create mode 100644 meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch
meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch new file +97 -0
new file mode 100644
index 0000000..1b415a5
@@ -0,0 +1,97 @@
+From 48596709d8ab59727b79a5c6db33ebb251c36543 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Thu, 19 Nov 2015 17:44:25 +0100
+Subject: [PATCH] Avoid in6_addr redefinition
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Due to both <netinet/in.h> and <linux/in6.h> being included, the
+in6_addr is being redefined: once from the C library headers and once
+from the kernel headers. This causes some build failures with for
+example the musl C library:
+
+In file included from ../include/linux/xfrm.h:4:0,
+                 from xfrm.h:29,
+                 from ipxfrm.c:39:
+../include/linux/in6.h:32:8: error: redefinition of ‘struct in6_addr’
+ struct in6_addr {
+        ^
+In file included from .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netdb.h:9:0,
+                 from ipxfrm.c:34:
+.../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:24:8: note: originally defined here
+ struct in6_addr
+        ^
+
+In order to fix this, use just the C library header <netinet/in.h>.
+
+Original patch taken from
+http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+Upstream-Status: Pending
+
+ include/libiptc/ipt_kernel_headers.h | 2 --
+ include/linux/if_bridge.h            | 1 -
+ include/linux/netfilter.h            | 2 --
+ include/linux/xfrm.h                 | 1 -
+ 4 files changed, 6 deletions(-)
+
+diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
+index 7e87828..9566be5 100644
+--- a/include/libiptc/ipt_kernel_headers.h
++++ b/include/libiptc/ipt_kernel_headers.h
+@@ -15,12 +15,10 @@
+ #else /* libc5 */
+ #include <sys/socket.h>
+ #include <linux/ip.h>
+-#include <linux/in.h>
+ #include <linux/if.h>
+ #include <linux/icmp.h>
+ #include <linux/tcp.h>
+ #include <linux/udp.h>
+ #include <linux/types.h>
+-#include <linux/in6.h>
+ #endif
+ #endif
+diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
+index ee197a3..f823aa4 100644
+--- a/include/linux/if_bridge.h
++++ b/include/linux/if_bridge.h
+@@ -15,7 +15,6 @@
+ 
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+ 
+ #define SYSFS_BRIDGE_ATTR	"bridge"
+ #define SYSFS_BRIDGE_FDB	"brforward"
+diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
+index b71b4c9..3e4e6ae 100644
+--- a/include/linux/netfilter.h
++++ b/include/linux/netfilter.h
+@@ -4,8 +4,6 @@
+ #include <linux/types.h>
+ 
+ #include <linux/sysctl.h>
+-#include <linux/in.h>
+-#include <linux/in6.h>
+ 
+ /* Responses from hook functions. */
+ #define NF_DROP 0
+diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
+index b8f5451..a9761a5 100644
+--- a/include/linux/xfrm.h
++++ b/include/linux/xfrm.h
+@@ -1,7 +1,6 @@
+ #ifndef _LINUX_XFRM_H
+ #define _LINUX_XFRM_H
+ 
+-#include <linux/in6.h>
+ #include <linux/types.h>
+ 
+ /* All of the structures in this file may not change size as they are
+-- 
+2.6.3
+
meta/recipes-connectivity/iproute2/iproute2_4.3.0.bb +1 -0
index 0b3d896..60f0a8d 100644
@@ -3,6 +3,7 @@ require iproute2.inc
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
            file://configure-cross.patch \
            file://0001-iproute2-de-bash-scripts.patch \
+           file://iproute2-4.3.0-musl.patch \
           "
 SRC_URI[md5sum] = "1a2bbb80cfc7ab3f3e987e18b3207c2f"
 SRC_URI[sha256sum] = "f03b1188dd6c039512424de82ff7a8f3b446680bd4e908ff42a7b9b137422995"
Signature · 1 line
2.7.0
author
#55 lore raw

PATCH 46/53 irda-utils: Fix header inclusions

In reply to Khem Raj

Helps compile with musl

---
 .../irda-utils/irda-utils-0.9.18/musl.patch        | 29 ++++++++++++++++++++++
 .../irda-utils/irda-utils_0.9.18.bb                |  1 +
 2 files changed, 30 insertions(+)
 create mode 100644 meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch
meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch new file +29 -0
new file mode 100644
index 0000000..97eb975
@@ -0,0 +1,29 @@
+Replace use of <net/if_packet.h> with <linux/if_packet.h>.
+
+kernel headers <linux/if_packet.h> already provides the
+needed definitions, moreover not all libc implementations
+provide if_packet.h e.g. musl
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+
+Index: irda-utils-0.9.18/irdaping/irdaping.c
+===================================================================
+--- irda-utils-0.9.18.orig/irdaping/irdaping.c
++++ irda-utils-0.9.18/irdaping/irdaping.c
+@@ -33,7 +33,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>		/* For struct ifreq */
+-#include <net/if_packet.h>	/* For struct sockaddr_pkt */
+ #include <net/if_arp.h>		/* For ARPHRD_IRDA */
+ #include <netinet/if_ether.h>	/* For ETH_P_ALL */
+ #include <netinet/in.h>		/* For htons */
+@@ -46,6 +45,7 @@
+ #include <asm/byteorder.h>	/* __cpu_to_le32 and co. */
+ 
+ #include <linux/types.h>	/* For __u8 and co. */
++#include <linux/if_packet.h>	/* For struct sockaddr_pkt */
+ #include <irda.h>
+ 
+ #ifndef AF_IRDA
meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb +1 -0
index bd2f815..11b2ee9 100644
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://irdadump/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/irda/irda-utils-${PV}.tar.gz \
            file://ldflags.patch \
+           file://musl.patch \
            file://init"
 
 SRC_URI[md5sum] = "84dc12aa4c3f61fccb8d8919bf4079bb"
Signature · 1 line
2.7.0
author
#56 lore raw

PATCH 47/53 nspr: Drop older glibc code

In reply to Khem Raj

This was not only getting included for libc5 but also for not-glibc libc implementations e.g. musl

---
 ...001-Remove-the-check-for-LINUX-glibc-case.patch | 35 ++++++++++++++++++++++
 meta/recipes-support/nspr/nspr_4.11.bb             |  9 ++++++
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-support/nspr/nspr/0001-Remove-the-check-for-LINUX-glibc-case.patch
meta/recipes-support/nspr/nspr/0001-Remove-the-check-for-LINUX-glibc-case.patch new file +35 -0
new file mode 100644
index 0000000..5b17355
@@ -0,0 +1,35 @@
+From 9b9c95e0390395c7e9ad24a882deb87a50846059 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 8 Aug 2015 17:10:34 -0700
+Subject: [PATCH] Remove the check for LINUX == glibc case
+
+Here it does not consider the case where musl can be an options it does
+consider the bionic case with !defined(ANDROID) but musl does not define
+and musl'ism defines like that
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ pr/src/misc/prnetdb.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c
+index b86248f..dc83a56 100644
+--- a/pr/src/misc/prnetdb.c
++++ b/pr/src/misc/prnetdb.c
+@@ -61,10 +61,7 @@ PRLock *_pr_dnsLock = NULL;
+ #define _PR_HAVE_GETPROTO_R_POINTER
+ #endif
+ 
+-#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \
+-	|| (defined(LINUX) && defined(_REENTRANT) \
+-        && !(defined(__GLIBC__) && __GLIBC__ >= 2) \
+-        && !defined(ANDROID))
++#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT))
+ #define _PR_HAVE_GETPROTO_R
+ #define _PR_HAVE_GETPROTO_R_POINTER
+ #endif
+-- 
+2.1.4
+
meta/recipes-support/nspr/nspr_4.11.bb +9 -0
index 3048641..3dabcb6 100644
@@ -13,6 +13,15 @@ SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz
 
 SRC_URI += "file://nspr.pc.in"
 
+CACHED_CONFIGUREVARS_append_libc-musl = " CFLAGS='${CFLAGS} -D_PR_POLL_AVAILABLE \
+                                          -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP \
+                                          -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO \
+                                          -D_PR_INET6_PROBE'"
+
+SRC_URI_append_libc-musl = "\
+        file://0001-Remove-the-check-for-LINUX-glibc-case.patch \
+        "
+
 UPSTREAM_CHECK_URI = "http://ftp.mozilla.org/pub/nspr/releases/"
 UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)/"
 
Signature · 1 line
2.7.0
author
#57 lore raw

PATCH 48/53 chkconfig: Avoid using caddr_t

In reply to Khem Raj
---
 .../chkconfig/chkconfig/replace_caddr_t.patch      | 33 ++++++++++++++++++++++
 .../recipes-extended/chkconfig/chkconfig_1.3.58.bb |  4 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch new file +33 -0
new file mode 100644
index 0000000..96d1938
@@ -0,0 +1,33 @@
+caddr_t is a legacy BSD type which was rejected by the POSIX standard.
+Use void * instead.
+
+sys/unitstd.h is not needed and moreover its not available on all C library
+implementations e.g. musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+Index: chkconfig-1.3.58/alternatives.c
+===================================================================
+--- chkconfig-1.3.58.orig/alternatives.c
++++ chkconfig-1.3.58/alternatives.c
+@@ -22,7 +22,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
+-#include <sys/unistd.h>
+ #include <unistd.h>
+ 
+ #define	FLAGS_TEST	(1 << 0)
+Index: chkconfig-1.3.58/leveldb.c
+===================================================================
+--- chkconfig-1.3.58.orig/leveldb.c
++++ chkconfig-1.3.58/leveldb.c
+@@ -442,7 +442,7 @@ int parseServiceInfo(int fd, char * name
+     fstat(fd, &sb);
+ 
+     bufstart = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
+-    if (bufstart == ((caddr_t) -1)) {
++    if (bufstart == ((void*) -1)) {
+ 	close(fd);
+ 	return -1;
+     }
meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb +3 -1
index 488847a..e839026 100644
@@ -16,7 +16,9 @@ PROVIDES += "virtual/update-alternatives"
 
 PR = "r7"
 
-SRC_URI = "http://fedorahosted.org/releases/c/h/chkconfig/${BPN}-${PV}.tar.bz2"
+SRC_URI = "http://fedorahosted.org/releases/c/h/chkconfig/${BPN}-${PV}.tar.bz2 \
+           file://replace_caddr_t.patch \
+          "
 
 SRC_URI[md5sum] = "c2039ca67f2749fe0c06ef7c6f8ee246"
 SRC_URI[sha256sum] = "18b497d25b2cada955c72810e45fcad8280d105f17cf45e2970f18271211de68"
Signature · 1 line
2.7.0
author
#58 lore raw

PATCH 49/53 tcf-agent: Implement canonicalize_file_name() for musl as well

In reply to Khem Raj
---
 ...nonicalize_file_name-is-specific-to-glibc.patch | 46 ++++++++++++++++++++++
 meta/recipes-devtools/tcf-agent/tcf-agent_git.bb   |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch
meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch new file +46 -0
new file mode 100644
index 0000000..5f93c46
@@ -0,0 +1,46 @@
+From 23a3759b74d081b3b2849b0d37a0e5219f37813e Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 7 Jan 2016 22:37:48 +0000
+Subject: [PATCH] canonicalize_file_name is specific to glibc
+
+When on Linux and not using glibc then we need to define
+canonicalize_file_name() API, therefore add a check for finding out if
+its not glibc
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ agent/tcf/framework/mdep.c | 2 +-
+ agent/tcf/framework/mdep.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/agent/tcf/framework/mdep.c b/agent/tcf/framework/mdep.c
+index 2b52ca8..7d09655 100644
+--- a/agent/tcf/framework/mdep.c
++++ b/agent/tcf/framework/mdep.c
+@@ -1042,7 +1042,7 @@ char * canonicalize_file_name(const char * path) {
+     return strdup(res);
+ }
+ 
+-#elif defined(__UCLIBC__)
++#elif defined(__UCLIBC__) || !defined(__GLIBC__)
+ 
+ char * canonicalize_file_name(const char * path) {
+     return realpath(path, NULL);
+diff --git a/agent/tcf/framework/mdep.h b/agent/tcf/framework/mdep.h
+index 1e718a2..187c399 100644
+--- a/agent/tcf/framework/mdep.h
++++ b/agent/tcf/framework/mdep.h
+@@ -276,7 +276,7 @@ extern int loc_clock_gettime(int, struct timespec *);
+ 
+ #define O_BINARY 0
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || !defined(__GLIBC__)
+ #  define O_LARGEFILE 0
+ extern char ** environ;
+ extern char * canonicalize_file_name(const char * path);
+-- 
+2.7.0
+
meta/recipes-devtools/tcf-agent/tcf-agent_git.bb +1 -0
index fff81a5..ab2fcd7 100644
@@ -12,6 +12,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
 SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git;branch=1.3_mars_bugfix \
            file://fix_ranlib.patch \
            file://ldflags.patch \
+           file://0001-canonicalize_file_name-is-specific-to-glibc.patch;striplevel=2 \
            file://tcf-agent.init \
            file://tcf-agent.service \
           "
Signature · 1 line
2.7.0
author
#59 lore raw

PATCH 50/53 bsd-headers, musl: Add recipe for bsd missing features

In reply to Khem Raj

let musl depend on these headers so they are staged along with libc

---
 meta/recipes-core/bsd-headers/bsd-headers.bb       |  25 +
 .../bsd-headers/bsd-headers/sys-queue.h            | 846 +++++++++++++++++++++
 .../bsd-headers/bsd-headers/sys-tree.h             | 761 ++++++++++++++++++
 meta/recipes-core/musl/musl_git.bb                 |   1 +
 4 files changed, 1633 insertions(+)
 create mode 100644 meta/recipes-core/bsd-headers/bsd-headers.bb
 create mode 100644 meta/recipes-core/bsd-headers/bsd-headers/sys-queue.h
 create mode 100644 meta/recipes-core/bsd-headers/bsd-headers/sys-tree.h
meta/recipes-core/bsd-headers/bsd-headers.bb new file +25 -0
new file mode 100644
index 0000000..ae659ab
@@ -0,0 +1,25 @@
+# Copyright (C) 2016 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "bsd compatible headers"
+LICENSE = "BSD-3-Clause && BSD-2-Clause"
+SECTION = "devel"
+
+SRC_URI = "file://sys-queue.h \
+           file://sys-tree.h \
+          "
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -Dm 0644 ${S}/sys-queue.h ${D}${includedir}/sys/queue.h
+	install -Dm 0644 ${S}/sys-tree.h ${D}${includedir}/sys/tree.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
meta/recipes-core/bsd-headers/bsd-headers/sys-queue.h new file +846 -0

846 lines not on this page · raw message

meta/recipes-core/bsd-headers/bsd-headers/sys-tree.h new file +761 -0

761 lines not on this page · raw message

meta/recipes-core/musl/musl_git.bb +1 -0
index 051d925..5b94d1f 100644
@@ -19,6 +19,7 @@ PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv
 DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            virtual/${TARGET_PREFIX}gcc-initial \
            libgcc-initial \
+           bsd-headers \
           "
 
 export CROSS_COMPILE="${TARGET_PREFIX}"
Signature · 1 line
2.7.0
author
#60 lore raw

PATCH 51/53 nfs-utils: Disable tcp-wrappers for musl

In reply to Khem Raj

Doesnt build with musl

---
 meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb +1 -0
index 2e0c8b1..ea00656 100644
@@ -64,6 +64,7 @@ EXTRA_OECONF = "--with-statduser=rpcuser \
                "
 
 PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
 PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
 PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
 
Signature · 1 line
2.7.0
author
#61 lore raw

PATCH 52/53 portmap: Point to tirpc headers and libraries on musl

In reply to Khem Raj
---
 meta/recipes-connectivity/portmap/portmap_6.0.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-connectivity/portmap/portmap_6.0.bb +4 -0
index e727fe3..999b4a9 100644
@@ -1,5 +1,7 @@
 require portmap.inc
 
+DEPENDS_append_libc-musl = " libtirpc "
+
 PR = "r9"
 
 SRC_URI = "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/portmap-6.0.tgz \
@@ -19,6 +21,8 @@ PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers"
 CPPFLAGS += "-DFACILITY=LOG_DAEMON -DENABLE_DNS -DHOSTS_ACCESS"
 CFLAGS += "-Wall -Wstrict-prototypes -fPIC"
 EXTRA_OEMAKE += "'NO_TCP_WRAPPER=${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '', '1', d)}'"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
 
 do_install() {
     install -d ${D}${mandir}/man8/ ${D}${base_sbindir} ${D}${sysconfdir}/init.d
Signature · 1 line
2.7.0
author
#62 lore raw

PATCH 53/53 elfutils: Add ALLOW_EMPTY for musl

In reply to Khem Raj

core-image-cmdline-full asks for elfutils package to be added to package it has all eu-* tools but we dont build them on musl. nevertheless lets satisfy the dependency so image can build for musl

---
 meta/recipes-devtools/elfutils/elfutils_0.163.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/elfutils/elfutils_0.163.bb +2 -0
index 0a7dd88..23e2d7a 100644
@@ -65,6 +65,8 @@ EXTRA_OEMAKE_libc-musl = "-C libelf"
 EXTRA_OEMAKE_class-native = ""
 EXTRA_OEMAKE_class-nativesdk = ""
 
+ALLOW_EMPTY_${PN}_libc-musl = "1"
+
 BBCLASSEXTEND = "native nativesdk"
 
 # Package utilities separately
Signature · 1 line
2.7.0
#63 lore raw
In reply to Khem Raj
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

I can't build an image for real x86 hardware though:

ERROR: Nothing PROVIDES 'virtual/libiconv-native' (but virtual:native:/home/ross/Yocto/poky/meta/recipes-devtools/mtools/ mtools_4.0.18.bb DEPENDS on or otherwise requires it). Close matches:
virtual/libiconv
virtual/libx11-native
virtual/libsdl-native
NOTE: Runtime target 'core-image-sato' is unbuildable, removing... Missing or unbuildable dependency chain was: ['core-image-sato', 'mtools-native', 'virtual/libiconv-native']

Ross

#64 lore raw
In reply to Khem Raj
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

Hm, for some reason, this doesn't work for me.

Lots and lots of "files installed but not packaged", all locales. eg /usr/lib/locale/hu/LC_MESSAGES/glib20.mo in glib-2.0.

systemd fails with this error, over and over:

| /data/poky-master/tmp/work/i586-poky-linux-musl/systemd/1_228+gitAUTOINC+dd050decb6-r0/git/src/basic/util.h:96:70:
error: unknown type name 'comparison_fn_t'
| static inline void qsort_safe(void *base, size_t nmemb, size_t size,
comparison_fn_t compar) {

Also I presume you're not building with debugging tools enabled because oprofile fails to build:

| make[2]: Entering directory '/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/build/pe_profiling'
| i586-poky-linux-musl-g++ -m32 -march=i586
--sysroot=/data/poky-master/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling -I.. -I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libutil
-I
/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libop
-I
/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libutil++
-I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libperf_events -I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libpe_utils
-I/data/poky-master/tmp/sysroots/qemux86/usr/include -W -Wall -fno-common
-ftemplate-depth-50 -O2 -pipe -g -feliminate-unused-debug-types
-fvisibility-inlines-hidden -c -o operf.o /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp | /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:
In function 'int __delete_old_previous_sample_data(const char*, const
stat*, int, FTW*)':
| /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:862:10:
error: 'FTW_STOP' was not declared in this scope

|    return FTW_STOP;
|           ^
|
/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:864:10:
error: 'FTW_CONTINUE' was not declared in this scope
|    return FTW_CONTINUE;
|           ^
|

/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:
In function 'void convert_sample_data()':
| /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:899:41:
error: 'FTW_ACTIONRETVAL' was not declared in this scope

|                  int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
|                                          ^
| Makefile:451: recipe for target 'operf.o' failed

I presume this is another "link to fts" case.

Ross

author
#67 lore raw
In reply to Burton, Ross
Quoted 11 lines · Ross
Quoted 2 lines · Ross

| int flags = FTW_DEPTH | FTW_ACTIONRETVAL;

ftw != fts, of course.

Looks like FTW_STOP etc are glibc-specific.
https://github.com/commodo/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch
seems reasonable, assuming it works.

Its changing the behaviour a bit. e.g. where its returning errno instead of FTW_STOP but since its an error case, it will work most of times.

Quoted 2 lines

Ross

#68 lore raw
In reply to Burton, Ross
Quoted 8 lines · Ross

systemd fails with this error, over and over:

| /data/poky-master/tmp/work/i586-poky-linux-musl/systemd/1_228+gitAUTOINC+dd050decb6-r0/git/src/basic/util.h:96:70:
error: unknown type name 'comparison_fn_t'
| static inline void qsort_safe(void *base, size_t nmemb, size_t size,
comparison_fn_t compar) {

I've just remembered about meta-musl so this is likely fixed there but I'm also seeing this when building systemd:

| /data/poky-master/tmp/work/i586-poky-linux-musl/systemd/1_228+gitAUTOINC+dd050decb6-r0/git/src/basic/missing.h:590:6:
error: #error "neither secure_getenv nor __secure_getenv are available"

Now I'll disable systemd verify it all works with sysvinit.

Ross

author
#69 lore raw
Quoted 12 lines · Ross
Quoted 8 lines · Ross

systemd fails with this error, over and over:

| /data/poky-master/tmp/work/i586-poky-linux-musl/systemd/1_228+gitAUTOINC+dd050decb6-r0/git/src/basic/util.h:96:70:
error: unknown type name 'comparison_fn_t'
| static inline void qsort_safe(void *base, size_t nmemb, size_t size,
comparison_fn_t compar) {

Quoted 8 lines

I've just remembered about meta-musl so this is likely fixed there but I'm also seeing this when building systemd:

| /data/poky-master/tmp/work/i586-poky-linux-musl/systemd/1_228+gitAUTOINC+dd050decb6-r0/git/src/basic/missing.h:590:6:
error: #error "neither secure_getenv nor __secure_getenv are available"

Now I'll disable systemd verify it all works with sysvinit.

yes systemd is not supported yet as I describe in prior email. I have patches to build it though but I dont want us to have it unless it works

Quoted 2 lines

Ross

#70 lore raw
In reply to Burton, Ross
Quoted 5 lines · Ross

Hm, for some reason, this doesn't work for me.

Lots and lots of "files installed but not packaged", all locales. eg /usr/lib/locale/hu/LC_MESSAGES/glib20.mo in glib-2.0.

So under musl the translations are being installed to /usr/lib/locale, whereas under glibc its /usr/share/locale. This is showing some problems in bitbake.conf: that sets localedir to ${libdir}/locale but then sets FILES_PN-locale to ${datadir}/locale.

Ross

author
#71 lore raw
Quoted 5 lines · Ross
Quoted 3 lines · Ross

Hm, for some reason, this doesn't work for me.

Quoted 8 lines
Quoted 2 lines

Lots and lots of "files installed but not packaged", all locales. eg /usr/lib/locale/hu/LC_MESSAGES/glib20.mo in glib-2.0.

So under musl the translations are being installed to /usr/lib/locale, whereas under glibc its /usr/share/locale. This is showing some problems in bitbake.conf: that sets localedir to ${libdir}/locale but then sets FILES_PN-locale to ${datadir}/locale.

I have seen those too but have not gotten to them since they were warnings and thus prioritized for later. but you seem to have found the reason
I think it should be in
/usr/share/locale, I think bitbake.conf should also do the same.

we need to enhance glib's gettext macros to include musl triplets in same lines as uclibc see

https://github.com/kraj/openembedded-core/blob/kraj/musl-fixes/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch

Quoted 2 lines

Ross

author
#72 lore raw
In reply to Burton, Ross
Quoted 5 lines · Ross
Quoted 3 lines · Ross

Hm, for some reason, this doesn't work for me.

Quoted 9 lines
Quoted 2 lines

Lots and lots of "files installed but not packaged", all locales. eg /usr/lib/locale/hu/LC_MESSAGES/glib20.mo in glib-2.0.

So under musl the translations are being installed to /usr/lib/locale, whereas under glibc its /usr/share/locale. This is showing some problems in bitbake.conf: that sets localedir to ${libdir}/locale but then sets FILES_PN-locale to ${datadir}/locale.

I have pushed a fix for this to pull branch as well here
https://github.com/kraj/openembedded-core/commit/db21a7a31e9c37f7c2dd0a914599d7b3467ae2d9

Quoted 1 line

Ross

author
#74 lore raw
In reply to Burton, Ross
Quoted 9 lines · Ross
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

Hm, for some reason, this doesn't work for me.

I think x86 includes more packages than other arches in these images. full-cmdline image is pretty new it hasnt yet been tested on all architectures only qemuarm is where I got it to work.

Quoted 5 lines

Lots and lots of "files installed but not packaged", all locales. eg /usr/lib/locale/hu/LC_MESSAGES/glib20.mo in glib-2.0.

systemd fails with this error, over and over:

systemd does not work with musl. I have patches in my tree to fix the build but then it does not run :(. musl and systemd has different goals, right now I am not putting lot of efforts to bridge the gap. Patches are here

https://github.com/kraj/systemd/commits/oe/master

Quoted 56 lines

| /data/poky-master/tmp/work/i586-poky-linux-musl/systemd/1_228+gitAUTOINC+dd050decb6-r0/git/src/basic/util.h:96:70:
error: unknown type name 'comparison_fn_t'
| static inline void qsort_safe(void *base, size_t nmemb, size_t size,
comparison_fn_t compar) {

Also I presume you're not building with debugging tools enabled because oprofile fails to build:

| make[2]: Entering directory '/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/build/pe_profiling' | i586-poky-linux-musl-g++ -m32 -march=i586 --sysroot=/data/poky-master/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I.

(quoted diff) +0 -2
-I/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling
-I..  -I

/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libutil -I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libop -I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libutil++ -I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libperf_events -I /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/libpe_utils

(quoted diff) +0 -3
-I/data/poky-master/tmp/sysroots/qemux86/usr/include   -W -Wall -fno-common
-ftemplate-depth-50 -O2 -pipe -g -feliminate-unused-debug-types
-fvisibility-inlines-hidden -c -o operf.o

/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp | /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:
In function 'int __delete_old_previous_sample_data(const char*, const stat*,
int, FTW*)':
| /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:862:10:
error: 'FTW_STOP' was not declared in this scope

|    return FTW_STOP;
|           ^
|
/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:864:10:
error: 'FTW_CONTINUE' was not declared in this scope
|    return FTW_CONTINUE;
|           ^
|

/data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:
In function 'void convert_sample_data()':
| /data/poky-master/tmp/work/i586-poky-linux-musl/oprofile/1.1.0-r0/oprofile-1.1.0/pe_profiling/operf.cpp:899:41:
error: 'FTW_ACTIONRETVAL' was not declared in this scope

|                  int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
|                                          ^
| Makefile:451: recipe for target 'operf.o' failed

I presume this is another "link to fts" case.

Ross

#75 lore raw
Quoted 3 lines · Khem Raj

systemd does not work with musl. I have patches in my tree to fix the build but then it does not run :(. musl and systemd has different

I wonder if we can/should raise a SkipPackage for systemd if musl is enabled?

Ross

author
#76 lore raw
Quoted 9 lines · Ross
Quoted 3 lines · Khem Raj

systemd does not work with musl. I have patches in my tree to fix the build but then it does not run :(. musl and systemd has different

I wonder if we can/should raise a SkipPackage for systemd if musl is enabled?

Seems good.

Quoted 2 lines

Ross

author
#77 lore raw
Quoted 4 lines · Khem Raj
Quoted 3 lines · Ross
Quoted 1 line · Khem Raj
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

systemd does not work with musl. I have patches in my tree to fix the build but then it does not run :(. musl and systemd has different

I wonder if we can/should raise a SkipPackage for systemd if musl is enabled?

Seems good.

I have updated the pull branch with

1. Fix for recursive mutex for directfb
2. Fix to skip parsing systemd for musl

#78 lore raw
In reply to Khem Raj
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

The postinst intercepts that are ran at rootfs time using user-mode qemu don't work with musl:

NOTE: Running intercept scripts:
NOTE: > Executing update_font_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/bin/fc-cache:
Invalid ELF image for this architecture
WARNING: The postinstall intercept hook 'update_font_cache' failed (exit
code: 255)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for
first boot: liberation-fonts
NOTE: > Executing update_icon_cache intercept ...
NOTE: > Executing update_pixbuf_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders:
Invalid ELF image for this architecture

Ross

author
#79 lore raw
Quoted 11 lines · Ross
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

The postinst intercepts that are ran at rootfs time using user-mode qemu don't work with musl:

Quoted 14 lines

NOTE: Running intercept scripts:
NOTE: > Executing update_font_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/bin/fc-cache:
Invalid ELF image for this architecture
WARNING: The postinstall intercept hook 'update_font_cache' failed (exit
code: 255)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for
first boot: liberation-fonts
NOTE: > Executing update_icon_cache intercept ...
NOTE: > Executing update_pixbuf_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders:
Invalid ELF image for this architecture

this is something new, havent seen it yet. will try to reproduce it here

Quoted 2 lines

Ross

author
#80 lore raw
In reply to Burton, Ross
Quoted 11 lines · Ross
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

The postinst intercepts that are ran at rootfs time using user-mode qemu don't work with musl:

Quoted 14 lines

NOTE: Running intercept scripts:
NOTE: > Executing update_font_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/bin/fc-cache:
Invalid ELF image for this architecture
WARNING: The postinstall intercept hook 'update_font_cache' failed (exit
code: 255)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for
first boot: liberation-fonts
NOTE: > Executing update_icon_cache intercept ...
NOTE: > Executing update_pixbuf_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders:
Invalid ELF image for this architecture

I have fixed this issue as well.

https://github.com/kraj/openembedded-core/commit/1b65d8b36606167f4f04192abf4e14ada305cd8d

Its baking on my master tree, will post it along wiith phase 4 pull request.

Quoted 2 lines

Ross

#81 lore raw
Quoted 27 lines · Khem Raj
Quoted 11 lines · Ross
Quoted 4 lines · Khem Raj

This set of fixes let core-image-full-cmdline build with musl along with core-image-sato
and core-image-weston

The postinst intercepts that are ran at rootfs time using user-mode qemu don't work with musl:

Quoted 14 lines

NOTE: Running intercept scripts:
NOTE: > Executing update_font_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/bin/fc-cache:
Invalid ELF image for this architecture
WARNING: The postinstall intercept hook 'update_font_cache' failed (exit
code: 255)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for
first boot: liberation-fonts
NOTE: > Executing update_icon_cache intercept ...
NOTE: > Executing update_pixbuf_cache intercept ...
/lib/ld-musl-i386.so.1: No such file or directory /data/poky-master/tmp/work/qemux86-poky-linux-musl/core-image-sato/1.0-r0/rootfs/usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders:
Invalid ELF image for this architecture

Quoted 3 lines

I have fixed this issue as well.

https://github.com/kraj/openembedded-core/commit/1b65d8b36606167f4f04192abf4e14ada305cd8d

I think making the symlinks relative like that will break in merged-usr setups (which I'm currently trying to add support for in OE). E.g., when ld.so is actually in /usr/lib and /lib symlinks to /usr/lib, the symlink to ../usr/lib/libc.so will be wrong.

systemd has been relying on ln's -r (--relative) option for some time for similar reasons, but it's a fairly recent addition to ln, so I'm not sure if it's acceptable for OE. If not, adding a symlink helper based on python's os.path.relpath might be a good idea.

Matthias

Quoted 6 lines

Its baking on my master tree, will post it along wiith phase 4 pull request.

Quoted 2 lines

Ross

#82 lore raw
Quoted 4 lines · Matthias Schiffer

systemd has been relying on ln's -r (--relative) option for some time for similar reasons, but it's a fairly recent addition to ln, so I'm not sure if it's acceptable for OE. If not, adding a symlink helper based on python's os.path.relpath might be a good idea.

As a general rule, if it's not in POSIX (and I don't think "ln -r" is) then we probably don't want OE to rely on it. As far as I know, oe-core doesn't currently require GNU ln to build.

p.

#83 lore raw
Quoted 9 lines · On Sun, 10 Jan 2016 22:22:19 Phil Blundell wrote:
Quoted 4 lines · Matthias Schiffer

systemd has been relying on ln's -r (--relative) option for some time for similar reasons, but it's a fairly recent addition to ln, so I'm not sure if it's acceptable for OE. If not, adding a symlink helper based on python's os.path.relpath might be a good idea.

As a general rule, if it's not in POSIX (and I don't think "ln -r" is) then we probably don't want OE to rely on it. As far as I know, oe-core doesn't currently require GNU ln to build.

This is why we have scripts/lnr to provide equivalent functionality.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre