Skip to contentSkip to conversation

Add musl to OE-Core

PATCH In review Khem Raj 2 participants 18 messages Dec 8, 2015 – Dec 9, 2015

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

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.

v2: Address review feedback

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

 meta/recipes-connectivity/openssl/openssl.inc      |   4 +-
 .../openssl/openssl/configure-musl-target.patch    |  27 +++
 .../recipes-connectivity/openssl/openssl_1.0.2d.bb |   1 +
 ...user-use-POSIX-getpwent-instead-of-getpwe.patch |  71 ++++++
 meta/recipes-core/busybox/busybox/musl.cfg         |  12 +
 meta/recipes-core/busybox/busybox_1.24.1.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/realpath.patch |  78 ++++++
 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/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 ++
 .../gcc/gcc-4.9/0070-libstdc-musl.patch            |  32 +++
 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 |  54 +++++
 .../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          |  56 +++++
 38 files changed, 1815 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/configure-musl-target.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/realpath.patch
 create mode 100644 meta/recipes-devtools/autoconf/autoconf/add_musl_config.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-4.9/0070-libstdc-musl.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
author
#1 lore raw

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/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 ++
 .../gcc/gcc-4.9/0070-libstdc-musl.patch            |  32 +++
 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/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-4.9/0070-libstdc-musl.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
index 6ac3685..a602cd1 100644
@@ -82,6 +82,10 @@ SRC_URI = "\
     file://0064-handle-target-sysroot-multilib.patch \
     file://0065-gcc-483-universal-initializer-no-warning.patch \
     file://0066-cxxflags-for-build.patch \
+    file://0067-gcc-musl-support.patch \
+    file://0068-musl-dynamic-linker.patch \
+    file://0069-musl-no-fixincludes.patch \
+    file://0070-libstdc-musl.patch \
 "
 SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
 SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
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
new file mode 100644
index 0000000..e2b18a4
@@ -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-4.9/0070-libstdc-musl.patch new file +32 -0
new file mode 100644
index 0000000..048e481
@@ -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.inc +4 -0
index a6b385a..af9d887 100644
@@ -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
new file mode 100644
index 0000000..048e481
@@ -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
new file mode 100644
index 0000000..05fe52f
@@ -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
author
#2 lore raw

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
new file mode 100644
index 0000000..a9094d2
@@ -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
index 809007f..b9f6883 100644
@@ -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
author
#3 lore raw

PATCH 3/13 gdb: Fix build with musl

In reply to Khem Raj

This is a patch that has been submitted upstream as well

---
 meta/recipes-devtools/gdb/gdb.inc                  |  1 +
 ...0001-Use-exported-definitions-of-SIGRTMIN.patch | 54 ++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch
meta/recipes-devtools/gdb/gdb.inc +1 -0
index 88c0213..2162cad 100644
@@ -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 +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.6.3
author
#4 lore raw

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
new file mode 100644
index 0000000..d3699c6
@@ -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
new file mode 100644
index 0000000..7d783e7
@@ -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
index 17dca77..bc15ddd 100644
@@ -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
author
#5 lore raw

PATCH 5/13 squashfs-tools: Define FNM_EXTMATCH if not defined

In reply to Khem Raj

helps 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
new file mode 100644
index 0000000..d545146
@@ -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
index 7aebd00..33ed09a 100644
@@ -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
author
#6 lore raw

PATCH 6/13 mtools: Use proper glibc override to add glibc packages to recommendations

In reply to Khem Raj

Helps 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
index 24c9d49..bc9b79c 100644
@@ -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
author
#7 lore raw

PATCH 7/13 musl: Add recipe

In reply to Khem Raj

musl 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
new file mode 100644
index 0000000..c3fd5c8
@@ -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
author
#8 lore raw

PATCH 8/13 sysvinit: Fix build with musl

In reply to Khem Raj
---
 meta/recipes-core/sysvinit/sysvinit/realpath.patch | 78 ++++++++++++++++++++++
 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb     |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 meta/recipes-core/sysvinit/sysvinit/realpath.patch
meta/recipes-core/sysvinit/sysvinit/realpath.patch new file +78 -0
new file mode 100644
index 0000000..5e0dca3
@@ -0,0 +1,78 @@
+Fix build on musl use realpath() API its available on all libcs
+
+realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd
+However for Linux it should always work
+
+Upstream-Status: Inappropriate[Linux specific]
+
+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
index 5dfe39e..e4aa4c3 100644
@@ -14,6 +14,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.bz2 \
            file://crypt-lib.patch \
            file://pidof-add-m-option.patch \
            file://0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch \
+           file://realpath.patch \
            file://rcS-default \
            file://rc \
            file://rcS \
Signature · 1 line
2.6.3
author
#11 lore raw

PATCH 9/13 gettext: Delete libintl.h and charset.alias

In reply to Khem Raj

libintl.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
index f9f7a7f..cd0b759 100644
@@ -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
index cebf6c7..a9c919a 100644
@@ -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
author
#12 lore raw

PATCH 10/13 busybox: Add config for musl

In reply to Khem Raj

Default 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.24.1.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
new file mode 100644
index 0000000..4cb9a73
@@ -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
new file mode 100644
index 0000000..facfe85
@@ -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.24.1.bb +2 -0
index 7d2a7b2..7c9e5ea 100644
@@ -32,12 +32,14 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://busybox-cross-menuconfig.patch \
            file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
            file://0002-Passthrough-r-to-linker.patch \
+           file://0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch \
            file://mount-via-label.cfg \
            file://sha1sum.cfg \
            file://sha256sum.cfg \
            file://getopts.cfg \
            file://resize.cfg \
 "
+SRC_URI_append_libc-musl = " file://musl.cfg "
 
 SRC_URI[tarball.md5sum] = "be98a40cadf84ce2d6b05fa41a275c6a"
 SRC_URI[tarball.sha256sum] = "37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d"
Signature · 1 line
2.6.3
author
#14 lore raw

PATCH 11/13 openssl: Add musl configuration support

In reply to Khem Raj

use termios instead of termio

---
 meta/recipes-connectivity/openssl/openssl.inc      |  4 +++-
 .../openssl/openssl/configure-musl-target.patch    | 27 ++++++++++++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2d.bb |  1 +
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch
meta/recipes-connectivity/openssl/openssl.inc +3 -1
index 429fc5e..199e9ab 100644
@@ -18,10 +18,12 @@ S = "${WORKDIR}/openssl-${PV}"
 PACKAGECONFIG[perl] = ",,,"
 
 AR_append = " r"
+TERMIO_libc-musl = "-DTERMIOS"
+TERMIO ?= "-DTERMIO"
 # Avoid binaries being marked as requiring an executable stack since it 
 # doesn't(which causes and this causes issues with SELinux
 CFLAG = "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
-	-DTERMIO ${CFLAGS} -Wall -Wa,--noexecstack"
+	 ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
 
 # -02 does not work on mipsel: ssh hangs when it tries to read /dev/urandom
 CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}"
meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch new file +27 -0
new file mode 100644
index 0000000..613dc7b
@@ -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_1.0.2d.bb +1 -0
index 249f8c4..454d075 100644
@@ -37,6 +37,7 @@ SRC_URI += "file://find.pl;subdir=${BP}/util/ \
             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 \
            "
 
 SRC_URI[md5sum] = "38dd619b2e77cbac69b99f52a053d25a"
Signature · 1 line
2.6.3
author
#15 lore raw

PATCH 12/13 libpam: Fix build with musl

In reply to Khem Raj

Define 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
new file mode 100644
index 0000000..c55b648
@@ -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
index 0353356..7e81e72 100644
@@ -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
author
#16 lore raw

PATCH 13/13 attr: Add patch to account for use of internal glibc header

In reply to Khem Raj

based 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          | 56 ++++++++++++++++++++++
 2 files changed, 59 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
index ad40c9b..44eee39 100644
@@ -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 +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.6.3
#9 lore raw

Re: [PATCH 08/13] sysvinit: Fix build with musl

In reply to Khem Raj
Quoted 1 line · Khem Raj

+Upstream-Status: Inappropriate[Linux specific]

Quoted 1 line

Er, isn't sysvinit itself fairly Linux-specific?

p.

#10 lore raw

Re: [PATCH 08/13] sysvinit: Fix build with musl

Quoted 7 lines · Phil Blundell
Quoted 1 line · Khem Raj

+Upstream-Status: Inappropriate[Linux specific]

Quoted 1 line

Er, isn't sysvinit itself fairly Linux-specific?

Oh, never mind, I see the comment about Hurd now.

p.

author
#13 lore raw

Re: [PATCH 10/13] busybox: Add config for musl

In reply to Khem Raj
Quoted 6 lines · Khem Raj

Default config is enabling additional features that dont compile with musl so lets disable them for musl case and use posix compliant getpwent()

0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch is no longer needed after 1.24 upgrade so I have dropped it from pull request branch.

Quoted 127 lines

---

...user-use-POSIX-getpwent-instead-of-getpwe.patch | 71 ++++++++++++++++++++++
meta/recipes-core/busybox/busybox/musl.cfg         | 12 ++++
meta/recipes-core/busybox/busybox_1.24.1.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
new file mode 100644
index 0000000..4cb9a73
@@ -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
new file mode 100644
index 0000000..facfe85
@@ -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.24.1.bb +1 -0
index 7d2a7b2..7c9e5ea 100644
@@ -32,12 +32,14 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
           file://busybox-cross-menuconfig.patch \
           file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
           file://0002-Passthrough-r-to-linker.patch \
+           file://0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch \
           file://mount-via-label.cfg \
           file://sha1sum.cfg \
           file://sha256sum.cfg \
           file://getopts.cfg \
           file://resize.cfg \

"
+SRC_URI_append_libc-musl = " file://musl.cfg "

SRC_URI[tarball.md5sum] = "be98a40cadf84ce2d6b05fa41a275c6a" SRC_URI[tarball.sha256sum] = "37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d" --
2.6.3

author
#17 lore raw
In reply to Khem Raj
Quoted 7 lines · Khem Raj

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

Quoted 7 lines

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.

v2: Address review feedback

For some reason create-pull-request does not add the pull branch info here the branch is here on github

git://github.com/kraj/openembedded-core kraj/musl

web-ui

https://github.com/kraj/openembedded-core/commits/kraj/musl

Quoted 83 lines

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

meta/recipes-connectivity/openssl/openssl.inc      |   4 +-
.../openssl/openssl/configure-musl-target.patch    |  27 +++
.../recipes-connectivity/openssl/openssl_1.0.2d.bb |   1 +
...user-use-POSIX-getpwent-instead-of-getpwe.patch |  71 ++++++
meta/recipes-core/busybox/busybox/musl.cfg         |  12 +
meta/recipes-core/busybox/busybox_1.24.1.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/realpath.patch |  78 ++++++
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/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 ++
.../gcc/gcc-4.9/0070-libstdc-musl.patch            |  32 +++
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 |  54 +++++
.../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          |  56 +++++
38 files changed, 1815 insertions(+), 5 deletions(-)

create mode 100644 meta/recipes-connectivity/openssl/openssl/configure-musl-target.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/realpath.patch
create mode 100644 meta/recipes-devtools/autoconf/autoconf/add_musl_config.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-4.9/0070-libstdc-musl.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

--
2.6.3