citadel/poky/meta/recipes-core/musl/musl_git.bb

72 lines
2.0 KiB
BlitzBasic
Raw Normal View History

# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
require musl.inc
SRCREV = "eb03bde2f24582874cb72b56c7811bf51da0c817"
PV = "1.1.18+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}"
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}
lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
for l in crypt dl m pthread resolv rt util xnet
do
ln -s 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"