summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-core/musl/musl_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-core/musl/musl_git.bb')
-rw-r--r--poky/meta/recipes-core/musl/musl_git.bb72
1 files changed, 72 insertions, 0 deletions
diff --git a/poky/meta/recipes-core/musl/musl_git.bb b/poky/meta/recipes-core/musl/musl_git.bb
new file mode 100644
index 0000000000..9f8c5126e8
--- /dev/null
+++ b/poky/meta/recipes-core/musl/musl_git.bb
@@ -0,0 +1,72 @@
+# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require musl.inc
+
+SRCREV = "55df09bfccbfe21fc9dd7d8f94550c0ff25ace04"
+
+PV = "1.1.19+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 virtual/crypt"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}gcc-initial \
+ libgcc-initial \
+ linux-libc-headers \
+ bsd-headers \
+ "
+
+export CROSS_COMPILE="${TARGET_PREFIX}"
+
+LDFLAGS += "-Wl,-soname,libc.so"
+
+# When compiling for Thumb or Thumb2, frame pointers _must_ be disabled since the
+# Thumb frame pointer in r7 clashes with musl's use of inline asm to make syscalls
+# (where r7 is used for the syscall NR). In most cases, frame pointers will be
+# disabled automatically due to the optimisation level, but append an explicit
+# -fomit-frame-pointer to handle cases where optimisation is set to -O0 or frame
+# pointers have been enabled by -fno-omit-frame-pointer earlier in CFLAGS, etc.
+CFLAGS_append_arm = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
+
+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}
+ rm -f ${D}${bindir}/ldd
+ lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
+ for l in crypt dl m pthread resolv rt util xnet
+ do
+ ln -sf libc.so ${D}${libdir}/lib$l.so
+ done
+}
+
+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"