diff options
Diffstat (limited to 'meta/recipes-core/musl')
-rw-r--r-- | meta/recipes-core/musl/bsd-headers.bb | 4 | ||||
-rw-r--r-- | meta/recipes-core/musl/gcompat/0001-make-Static-PIE-does-not-work-on-musl-ppc.patch | 30 | ||||
-rw-r--r-- | meta/recipes-core/musl/gcompat_git.bb | 57 | ||||
-rw-r--r-- | meta/recipes-core/musl/libssp-nonshared.bb | 17 | ||||
-rw-r--r-- | meta/recipes-core/musl/libssp-nonshared/ssp-local.c | 45 | ||||
-rw-r--r-- | meta/recipes-core/musl/libssp-nonshared/stack_chk.c | 40 | ||||
-rw-r--r-- | meta/recipes-core/musl/libucontext_1.2.bb | 52 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl-obstack.bb | 4 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl-utils.bb | 6 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl.inc | 14 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch | 11 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch | 17 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl_git.bb | 51 |
13 files changed, 234 insertions, 114 deletions
diff --git a/meta/recipes-core/musl/bsd-headers.bb b/meta/recipes-core/musl/bsd-headers.bb index c9945d45eb..cf8af0da3c 100644 --- a/meta/recipes-core/musl/bsd-headers.bb +++ b/meta/recipes-core/musl/bsd-headers.bb @@ -27,5 +27,5 @@ do_install() { # COMPATIBLE_HOST = ".*-musl.*" -RDEPENDS_${PN}-dev = "" -RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" +RDEPENDS:${PN}-dev = "" +RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" diff --git a/meta/recipes-core/musl/gcompat/0001-make-Static-PIE-does-not-work-on-musl-ppc.patch b/meta/recipes-core/musl/gcompat/0001-make-Static-PIE-does-not-work-on-musl-ppc.patch new file mode 100644 index 0000000000..1d731163d0 --- /dev/null +++ b/meta/recipes-core/musl/gcompat/0001-make-Static-PIE-does-not-work-on-musl-ppc.patch @@ -0,0 +1,30 @@ +From 01180e78fe9568e7fb2673ba61801c42f0f70115 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 11 Mar 2022 10:37:51 -0800 +Subject: [PATCH] make: Static PIE does not work on musl/ppc + +Fixes linker error e.g. +"read-only segment has dynamic relocations" + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index cbb7634..69ee228 100644 +--- a/Makefile ++++ b/Makefile +@@ -76,7 +76,7 @@ ${LIBGCOMPAT_NAME}: ${LIBGCOMPAT_OBJ} + ${LIBGCOMPAT_OBJ}: ${LIBGCOMPAT_INCLUDE} + + ${LOADER_NAME}: ${LOADER_OBJ} +- ${CC} ${CFLAGS} ${LDFLAGS} -static-pie -o ${LOADER_NAME} ${LOADER_OBJ} ++ ${CC} ${CFLAGS} ${LDFLAGS} -static -o ${LOADER_NAME} ${LOADER_OBJ} + + .c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c -D_BSD_SOURCE \ +-- +2.35.1 + diff --git a/meta/recipes-core/musl/gcompat_git.bb b/meta/recipes-core/musl/gcompat_git.bb new file mode 100644 index 0000000000..962bcd8c75 --- /dev/null +++ b/meta/recipes-core/musl/gcompat_git.bb @@ -0,0 +1,57 @@ +# Copyright (C) 2021 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "A library which provides glibc-compatible APIs for use on musl libc systems" +HOMEPAGE = "https://git.adelielinux.org/adelie/gcompat" + +LICENSE = "NCSA" +LIC_FILES_CHKSUM = "file://LICENSE;md5=eb33ef4af05a9c7602843afb7adfe792" + +SRC_URI = "git://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current \ + " +SRC_URI:append:powerpc = "\ + file://0001-make-Static-PIE-does-not-work-on-musl-ppc.patch \ + " +PV = "1.0.0+1.1+git${SRCPV}" +SRCREV = "4d6a5156a6eb7f56b30d93853a872e36dadde81b" + +S = "${WORKDIR}/git" + +inherit pkgconfig linuxloader siteinfo + +DEPENDS += "musl-obstack" + +GLIBC_LDSO = "${@get_glibc_loader(d)}" +MUSL_LDSO = "${@get_musl_loader(d)}" + +EXTRA_OEMAKE = "LINKER_PATH=${MUSL_LDSO} \ + LOADER_NAME=`basename ${GLIBC_LDSO}` \ + " + +do_configure () { + : +} + +do_compile () { + oe_runmake +} + +do_install () { + oe_runmake install 'DESTDIR=${D}' + if [ "${SITEINFO_BITS}" = "64" ]; then + install -d ${D}/lib64 + ln -rs ${D}${GLIBC_LDSO} ${D}/lib64/`basename ${GLIBC_LDSO}` + fi +} + +FILES:${PN} += "/lib64" + +INSANE_SKIP:${PN} = "libdir" + +RPROVIDES:${PN} += "musl-glibc-compat" +# +# We will skip parsing for non-musl systems +# +COMPATIBLE_HOST = ".*-musl.*" + +UPSTREAM_CHECK_COMMITS = "1" diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb index bae8c81cc7..748dacf312 100644 --- a/meta/recipes-core/musl/libssp-nonshared.bb +++ b/meta/recipes-core/musl/libssp-nonshared.bb @@ -2,11 +2,12 @@ # Released under the MIT license (see COPYING.MIT for the terms) SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl" -LICENSE = "GPL-3.0-with-GCC-exception" -LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://stack_chk.c;beginline=1;endline=30;md5=97e59d9deee678a9332c9ddb2ab6360d" SECTION = "libs" -SRC_URI = "file://ssp-local.c" +# Sourced from https://github.com/intel/linux-sgx/blob/master/sdk/compiler-rt/stack_chk.c +SRC_URI = "file://stack_chk.c" INHIBIT_DEFAULT_DEPS = "1" @@ -19,8 +20,8 @@ do_configure[noexec] = "1" S = "${WORKDIR}" do_compile() { - ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c ssp-local.c -o ssp-local.o - ${AR} r libssp_nonshared.a ssp-local.o + ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c stack_chk.c -o stack_chk.o + ${AR} r libssp_nonshared.a stack_chk.o } do_install() { install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a @@ -29,6 +30,6 @@ do_install() { # We will skip parsing for non-musl systems # COMPATIBLE_HOST = ".*-musl.*" -RDEPENDS_${PN}-staticdev = "" -RDEPENDS_${PN}-dev = "" -RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})" +RDEPENDS:${PN}-staticdev = "" +RDEPENDS:${PN}-dev = "" +RRECOMMENDS:${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})" diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c deleted file mode 100644 index 8f51afa2c1..0000000000 --- a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Stack protector support. - Copyright (C) 2005-2018 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -In addition to the permissions in the GNU General Public License, the -Free Software Foundation gives you unlimited permission to link the -compiled version of this file into combinations with other programs, -and to distribute those combinations without any restriction coming -from the use of this file. (The General Public License restrictions -do apply in other respects; for example, they cover modification of -the file, and distribution when not linked into a combine -executable.) - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -Under Section 7 of GPL version 3, you are granted additional -permissions described in the GCC Runtime Library Exception, version -3.1, as published by the Free Software Foundation. - -You should have received a copy of the GNU General Public License and -a copy of the GCC Runtime Library Exception along with this program; -see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -<http://www.gnu.org/licenses/>. */ - -extern void __stack_chk_fail (void); - -/* Some targets can avoid loading a GP for calls to hidden functions. - Using this entry point may avoid the load of a GP entirely for the - function, making the overall code smaller. */ - -void -__attribute__((visibility ("hidden"))) -__stack_chk_fail_local (void) -{ - __stack_chk_fail (); -} diff --git a/meta/recipes-core/musl/libssp-nonshared/stack_chk.c b/meta/recipes-core/musl/libssp-nonshared/stack_chk.c new file mode 100644 index 0000000000..097aae24b6 --- /dev/null +++ b/meta/recipes-core/musl/libssp-nonshared/stack_chk.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +extern void __attribute__((noreturn)) __stack_chk_fail(void); + +void +__attribute__((noreturn)) +__attribute__((visibility ("hidden"))) +__stack_chk_fail_local (void) +{ + __stack_chk_fail (); +} diff --git a/meta/recipes-core/musl/libucontext_1.2.bb b/meta/recipes-core/musl/libucontext_1.2.bb new file mode 100644 index 0000000000..4e34df1439 --- /dev/null +++ b/meta/recipes-core/musl/libucontext_1.2.bb @@ -0,0 +1,52 @@ +# Copyright (C) 2019 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "ucontext implementation featuring glibc-compatible ABI" +HOMEPAGE = "https://github.com/kaniini/libucontext" +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ebea527af0602d509b7f4c49533fb1bd" +SECTION = "libs" +DEPENDS = "" + +SRCREV = "4dde3417b4bb4b1b1545bd913be337680b5e28c3" +SRC_URI = "git://github.com/kaniini/libucontext;branch=master;protocol=https \ + " + +S = "${WORKDIR}/git" + +COMPATIBLE_HOST = ".*-musl.*" + +valid_archs = " \ + x86 x86_64 \ + ppc ppc64 \ + mips mips64 \ + arm aarch64 \ + s390x \ +" + +def map_kernel_arch(a, d): + import re + + valid_archs = d.getVar('valid_archs').split() + + if a in valid_archs: return a + elif re.match('(i.86|athlon)$', a): return 'x86' + elif re.match('x86.64$', a): return 'x86_64' + elif re.match('armeb$', a): return 'arm' + elif re.match('aarch64$', a): return 'aarch64' + elif re.match('aarch64_be$', a): return 'aarch64' + elif re.match('aarch64_ilp32$', a): return 'aarch64' + elif re.match('aarch64_be_ilp32$', a): return 'aarch64' + elif re.match('mips(isa|)(32|)(r6|)(el|)$', a): return 'mips' + elif re.match('mips(isa|)64(r6|)(el|)$', a): return 'mips64' + elif re.match('p(pc64|owerpc64)(le)', a): return 'ppc64' + elif re.match('p(pc|owerpc)', a): return 'ppc' + elif re.match('riscv64$', a): return 'riscv64' + elif re.match('riscv32$', a): return 'riscv32' + else: + if not d.getVar("TARGET_OS").startswith("linux"): + return a + bb.error("cannot map '%s' to a linux kernel architecture" % a) + +EXTRA_OEMESON = "-Dcpu=${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}" +inherit meson diff --git a/meta/recipes-core/musl/musl-obstack.bb b/meta/recipes-core/musl/musl-obstack.bb index 3003935fe5..4df24c013b 100644 --- a/meta/recipes-core/musl/musl-obstack.bb +++ b/meta/recipes-core/musl/musl-obstack.bb @@ -4,13 +4,13 @@ SUMMARY = "A standalone library to implement GNU libc's obstack" DESCRIPTION = "copy + paste of the obstack functions and macros found in GNU gcc libiberty library for use with musl libc" HOMEPAGE = "https://github.com/pullmoll/musl-obstack" -LICENSE = "GPL-2.0+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=3d23e4eef8243efcaab6f0a438078932" SECTION = "libs" PV = "1.1" SRCREV = "d2ad66b0df44a4b784956f7f7f2717131ddc05f4" -SRC_URI = "git://github.com/pullmoll/musl-obstack" +SRC_URI = "git://github.com/pullmoll/musl-obstack;branch=master;protocol=https" UPSTREAM_CHECK_COMMITS = "1" diff --git a/meta/recipes-core/musl/musl-utils.bb b/meta/recipes-core/musl/musl-utils.bb index dd0ce33061..c42dff3a53 100644 --- a/meta/recipes-core/musl/musl-utils.bb +++ b/meta/recipes-core/musl/musl-utils.bb @@ -3,7 +3,7 @@ DESCRIPTION = "getconf, getent and iconv implementations for musl" HOMEPAGE = "https://git.alpinelinux.org/cgit/aports/tree/main/musl" -LICENSE = "BSD-2-Clause & GPL-2.0+" +LICENSE = "BSD-2-Clause & GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://LICENSE;md5=9d08215e611db87b357e8674b4b42564" SECTION = "utils" @@ -11,7 +11,7 @@ SECTION = "utils" PV = "20170421" SRCREV = "fb5630138ccabbbc14a19d372096a04e42573c7d" -SRC_URI = "git://github.com/boltlinux/musl-utils" +SRC_URI = "git://github.com/boltlinux/musl-utils;branch=master;protocol=https" UPSTREAM_CHECK_COMMITS = "1" @@ -21,7 +21,7 @@ S = "${WORKDIR}/git" PACKAGES =+ "${PN}-iconv" -FILES_${PN}-iconv = "${bindir}/iconv" +FILES:${PN}-iconv = "${bindir}/iconv" COMPATIBLE_HOST = ".*-musl.*" diff --git a/meta/recipes-core/musl/musl.inc b/meta/recipes-core/musl/musl.inc index 0683bf85ed..66468e92ff 100644 --- a/meta/recipes-core/musl/musl.inc +++ b/meta/recipes-core/musl/musl.inc @@ -9,19 +9,23 @@ standards-conformance and safety." HOMEPAGE = "http://www.musl-libc.org/" LICENSE = "MIT" SECTION = "libs" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=d0fe2be17bc45ff4a42ade1c13ed6340" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b03f1cc25363d094011f8f4fd8bcfb68" INHIBIT_DEFAULT_DEPS = "1" FILES_SOLIBSDEV = "" -FILES_${PN} += "${libdir}/lib*${SOLIBSDEV}" -INSANE_SKIP_${PN} = "dev-so" +FILES:${PN} += "${libdir}/lib*${SOLIBSDEV}" +INSANE_SKIP:${PN} = "dev-so" # Doesn't compile in MIPS16e mode due to use of hand-written # assembly MIPS_INSTRUCTION_SET = "mips" # thumb1 is unsupported -ARM_INSTRUCTION_SET_armv5 = "arm" -ARM_INSTRUCTION_SET_armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +ARM_INSTRUCTION_SET:armv4 = "arm" +# Enable out of tree build +B = "${WORKDIR}/build" + +do_configure[cleandirs] = "${B}" diff --git a/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch index 462d338b96..ba00efe7b3 100644 --- a/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch +++ b/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch @@ -22,11 +22,9 @@ Upstream-Status: Pending tools/install.sh | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) -diff --git a/Makefile b/Makefile -index 8246b78..d1dbe39 100644 --- a/Makefile +++ b/Makefile -@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/% +@@ -210,7 +210,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc $(INSTALL) -D -m 644 $< $@ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so @@ -35,8 +33,6 @@ index 8246b78..d1dbe39 100644 install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) -diff --git a/tools/install.sh b/tools/install.sh -index d913b60..b6a7f79 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -6,18 +6,20 @@ @@ -62,7 +58,7 @@ index d913b60..b6a7f79 100755 m) mode=$OPTARG ;; ?) usage ;; esac -@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP +@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM H umask 077 if test "$symlink" ; then @@ -71,6 +67,3 @@ index d913b60..b6a7f79 100755 else cat < "$1" > "$tmp" chmod "$mode" "$tmp" --- -2.7.4 - diff --git a/meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch b/meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch index 6a875a717e..0aeb5eb5c2 100644 --- a/meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch +++ b/meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch @@ -20,11 +20,9 @@ Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com> ldso/dynlink.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) -diff --git a/Makefile b/Makefile -index b46f8ca4..c07e4ae8 100644 --- a/Makefile +++ b/Makefile -@@ -46,7 +46,8 @@ CFLAGS_AUTO = -Os -pipe +@@ -47,7 +47,8 @@ CFLAGS_AUTO = -Os -pipe CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc CFLAGS_ALL = $(CFLAGS_C99FSE) @@ -34,20 +32,18 @@ index b46f8ca4..c07e4ae8 100644 CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) -diff --git a/ldso/dynlink.c b/ldso/dynlink.c -index ec921dfd..7c119c55 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c -@@ -22,6 +22,8 @@ - #include "dynlink.h" - #include "malloc_impl.h" +@@ -29,6 +29,8 @@ + #define realloc __libc_realloc + #define free __libc_free +#define SYS_PATH_DFLT SYSLIBDIR ":" LIBDIR + static void error(const char *, ...); #define MAXP2(a,b) (-(-(a)&-(b))) -@@ -1038,7 +1040,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by) +@@ -1094,7 +1096,7 @@ static struct dso *load_library(const ch sys_path = ""; } } @@ -56,6 +52,3 @@ index ec921dfd..7c119c55 100644 fd = path_open(name, sys_path, buf, sizeof buf); } pathname = buf; --- -2.7.4 - diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb index 9341bf5d58..04752f40c4 100644 --- a/meta/recipes-core/musl/musl_git.bb +++ b/meta/recipes-core/musl/musl_git.bb @@ -4,15 +4,15 @@ require musl.inc inherit linuxloader -SRCREV = "6ad514e4e278f0c3b18eb2db1d45638c9af1c07f" +SRCREV = "f8bdc3048216f41eaaf655524fa286cfb1184a70" -BASEVER = "1.1.23" +BASEVER = "1.2.2" PV = "${BASEVER}+git${SRCPV}" # mirror is at git://github.com/kraj/musl.git -SRC_URI = "git://git.musl-libc.org/musl \ +SRC_URI = "git://git.musl-libc.org/musl;branch=master \ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ " @@ -29,6 +29,7 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \ libssp-nonshared \ " GLIBC_LDSO = "${@get_glibc_loader(d)}" +MUSL_LDSO_ARCH = "${@get_musl_loader_arch(d)}" export CROSS_COMPILE="${TARGET_PREFIX}" @@ -40,7 +41,7 @@ LDFLAGS += "-Wl,-soname,libc.so" # 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)}" +CFLAGS:append:arm = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" CONFIGUREOPTS = " \ --prefix=${prefix} \ @@ -48,7 +49,7 @@ CONFIGUREOPTS = " \ --bindir=${bindir} \ --libdir=${libdir} \ --includedir=${includedir} \ - --syslibdir=${base_libdir} \ + --syslibdir=/lib \ " do_configure() { @@ -61,32 +62,26 @@ do_compile() { do_install() { oe_runmake install DESTDIR='${D}' - - install -d ${D}${bindir} + install -d ${D}${bindir} ${D}/lib ${D}${sysconfdir} + echo "${base_libdir}" > ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path + echo "${libdir}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO} - lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd - lnr ${D}${libdir}/libc.so ${D}${GLIBC_LDSO} - for l in crypt dl m pthread resolv rt util xnet - do - ln -sf libc.so ${D}${libdir}/lib$l.so - done - for i in libc.so.6 libcrypt.so.1 libdl.so.2 libm.so.6 libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1; do - ln -sf libc.so ${D}${libdir}/$i - done + ln -rs ${D}${libdir}/libc.so ${D}${bindir}/ldd } -PACKAGES =+ "${PN}-glibc-compat" - -FILES_${PN}-glibc-compat += "\ - ${libdir}/libc.so.6 ${libdir}/libcrypt.so.1 \ - ${libdir}/libdl.so.2 ${libdir}/libm.so.6 \ - ${libdir}/libpthread.so.0 ${libdir}/libresolv.so.2 \ - ${libdir}/librt.so.1 ${libdir}/libutil.so.1 \ - ${GLIBC_LDSO} \ - " +FILES:${PN} += "/lib/ld-musl-${MUSL_LDSO_ARCH}.so.1 ${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path" +FILES:${PN}-staticdev = "${libdir}/libc.a" +FILES:${PN}-dev =+ "${libdir}/libcrypt.a ${libdir}/libdl.a ${libdir}/libm.a \ + ${libdir}/libpthread.a ${libdir}/libresolv.a \ + ${libdir}/librt.a ${libdir}/libutil.a ${libdir}/libxnet.a \ + " -RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev" -RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev" -RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)" +RDEPENDS:${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev" +RPROVIDES:${PN}-dev += "libc-dev virtual-libc-dev" +RPROVIDES:${PN} += "ldd rtld(GNU_HASH)" LEAD_SONAME = "libc.so" +INSANE_SKIP:${PN}-dev = "staticdev" +INSANE_SKIP:${PN} = "libdir" + +UPSTREAM_CHECK_COMMITS = "1" |