diff options
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-core/musl')
3 files changed, 121 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch new file mode 100644 index 000000000..5490b1cba --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch @@ -0,0 +1,34 @@ +From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 10 Jan 2016 12:14:02 -0800 +Subject: [PATCH] Make dynamic linker a relative symlink to libc + +absolute symlink into $(libdir) fails to load in a cross build +environment, especially when executing qemu in usermode to run target +applications, which cross build systems often do, since not everything +can be computed during cross builds, qemu in usermode often comes to aid +in such situations to feed into cross builds. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index b2226fa..0d71f7f 100644 +--- a/Makefile ++++ b/Makefile +@@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/% + $(INSTALL) -D -m 644 $< $@ + + $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so +- $(INSTALL) -D -l $(libdir)/libc.so $@ || true ++ $(INSTALL) -D -l ..$(libdir)/libc.so $@ || true + + install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) + +-- +2.7.0 + diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc b/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc new file mode 100644 index 000000000..d27867f75 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc @@ -0,0 +1,26 @@ +# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com> +# 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=082411391b4d1ace0d30f4c84317cc05" + +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" + diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb b/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb new file mode 100644 index 000000000..d4f98191f --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb @@ -0,0 +1,61 @@ +# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +require musl.inc + +SRCREV = "5978eb703ce0e64dd778a88c1ffffb76fe5e2202" + +PV = "1.1.14+git${SRCPV}" + +# mirror is at git://github.com/kraj/musl.git + +SRC_URI = "git://git.musl-libc.org/musl \ + file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ + " + +S = "${WORKDIR}/git" + +PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv virtual/libintl" + +DEPENDS = "virtual/${TARGET_PREFIX}binutils \ + virtual/${TARGET_PREFIX}gcc-initial \ + libgcc-initial \ + linux-libc-headers \ + bsd-headers \ + " + +export CROSS_COMPILE="${TARGET_PREFIX}" + +EXTRA_OEMAKE = "" + +LDFLAGS += "-Wl,-soname,libc.so" + +CONFIGUREOPTS = " \ + --prefix=${prefix} \ + --exec-prefix=${exec_prefix} \ + --bindir=${bindir} \ + --libdir=${libdir} \ + --includedir=${includedir} \ + --syslibdir=${base_libdir} \ +" + +do_configure() { + ${S}/configure ${CONFIGUREOPTS} +} + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake install DESTDIR='${D}' + + install -d ${D}${bindir} + ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd +} + +RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev" +RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev" +RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)" + +LEAD_SONAME = "libc.so" |