Add musl to OE-Core
cover Add musl to OE-Core
This is a mimimal set of changes brought in from meta-musl to OE-Core, with this set one can build core-image-minimal using musl by setting
TCLIBC=musl
for all supported architectures, eventually we will bring more changes to other packages which will enable more complex image builds and eventually world.
Khem Raj (13):
gcc: Add support for building musl configuration
autoconf: Add musl support
gdb: Fix build with musl
mtd-utils: Backport and create patches to support musl
squashfs-tools: Define FNM_EXTMATCH if not defined
mtools: Use proper glibc override to add glibc packages to
recommendations
musl: Add recipe
sysvinit: Fix build with musl
gettext: Delete libintl.h and charset.alias
busybox: Add config for musl
openssl: Add musl configuration support
libpam: Fix build with musl
attr: Add patch to account for use of internal glibc header
.../openssl/openssl/configure-musl-target.patch | 27 +++ .../openssl/openssl/linux-musl-libc-termios.patch | 19 ++ .../recipes-connectivity/openssl/openssl_1.0.2d.bb | 2 + ...user-use-POSIX-getpwent-instead-of-getpwe.patch | 71 ++++++ meta/recipes-core/busybox/busybox/musl.cfg | 12 + meta/recipes-core/busybox/busybox_1.23.2.bb | 2 + meta/recipes-core/gettext/gettext_0.16.1.bb | 5 + meta/recipes-core/gettext/gettext_0.19.4.bb | 4 + meta/recipes-core/musl/musl.inc | 26 ++ meta/recipes-core/musl/musl_git.bb | 58 +++++ meta/recipes-core/sysvinit/sysvinit/musl.patch | 74 ++++++ meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 1 + .../autoconf/autoconf/add_musl_config.patch | 26 ++ meta/recipes-devtools/autoconf/autoconf_2.69.bb | 1 + meta/recipes-devtools/gcc/gcc-4.9.inc | 4 + .../gcc/gcc-4.9/0066-libstdc-musl.patch | 32 +++ .../gcc/gcc-4.9/0067-gcc-musl-support.patch | 267 +++++++++++++++++++++ .../gcc/gcc-4.9/0068-musl-dynamic-linker.patch | 205 ++++++++++++++++ .../gcc/gcc-4.9/0069-musl-no-fixincludes.patch | 21 ++ meta/recipes-devtools/gcc/gcc-5.2.inc | 4 + .../gcc/gcc-5.2/0043-libstdc-musl.patch | 32 +++ .../gcc/gcc-5.2/0044-gcc-musl-support.patch | 267 +++++++++++++++++++++ .../gcc/gcc-5.2/0045-musl-dynamic-linker.patch | 198 +++++++++++++++ .../gcc/gcc-5.2/0046-musl-no-fixincludes.patch | 22 ++ meta/recipes-devtools/gdb/gdb.inc | 1 + ...0001-Use-exported-definitions-of-SIGRTMIN.patch | 52 ++++ .../mtd/mtd-utils/0001-Fix-build-with-musl.patch | 53 ++++ ...ibfec-use-standard-C-type-instead-of-u_lo.patch | 56 +++++ .../mtd/mtd-utils/010-fix-rpmatch.patch | 24 ++ meta/recipes-devtools/mtd/mtd-utils_git.bb | 4 + meta/recipes-devtools/mtools/mtools_4.0.18.bb | 4 +- .../squashfs-tools/squashfs-tools/fix-compat.patch | 63 +++++ .../squashfs-tools/squashfs-tools_git.bb | 1 + ...upport-for-defining-missing-funcitonality.patch | 68 ++++++ .../pam/libpam/include_paths_header.patch | 59 +++++ meta/recipes-extended/pam/libpam_1.2.1.bb | 5 +- meta/recipes-support/attr/attr_2.4.47.bb | 4 +- .../attr/files/dont-use-decl-macros.patch | 44 ++++ 38 files changed, 1814 insertions(+), 4 deletions(-) create mode 100644 meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/linux-musl-libc-termios.patch create mode 100644 meta/recipes-core/busybox/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch create mode 100644 meta/recipes-core/busybox/busybox/musl.cfg create mode 100644 meta/recipes-core/musl/musl.inc create mode 100644 meta/recipes-core/musl/musl_git.bb create mode 100644 meta/recipes-core/sysvinit/sysvinit/musl.patch create mode 100644 meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0066-libstdc-musl.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0043-libstdc-musl.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0044-gcc-musl-support.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0045-musl-dynamic-linker.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0046-musl-no-fixincludes.patch create mode 100644 meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch create mode 100644 meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch create mode 100644 meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch create mode 100644 meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch create mode 100644 meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch create mode 100644 meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch create mode 100644 meta/recipes-extended/pam/libpam/include_paths_header.patch create mode 100644 meta/recipes-support/attr/files/dont-use-decl-macros.patch
Signature · 1 line
2.6.3
PATCH 1/13 gcc: Add support for building musl configuration
Most of these patches are already in gcc 6.0/master but we still need them for older gcc, they have been tested in meta-musl for quite some time
--- meta/recipes-devtools/gcc/gcc-4.9.inc | 4 + .../gcc/gcc-4.9/0066-libstdc-musl.patch | 32 +++ .../gcc/gcc-4.9/0067-gcc-musl-support.patch | 267 +++++++++++++++++++++ .../gcc/gcc-4.9/0068-musl-dynamic-linker.patch | 205 ++++++++++++++++ .../gcc/gcc-4.9/0069-musl-no-fixincludes.patch | 21 ++ meta/recipes-devtools/gcc/gcc-5.2.inc | 4 + .../gcc/gcc-5.2/0043-libstdc-musl.patch | 32 +++ .../gcc/gcc-5.2/0044-gcc-musl-support.patch | 267 +++++++++++++++++++++ .../gcc/gcc-5.2/0045-musl-dynamic-linker.patch | 198 +++++++++++++++ .../gcc/gcc-5.2/0046-musl-no-fixincludes.patch | 22 ++ 10 files changed, 1052 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0066-libstdc-musl.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0043-libstdc-musl.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0044-gcc-musl-support.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0045-musl-dynamic-linker.patch create mode 100644 meta/recipes-devtools/gcc/gcc-5.2/0046-musl-no-fixincludes.patch
meta/recipes-devtools/gcc/gcc-4.9.inc +4 -0
@@ -81,6 +81,10 @@ SRC_URI = "\ file://0063-nativesdk-gcc-support.patch \ file://0064-handle-target-sysroot-multilib.patch \ file://0065-gcc-483-universal-initializer-no-warning.patch \ + file://0066-libstdc-musl.patch \ + file://0067-gcc-musl-support.patch \ + file://0068-musl-dynamic-linker.patch \ + file://0069-musl-no-fixincludes.patch \ " SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327" SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
meta/recipes-devtools/gcc/gcc-4.9/0066-libstdc-musl.patch new file +32 -0
@@ -0,0 +1,32 @@ +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: gcc-4.9-20140316/libstdc++-v3/configure.host +=================================================================== +--- gcc-4.9-20140316.orig/libstdc++-v3/configure.host 2014-03-26 01:12:19.466008193 -0700 ++++ gcc-4.9-20140316/libstdc++-v3/configure.host 2014-03-26 01:43:48.222684357 -0700 +@@ -264,14 +264,24 @@ + os_include_dir="os/bsd/freebsd" + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) ++ # check for musl by target ++ case "${host_os}" in ++ *-musl*) ++ os_include_dir="os/generic" ++ ;; ++ *) + if [ "$uclibc" = "yes" ]; then + os_include_dir="os/uclibc" + elif [ "$bionic" = "yes" ]; then + os_include_dir="os/bionic" ++ elif [ "$musl" = "yes" ]; then ++ os_include_dir="os/generic" + else + os_include_dir="os/gnu-linux" + fi + ;; ++ esac ++ ;; + hpux*) + os_include_dir="os/hpux" + ;;
meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch new file +267 -0
267 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch new file +205 -0
205 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch new file +21 -0
@@ -0,0 +1,21 @@ +# HG changeset patch +# Parent 600a8a422ccaf5627ad1f5a138e7398df2b9e9d8 +Get rid of ever-broken fixincludes on musl. +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + + +Index: gcc-4.9-20140316/fixincludes/mkfixinc.sh +=================================================================== +--- gcc-4.9-20140316.orig/fixincludes/mkfixinc.sh ++++ gcc-4.9-20140316/fixincludes/mkfixinc.sh +@@ -19,7 +19,8 @@ case $machine in + powerpc-*-eabi* | \ + powerpc-*-rtems* | \ + powerpcle-*-eabisim* | \ +- powerpcle-*-eabi* ) ++ powerpcle-*-eabi* | \ ++ *-musl* ) + # IF there is no include fixing, + # THEN create a no-op fixer and exit + (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
meta/recipes-devtools/gcc/gcc-5.2.inc +4 -0
@@ -74,6 +74,10 @@ SRC_URI = "\ file://0040-nativesdk-gcc-support.patch \ file://0041-handle-target-sysroot-multilib.patch \ file://0042-cxxflags-for-build.patch \ + file://0043-libstdc-musl.patch \ + file://0044-gcc-musl-support.patch \ + file://0045-musl-dynamic-linker.patch \ + file://0046-musl-no-fixincludes.patch \ " BACKPORTS = ""
meta/recipes-devtools/gcc/gcc-5.2/0043-libstdc-musl.patch new file +32 -0
@@ -0,0 +1,32 @@ +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: gcc-4.9-20140316/libstdc++-v3/configure.host +=================================================================== +--- gcc-4.9-20140316.orig/libstdc++-v3/configure.host 2014-03-26 01:12:19.466008193 -0700 ++++ gcc-4.9-20140316/libstdc++-v3/configure.host 2014-03-26 01:43:48.222684357 -0700 +@@ -264,14 +264,24 @@ + os_include_dir="os/bsd/freebsd" + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) ++ # check for musl by target ++ case "${host_os}" in ++ *-musl*) ++ os_include_dir="os/generic" ++ ;; ++ *) + if [ "$uclibc" = "yes" ]; then + os_include_dir="os/uclibc" + elif [ "$bionic" = "yes" ]; then + os_include_dir="os/bionic" ++ elif [ "$musl" = "yes" ]; then ++ os_include_dir="os/generic" + else + os_include_dir="os/gnu-linux" + fi + ;; ++ esac ++ ;; + hpux*) + os_include_dir="os/hpux" + ;;
meta/recipes-devtools/gcc/gcc-5.2/0044-gcc-musl-support.patch new file +267 -0
267 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-5.2/0045-musl-dynamic-linker.patch new file +198 -0
198 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-5.2/0046-musl-no-fixincludes.patch new file +22 -0
@@ -0,0 +1,22 @@ +# HG changeset patch +# Parent 600a8a422ccaf5627ad1f5a138e7398df2b9e9d8 +Get rid of ever-broken fixincludes on musl. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + + +Index: gcc-4.9-20140316/fixincludes/mkfixinc.sh +=================================================================== +--- gcc-4.9-20140316.orig/fixincludes/mkfixinc.sh ++++ gcc-4.9-20140316/fixincludes/mkfixinc.sh +@@ -19,7 +19,8 @@ case $machine in + powerpc-*-eabi* | \ + powerpc-*-rtems* | \ + powerpcle-*-eabisim* | \ +- powerpcle-*-eabi* ) ++ powerpcle-*-eabi* | \ ++ *-musl* ) + # IF there is no include fixing, + # THEN create a no-op fixer and exit + (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
Signature · 1 line
2.6.3
PATCH 2/13 autoconf: Add musl support
Support musl triplets
--- .../autoconf/autoconf/add_musl_config.patch | 26 ++++++++++++++++++++++ meta/recipes-devtools/autoconf/autoconf_2.69.bb | 1 + 2 files changed, 27 insertions(+) create mode 100644 meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch
meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch new file +26 -0
@@ -0,0 +1,26 @@ +backport http://git.savannah.gnu.org/cgit/config.git/commit/config.sub?id=062587eaa891396c936555ae51f7e77eeb71a5fe + +Signed-off-by: Khem Raj <[email protected]> +Upstream-Status: Backport +Index: autoconf-2.69/build-aux/config.sub +=================================================================== +--- autoconf-2.69.orig/build-aux/config.sub ++++ autoconf-2.69/build-aux/config.sub +@@ -123,7 +123,7 @@ esac + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ ++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) +@@ -1360,7 +1360,7 @@ case $os in + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ +- | -linux-newlib* | -linux-uclibc* \ ++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
meta/recipes-devtools/autoconf/autoconf_2.69.bb +1 -0
@@ -13,6 +13,7 @@ SRC_URI += "file://autoreconf-include.patch \ file://remove-usr-local-lib-from-m4.patch \ file://preferbash.patch \ file://autotest-automake-result-format.patch \ + file://add_musl_config.patch \ " SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"
Signature · 1 line
2.6.3
PATCH 3/13 gdb: Fix build with musl
In reply to Khem RajThis is a patch that has been submitted upstream as well
--- meta/recipes-devtools/gdb/gdb.inc | 1 + ...0001-Use-exported-definitions-of-SIGRTMIN.patch | 52 ++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch
meta/recipes-devtools/gdb/gdb.inc +1 -0
@@ -5,6 +5,7 @@ inherit gettext SRC_URI += "file://0002-Change-order-of-CFLAGS.patch \ file://0003-Add-support-for-Renesas-SH-sh4-architecture.patch \ file://fix-detection-of-64-bit-PPC-inferior-in-gdbserver.patch \ + file://0001-Use-exported-definitions-of-SIGRTMIN.patch \ " #LDFLAGS_append = " -s" #export CFLAGS_append=" -L${STAGING_LIBDIR}"
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.6.3
Re: [PATCH 03/13] gdb: Fix build with musl
Quoted 1 line · Khem Raj
This is a patch that has been submitted upstream as well
Shouldn't it have an Upstream-Status header saying that?
p.
Quoted 1 line
index 0000000..1302330
Quoted 20 lines
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of new file +1
-1-SIGRTMIN.patch@@ -0,0 +1,52 @@ +From 2f97e89e9e4e5797d0d973e1d05c1f44c46b4912 Mon Sep 17 00:00:002001
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of new file +13
-0+From: Khem Raj <[email protected]> +Date: Fri, 5 Jun 2015 20:21:38 -0700 +Subject: [PATCH] Use exorted definitions of SIGRTMIN + +Define W_STOPCODE if not defined already + +__SIGRTMIN is internal to glibc and other libcs e.g. musl +may not provide them + +Fixes +https://sourceware.org/bugzilla/show_bug.cgi?id=13012 + +Signed-off-by: Khem Raj <[email protected]>
Re: [PATCH 03/13] gdb: Fix build with musl
Quoted 7 lines · Phil Blundell
Quoted 1 line · Khem Raj
This is a patch that has been submitted upstream as well
Shouldn't it have an Upstream-Status header saying that?
Yes it should. I will add it and push it to pu branch
Quoted 26 lines
p.
Quoted 1 line
index 0000000..1302330
Quoted 20 lines
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of new file +1
-1-SIGRTMIN.patch@@ -0,0 +1,52 @@ +From 2f97e89e9e4e5797d0d973e1d05c1f44c46b4912 Mon Sep 17 00:00:002001
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of new file +13
-0+From: Khem Raj <[email protected]> +Date: Fri, 5 Jun 2015 20:21:38 -0700 +Subject: [PATCH] Use exorted definitions of SIGRTMIN + +Define W_STOPCODE if not defined already + +__SIGRTMIN is internal to glibc and other libcs e.g. musl +may not provide them + +Fixes +https://sourceware.org/bugzilla/show_bug.cgi?id=13012 + +Signed-off-by: Khem Raj <[email protected]>
Re: [PATCH 03/13] gdb: Fix build with musl
In reply to Phil BlundellQuoted 7 lines · Phil Blundell
Quoted 1 line · Khem Raj
This is a patch that has been submitted upstream as well
Shouldn't it have an Upstream-Status header saying that?
Fix pushed to pull branch
Quoted 26 lines
p.
Quoted 1 line
index 0000000..1302330
Quoted 20 lines
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of new file +1
-1-SIGRTMIN.patch@@ -0,0 +1,52 @@ +From 2f97e89e9e4e5797d0d973e1d05c1f44c46b4912 Mon Sep 17 00:00:002001
meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of new file +13
-0+From: Khem Raj <[email protected]> +Date: Fri, 5 Jun 2015 20:21:38 -0700 +Subject: [PATCH] Use exorted definitions of SIGRTMIN + +Define W_STOPCODE if not defined already + +__SIGRTMIN is internal to glibc and other libcs e.g. musl +may not provide them + +Fixes +https://sourceware.org/bugzilla/show_bug.cgi?id=13012 + +Signed-off-by: Khem Raj <[email protected]>
PATCH 4/13 mtd-utils: Backport and create patches to support musl
In reply to Khem Raj--- .../mtd/mtd-utils/0001-Fix-build-with-musl.patch | 53 ++++++++++++++++++++ ...ibfec-use-standard-C-type-instead-of-u_lo.patch | 56 ++++++++++++++++++++++ .../mtd/mtd-utils/010-fix-rpmatch.patch | 24 ++++++++++ meta/recipes-devtools/mtd/mtd-utils_git.bb | 4 ++ 4 files changed, 137 insertions(+) create mode 100644 meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch create mode 100644 meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch create mode 100644 meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch new file +53 -0
@@ -0,0 +1,53 @@ +From e16fa28bc57c29923ab60af2ac343da83e1992d8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 6 Oct 2015 23:51:34 +0000 +Subject: [PATCH] Fix build with musl + +upstream status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + mkfs.jffs2.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- + recv_image.c | 1 - + serve_image.c | 1 - + 3 files changed, 42 insertions(+), 4 deletions(-) + +diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c +index f09c0b2..ed2dc43 100644 +--- a/mkfs.jffs2.c ++++ b/mkfs.jffs2.c +@@ -72,6 +72,7 @@ + #include <byteswap.h> + #include <crc32.h> + #include <inttypes.h> ++#include <limits.h> + + #include "rbtree.h" + #include "common.h" +diff --git a/recv_image.c b/recv_image.c +index 26a8361..0093831 100644 +--- a/recv_image.c ++++ b/recv_image.c +@@ -4,7 +4,6 @@ + #define _BSD_SOURCE /* struct ip_mreq */ + + #include <errno.h> +-#include <error.h> + #include <stdio.h> + #include <netdb.h> + #include <stdlib.h> +diff --git a/serve_image.c b/serve_image.c +index 38549a1..4f0e946 100644 +--- a/serve_image.c ++++ b/serve_image.c +@@ -3,7 +3,6 @@ + + #include <time.h> + #include <errno.h> +-#include <error.h> + #include <netdb.h> + #include <stdio.h> + #include <stdlib.h> +-- +2.6.1 +
meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch new file +56 -0
56 lines not on this page · raw message
meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch new file +24 -0
@@ -0,0 +1,24 @@ +Replace rpmatch() usage with checking first character of line + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +--- a/include/common.h ++++ b/include/common.h +@@ -122,10 +122,12 @@ + } + + if (strcmp("\n", line) != 0) { +- switch (rpmatch(line)) { +- case 0: ret = false; break; +- case 1: ret = true; break; +- case -1: ++ switch (line[0]) { ++ case 'N': ++ case 'n': ret = false; break; ++ case 'Y': ++ case 'y': ret = true; break; ++ default: + puts("unknown response; please try again"); + continue; + }
meta/recipes-devtools/mtd/mtd-utils_git.bb +4 -0
@@ -15,8 +15,12 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \ file://fix-armv7-neon-alignment.patch \ file://0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch \ file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \ + file://0001-Fix-build-with-musl.patch \ + file://0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch \ " +SRC_URI_append_libc-musl = " file://010-fix-rpmatch.patch " + S = "${WORKDIR}/git/" # xattr support creates an additional compile-time dependency on acl because
Signature · 1 line
2.6.3
Re: [PATCH 04/13] mtd-utils: Backport and create patches to support musl
meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch line 6
Quoted 5 lines · Khem Raj
meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch new file +5
-0+From: Khem Raj <[email protected]> +Date: Tue, 6 Oct 2015 23:51:34 +0000 +Subject: [PATCH] Fix build with musl + +upstream status: Pending
I think that's meant to be "Upstream-Status".
Also, just as a general comment, this patch series adds quite a lot of patches which are "Upstream-Status: Pending". It'd be nice if the ones that are suitable for upstreaming (which looks like it's most of them) could be submitted there, and any inapplicable ones marked as such.
p.
PATCH 5/13 squashfs-tools: Define FNM_EXTMATCH if not defined
In reply to Khem Rajhelps compiling when using musl
--- .../squashfs-tools/squashfs-tools/fix-compat.patch | 63 ++++++++++++++++++++++ .../squashfs-tools/squashfs-tools_git.bb | 1 + 2 files changed, 64 insertions(+) create mode 100644 meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch new file +63 -0
@@ -0,0 +1,63 @@ +Define FNM_EXTMATCH if not defined its glibc specific define +include missing sys/stat.h for stat* function declarations + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: squashfs-tools/action.c +=================================================================== +--- squashfs-tools.orig/action.c ++++ squashfs-tools/action.c +@@ -44,6 +44,10 @@ + #include "action.h" + #include "error.h" + ++#if !defined(FNM_EXTMATCH) ++#define FNM_EXTMATCH 0 ++#endif ++ + /* + * code to parse actions + */ +Index: squashfs-tools/mksquashfs.c +=================================================================== +--- squashfs-tools.orig/mksquashfs.c ++++ squashfs-tools/mksquashfs.c +@@ -1286,6 +1286,10 @@ void write_dir(squashfs_inode *inode, st + dir_size + 3, directory_block, directory_offset, NULL, NULL, + dir, 0); + ++#if !defined(FNM_EXTMATCH) ++#define FNM_EXTMATCH 0 ++#endif ++ + #ifdef SQUASHFS_TRACE + { + unsigned char *dirp; +Index: squashfs-tools/pseudo.c +=================================================================== +--- squashfs-tools.orig/pseudo.c ++++ squashfs-tools/pseudo.c +@@ -32,6 +32,7 @@ + #include <stdlib.h> + #include <sys/types.h> + #include <sys/wait.h> ++#include <sys/stat.h> + #include <ctype.h> + + #include "pseudo.h" +Index: squashfs-tools/unsquashfs.c +=================================================================== +--- squashfs-tools.orig/unsquashfs.c ++++ squashfs-tools/unsquashfs.c +@@ -38,6 +38,10 @@ + #include <limits.h> + #include <ctype.h> + ++#ifndef FNM_EXTMATCH ++#define FNM_EXTMATCH 0 ++#endif ++ + struct cache *fragment_cache, *data_cache; + struct queue *to_reader, *to_inflate, *to_writer, *from_writer; + pthread_t *thread, *inflator_thread;
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
@@ -13,6 +13,7 @@ SRCREV = "9c1db6d13a51a2e009f0027ef336ce03624eac0d" SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \ http://downloads.sourceforge.net/sevenzip/lzma465.tar.bz2;name=lzma \ file://0001-mksquashfs.c-get-inline-functions-work-with-C99.patch;striplevel=2 \ + file://fix-compat.patch \ " SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759" SRC_URI[lzma.sha256sum] = "c935fd04dd8e0e8c688a3078f3675d699679a90be81c12686837e0880aa0fa1e"
Signature · 1 line
2.6.3
PATCH 6/13 mtools: Use proper glibc override to add glibc packages to recommendations
In reply to Khem RajHelps building mtools on musl
--- meta/recipes-devtools/mtools/mtools_4.0.18.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/mtools/mtools_4.0.18.bb +2 -2
@@ -6,8 +6,8 @@ LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" -RDEPENDS_${PN} = "glibc-gconv-ibm850" -RRECOMMENDS_${PN} = "\ +RDEPENDS_${PN}_libc-glibc = "glibc-gconv-ibm850" +RRECOMMENDS_${PN}_libc-glibc = "\ glibc-gconv-ibm437 \ glibc-gconv-ibm737 \ glibc-gconv-ibm775 \
Signature · 1 line
2.6.3
PATCH 7/13 musl: Add recipe
In reply to Khem Rajmusl is posix compliant C library for linux
--- meta/recipes-core/musl/musl.inc | 26 +++++++++++++++++ meta/recipes-core/musl/musl_git.bb | 58 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 meta/recipes-core/musl/musl.inc create mode 100644 meta/recipes-core/musl/musl_git.bb
meta/recipes-core/musl/musl.inc new file +26 -0
@@ -0,0 +1,26 @@ +# Copyright (C) 2014 Khem Raj <[email protected]> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "An implementation of the standard library for Linux-based systems" +DESCRIPTION = "A new standard library to power a new generation of Linux-based devices. \ +musl is lightweight, fast, simple, free, and strives to be correct in the sense of \ +standards-conformance and safety." + +HOMEPAGE = "http://www.musl-libc.org/" +LICENSE = "MIT" +SECTION = "libs" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bccdfe36b123d1b0757d8025278d86ba" + +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" + +INHIBIT_DEFAULT_DEPS = "1" + +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}" + + +FILES_SOLIBSDEV = "" +FILES_${PN} += "${libdir}/lib*${SOLIBSDEV}" +INSANE_SKIP_${PN} = "dev-so" +
meta/recipes-core/musl/musl_git.bb new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
2.6.3
PATCH 8/13 sysvinit: Fix build with musl
In reply to Khem Raj--- meta/recipes-core/sysvinit/sysvinit/musl.patch | 74 ++++++++++++++++++++++++++ meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 1 + 2 files changed, 75 insertions(+) create mode 100644 meta/recipes-core/sysvinit/sysvinit/musl.patch
meta/recipes-core/sysvinit/sysvinit/musl.patch new file +74 -0
@@ -0,0 +1,74 @@ +Fix build on musl use realpath() API its available on all libcs + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: sysvinit-2.88dsf/src/ifdown.c +=================================================================== +--- sysvinit-2.88dsf.orig/src/ifdown.c 2010-03-23 07:37:01.000000000 -0700 ++++ sysvinit-2.88dsf/src/ifdown.c 2014-04-02 00:43:43.675437029 -0700 +@@ -26,11 +26,11 @@ + #include <unistd.h> + #include <time.h> + #include <string.h> ++#include <errno.h> + + #include <sys/ioctl.h> + #include <sys/socket.h> + #include <sys/time.h> +-#include <sys/errno.h> + + #include <net/if.h> + #include <netinet/in.h> +Index: sysvinit-2.88dsf/src/init.c +=================================================================== +--- sysvinit-2.88dsf.orig/src/init.c 2014-04-02 00:42:10.488770162 -0700 ++++ sysvinit-2.88dsf/src/init.c 2014-04-02 00:42:59.432103823 -0700 +@@ -49,6 +49,7 @@ + #include <utmp.h> + #include <ctype.h> + #include <stdarg.h> ++#include <sys/ttydefaults.h> + #include <sys/syslog.h> + #include <sys/time.h> + +Index: sysvinit-2.88dsf/src/mountpoint.c +=================================================================== +--- sysvinit-2.88dsf.orig/src/mountpoint.c 2009-09-10 01:28:49.000000000 -0700 ++++ sysvinit-2.88dsf/src/mountpoint.c 2014-04-02 00:44:18.248770942 -0700 +@@ -23,6 +23,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> + #include <stdlib.h> +Index: sysvinit-2.88dsf/src/killall5.c +=================================================================== +--- sysvinit-2.88dsf.orig/src/killall5.c 2014-03-26 00:49:52.982668074 -0700 ++++ sysvinit-2.88dsf/src/killall5.c 2014-04-02 00:46:45.838771653 -0700 +@@ -846,9 +846,9 @@ + char *oargv1, *pargv1; + if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) { + if (o->argv1 && p->argv1) { +- if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL) ++ if ((oargv1 = realpath(o->argv1, NULL)) == NULL) + oargv1 = strdup(o->argv1); +- if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL) ++ if ((pargv1 = realpath(p->argv1, NULL)) == NULL) + pargv1 = strdup(p->argv1); + if (! strcmp(oargv1, pargv1)) { + ret = 1; +Index: sysvinit-2.88dsf/src/wall.c +=================================================================== +--- sysvinit-2.88dsf.orig/src/wall.c 2009-11-22 14:05:53.000000000 -0800 ++++ sysvinit-2.88dsf/src/wall.c 2014-04-02 00:49:15.258772217 -0700 +@@ -29,6 +29,7 @@ + #include <unistd.h> + #include <pwd.h> + #include <syslog.h> ++#include <time.h> + #include "init.h" + +
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +1 -0
@@ -20,6 +20,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.bz2 \ file://bootlogd.init \ file://01_bootlogd \ " +SRC_URI_append_libc-musl = " file://musl.patch " SRC_URI[md5sum] = "6eda8a97b86e0a6f59dabbf25202aa6f" SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519"
Signature · 1 line
2.6.3
Re: [PATCH 08/13] sysvinit: Fix build with musl
Quoted 1 line · Khem Raj
+Fix build on musl use
realpath()API its available on all libcs
[...]
Quoted 1 line
+SRC_URI_append_libc-musl = " file://musl.patch "
If it's available on all libcs, is there any reason why this patch couldn't be applied unconditionally?
p.
PATCH 9/13 gettext: Delete libintl.h and charset.alias
In reply to Khem Rajlibintl.h is already provided by musl and charset.alias is regenerated by packages themselves
--- meta/recipes-core/gettext/gettext_0.16.1.bb | 5 +++++ meta/recipes-core/gettext/gettext_0.19.4.bb | 4 ++++ 2 files changed, 9 insertions(+)
meta/recipes-core/gettext/gettext_0.16.1.bb +5 -0
@@ -39,6 +39,11 @@ do_configure_prepend() { rm -f ${S}/config/m4/libtool.m4 } +do_install_append_libc-musl () { + rm -f ${D}${libdir}/charset.alias + rm -f ${D}${includedir}/libintl.h +} + # these lack the .x behind the .so, but shouldn't be in the -dev package # Otherwise you get the following results: # 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
meta/recipes-core/gettext/gettext_0.19.4.bb +4 -0
@@ -42,6 +42,10 @@ EXTRA_OECONF += "--without-lispdir \ acpaths = '-I ${S}/gettext-runtime/m4 \ -I ${S}/gettext-tools/m4' +do_install_append_libc-musl () { + rm -f ${D}${libdir}/charset.alias + rm -f ${D}${includedir}/libintl.h +} # these lack the .x behind the .so, but shouldn't be in the -dev package # Otherwise you get the following results:
Signature · 1 line
2.6.3
PATCH 10/13 busybox: Add config for musl
In reply to Khem RajDefault config is enabling additional features that dont compile with musl so lets disable them for musl case and use posix compliant getpwent()
--- ...user-use-POSIX-getpwent-instead-of-getpwe.patch | 71 ++++++++++++++++++++++ meta/recipes-core/busybox/busybox/musl.cfg | 12 ++++ meta/recipes-core/busybox/busybox_1.23.2.bb | 2 + 3 files changed, 85 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch create mode 100644 meta/recipes-core/busybox/busybox/musl.cfg
meta/recipes-core/busybox/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch new file +71 -0
@@ -0,0 +1,71 @@ +From f47fa75ef19a43848dedb4a2bff79368878362bf Mon Sep 17 00:00:00 2001 +From: Natanael Copa <[email protected]> +Date: Tue, 22 Apr 2014 12:41:20 +0000 +Subject: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r + +This fixes building with musl libc. + +Signed-off-by: Natanael Copa <[email protected]> +--- +Upstream-Status: backport + + libbb/lineedit.c | 11 ++++------- + loginutils/deluser.c | 11 +++++------ + 2 files changed, 9 insertions(+), 13 deletions(-) + +diff --git a/libbb/lineedit.c b/libbb/lineedit.c +index 8564307..99e6e2c 100644 +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -672,20 +672,17 @@ static char *username_path_completion(char *ud) + */ + static NOINLINE unsigned complete_username(const char *ud) + { +- /* Using _r function to avoid pulling in static buffers */ +- char line_buff[256]; +- struct passwd pwd; +- struct passwd *result; ++ struct passwd *pw; + unsigned userlen; + + ud++; /* skip ~ */ + userlen = strlen(ud); + + setpwent(); +- while (!getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) { ++ while ((pw = getpwent())) { + /* Null usernames should result in all users as possible completions. */ +- if (/*!userlen || */ strncmp(ud, pwd.pw_name, userlen) == 0) { +- add_match(xasprintf("~%s/", pwd.pw_name)); ++ if (/*!userlen || */ strncmp(ud, pw->pw_name, userlen) == 0) { ++ add_match(xasprintf("~%s/", pw->pw_name)); + } + } + endpwent(); +diff --git a/loginutils/deluser.c b/loginutils/deluser.c +index e39ac55..d7d9b24 100644 +--- a/loginutils/deluser.c ++++ b/loginutils/deluser.c +@@ -73,14 +73,13 @@ int deluser_main(int argc, char **argv) + if (!member) { + /* "delgroup GROUP" */ + struct passwd *pw; +- struct passwd pwent; + /* Check if the group is in use */ +-#define passwd_buf bb_common_bufsiz1 +- while (!getpwent_r(&pwent, passwd_buf, sizeof(passwd_buf), &pw)) { +- if (pwent.pw_gid == gr->gr_gid) +- bb_error_msg_and_die("'%s' still has '%s' as their primary group!", pwent.pw_name, name); ++ setpwent(); ++ while ((pw = getpwent())) { ++ if (pw->pw_gid == gr->gr_gid) ++ bb_error_msg_and_die("'%s' still has '%s' as their primary group!", pw->pw_name, name); + } +- //endpwent(); ++ endpwent(); + } + pfile = bb_path_group_file; + if (ENABLE_FEATURE_SHADOWPASSWDS) +-- +1.9.2 +
meta/recipes-core/busybox/busybox/musl.cfg new file +12 -0
@@ -0,0 +1,12 @@ +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_HAVE_RPC is not set +# CONFIG_WERROR is not set +# CONFIG_FEATURE_SYSTEMD is not set +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +# CONFIG_PAM is not set +# CONFIG_FEATURE_INETD_RPC is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +# CONFIG_FEATURE_UTMP is not set +
meta/recipes-core/busybox/busybox_1.23.2.bb +2 -0
@@ -39,7 +39,9 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://sha1sum.cfg \ file://sha256sum.cfg \ file://getopts.cfg \ + file://0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch \ " +SRC_URI_append_libc-musl = " file://musl.cfg " SRC_URI[tarball.md5sum] = "7925683d7dd105aabe9b6b618d48cc73" SRC_URI[tarball.sha256sum] = "05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a"
Signature · 1 line
2.6.3
PATCH 11/13 openssl: Add musl configuration support
In reply to Khem Rajuse termios instead of termio
--- .../openssl/openssl/configure-musl-target.patch | 27 ++++++++++++++++++++++ .../openssl/openssl/linux-musl-libc-termios.patch | 19 +++++++++++++++ .../recipes-connectivity/openssl/openssl_1.0.2d.bb | 2 ++ 3 files changed, 48 insertions(+) create mode 100644 meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/linux-musl-libc-termios.patch
meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch new file +27 -0
@@ -0,0 +1,27 @@ +Add musl triplet support + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: openssl-1.0.2a/Configure +=================================================================== +--- openssl-1.0.2a.orig/Configure ++++ openssl-1.0.2a/Configure +@@ -431,7 +431,7 @@ my %table=( + # + # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8 + # +-"linux-armv4", "gcc: -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-armv4", "gcc: -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + "linux-aarch64","gcc: -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + # Configure script adds minimally required -march for assembly support, + # if no -march was specified at command line. mips32 and mips64 below +@@ -504,6 +504,8 @@ my %table=( + "linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + "linux-uclibceabi-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + "linux-uclibceabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-musleabi-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-musleabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + + "linux-avr32","$ENV{'CC'}:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).", +
meta/recipes-connectivity/openssl/openssl/linux-musl-libc-termios.patch new file +19 -0
@@ -0,0 +1,19 @@ +http://git.alpinelinux.org/cgit/aports/tree/main/openssl/0003-use-termios.patch + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: openssl-1.0.2a/crypto/ui/ui_openssl.c +=================================================================== +--- openssl-1.0.2a.orig/crypto/ui/ui_openssl.c ++++ openssl-1.0.2a/crypto/ui/ui_openssl.c +@@ -218,6 +218,9 @@ + + #endif + ++#define TERMIOS ++#undef TERMIO ++ + #ifdef TERMIOS + # include <termios.h> + # define TTY_STRUCT struct termios
meta/recipes-connectivity/openssl/openssl_1.0.2d.bb +2 -0
@@ -37,6 +37,8 @@ SRC_URI += "file://configure-targets.patch \ file://crypto_use_bigint_in_x86-64_perl.patch \ file://openssl-1.0.2a-x32-asm.patch \ file://ptest_makefile_deps.patch \ + file://configure-musl-target.patch \ + file://linux-musl-libc-termios.patch \ " SRC_URI[md5sum] = "38dd619b2e77cbac69b99f52a053d25a"
Signature · 1 line
2.6.3
Re: [PATCH 11/13] openssl: Add musl configuration support
Quoted 2 lines · Khem Raj
++#define TERMIOS
++#undef TERMIO
Wouldn't it be better to change openssl.inc's definition of ${CFLAG} to do -DTERMIOS rather than -DTERMIO, if that's what you want?
p.
PATCH 12/13 libpam: Fix build with musl
In reply to Khem RajDefine strndupa if not available in libc additionally fix headers to explicitly needed include files which glibc was including indirectly
--- ...upport-for-defining-missing-funcitonality.patch | 68 ++++++++++++++++++++++ .../pam/libpam/include_paths_header.patch | 59 +++++++++++++++++++ meta/recipes-extended/pam/libpam_1.2.1.bb | 5 +- 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch create mode 100644 meta/recipes-extended/pam/libpam/include_paths_header.patch
meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch new file +68 -0
@@ -0,0 +1,68 @@ +From 45d1ed58927593968faead7dbb295f3922f41a2f Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Sat, 8 Aug 2015 14:16:43 -0700 +Subject: [PATCH] Add support for defining missing funcitonality + +In order to support alternative libc on linux ( musl, bioninc ) etc we +need to check for glibc-only features and provide alternatives, in this +list strndupa is first one, when configure detects that its not included +in system C library then the altrnative implementation from missing.h is +used + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Pending + + configure.ac | 3 +++ + libpam/include/missing.h | 12 ++++++++++++ + modules/pam_exec/pam_exec.c | 1 + + 3 files changed, 16 insertions(+) + create mode 100644 libpam/include/missing.h + +diff --git a/configure.ac b/configure.ac +index 9e1257f..cbed979 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -599,6 +599,9 @@ dnl + AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>]) + AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>]) + ++# musl and bionic don't have strndupa ++AC_CHECK_DECLS_ONCE([strndupa]) ++ + HAVE_KEY_MANAGEMENT=0 + if test $have_key_syscalls$have_key_errors = 11 + then +diff --git a/libpam/include/missing.h b/libpam/include/missing.h +new file mode 100644 +index 0000000..3cf011c +--- /dev/null ++++ b/libpam/include/missing.h +@@ -0,0 +1,12 @@ ++#pragma once ++ ++#if !HAVE_DECL_STRNDUPA ++#define strndupa(s, n) \ ++ ({ \ ++ const char *__old = (s); \ ++ size_t __len = strnlen(__old, (n)); \ ++ char *__new = alloca(__len + 1); \ ++ __new[__len] = '\0'; \ ++ memcpy(__new, __old, __len); \ ++ }) ++#endif +diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c +index 17ba6ca..3aa2694 100644 +--- a/modules/pam_exec/pam_exec.c ++++ b/modules/pam_exec/pam_exec.c +@@ -59,6 +59,7 @@ + #include <security/pam_modutil.h> + #include <security/pam_ext.h> + #include <security/_pam_macros.h> ++#include <missing.h> + + #define ENV_ITEM(n) { (n), #n } + static struct { +-- +2.1.4 +
meta/recipes-extended/pam/libpam/include_paths_header.patch new file +59 -0
59 lines not on this page · raw message
meta/recipes-extended/pam/libpam_1.2.1.bb +4 -1
@@ -31,7 +31,10 @@ SRC_URI[sha256sum] = "342b1211c0d3b203a7df2540a5b03a428a087bd8a48c17e49ae268f992 SRC_URI_append_libc-uclibc = " file://pam-no-innetgr.patch \ file://use-utmpx.patch" -SRC_URI_append_libc-musl = " file://pam-no-innetgr.patch" +SRC_URI_append_libc-musl = " file://pam-no-innetgr.patch \ + file://0001-Add-support-for-defining-missing-funcitonality.patch \ + file://include_paths_header.patch \ + " DEPENDS = "bison flex flex-native cracklib"
Signature · 1 line
2.6.3
PATCH 13/13 attr: Add patch to account for use of internal glibc header
In reply to Khem Rajbased on suggestions on musl FAQ
http://wiki.musl-libc.org/wiki/FAQ
--- meta/recipes-support/attr/attr_2.4.47.bb | 4 +- .../attr/files/dont-use-decl-macros.patch | 44 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/attr/files/dont-use-decl-macros.patch
meta/recipes-support/attr/attr_2.4.47.bb +3 -1
@@ -2,7 +2,9 @@ require attr.inc # configure.ac was missing from the release tarball. This should be fixed in # future releases of attr, remove this when updating the recipe. -SRC_URI_append += "file://attr-Missing-configure.ac.patch" +SRC_URI_append += "file://attr-Missing-configure.ac.patch \ + file://dont-use-decl-macros.patch \ + " SRC_URI[md5sum] = "84f58dec00b60f2dc8fd1c9709291cc7" SRC_URI[sha256sum] = "25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859"
meta/recipes-support/attr/files/dont-use-decl-macros.patch new file +44 -0
44 lines not on this page · raw message
Signature · 1 line
2.6.3
Re: [PATCH 13/13] attr: Add patch to account for use of internal glibc header
meta/recipes-support/attr/files/dont-use-decl-macros.patch line 2
Quoted 2 lines · Khem Raj
meta/recipes-support/attr/files/dont-use-decl-macros.patch new file +2
-0+musl does not do nested includes unless *necessary*, nor does it define +macros
This description doesn't make a lot of sense to me, and nor does the commit message make it very clear exactly which "internal glibc header" is being referred to. Could you add some more explanation?
p.