diff options
Diffstat (limited to 'poky/meta/recipes-core/musl')
-rw-r--r-- | poky/meta/recipes-core/musl/libssp-nonshared.bb | 39 | ||||
-rw-r--r-- | poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c | 45 | ||||
-rw-r--r-- | poky/meta/recipes-core/musl/musl-utils.bb | 2 | ||||
-rw-r--r-- | poky/meta/recipes-core/musl/musl.inc | 2 | ||||
-rw-r--r-- | poky/meta/recipes-core/musl/musl_git.bb | 23 |
5 files changed, 107 insertions, 4 deletions
diff --git a/poky/meta/recipes-core/musl/libssp-nonshared.bb b/poky/meta/recipes-core/musl/libssp-nonshared.bb new file mode 100644 index 000000000..458eafef5 --- /dev/null +++ b/poky/meta/recipes-core/musl/libssp-nonshared.bb @@ -0,0 +1,39 @@ +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com> +# 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" +SECTION = "libs" + +SRC_URI = "file://ssp-local.c" + +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" + +INHIBIT_DEFAULT_DEPS = "1" + +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" + +DEPENDS = "virtual/${TARGET_PREFIX}binutils \ + virtual/${TARGET_PREFIX}gcc-initial \ +" + +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 +} +do_install() { + install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a +} +# +# We will skip parsing for non-musl systems +# +COMPATIBLE_HOST = ".*-musl.*" +RDEPENDS_${PN}-staticdev = "" +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})" diff --git a/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c new file mode 100644 index 000000000..8f51afa2c --- /dev/null +++ b/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c @@ -0,0 +1,45 @@ +/* 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/poky/meta/recipes-core/musl/musl-utils.bb b/poky/meta/recipes-core/musl/musl-utils.bb index 74b846df5..dd0ce3306 100644 --- a/poky/meta/recipes-core/musl/musl-utils.bb +++ b/poky/meta/recipes-core/musl/musl-utils.bb @@ -13,6 +13,8 @@ PV = "20170421" SRCREV = "fb5630138ccabbbc14a19d372096a04e42573c7d" SRC_URI = "git://github.com/boltlinux/musl-utils" +UPSTREAM_CHECK_COMMITS = "1" + inherit autotools S = "${WORKDIR}/git" diff --git a/poky/meta/recipes-core/musl/musl.inc b/poky/meta/recipes-core/musl/musl.inc index ba9b1a046..319709b3c 100644 --- a/poky/meta/recipes-core/musl/musl.inc +++ b/poky/meta/recipes-core/musl/musl.inc @@ -9,7 +9,7 @@ standards-conformance and safety." HOMEPAGE = "http://www.musl-libc.org/" LICENSE = "MIT" SECTION = "libs" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=2b9032093c4765e49ae85ddeba29afff" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8a4bb28f771c817fe57d3a7c4240e3aa" PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" diff --git a/poky/meta/recipes-core/musl/musl_git.bb b/poky/meta/recipes-core/musl/musl_git.bb index 9f8c5126e..0d8f8eb2a 100644 --- a/poky/meta/recipes-core/musl/musl_git.bb +++ b/poky/meta/recipes-core/musl/musl_git.bb @@ -2,10 +2,11 @@ # Released under the MIT license (see COPYING.MIT for the terms) require musl.inc +inherit linuxloader -SRCREV = "55df09bfccbfe21fc9dd7d8f94550c0ff25ace04" +SRCREV = "c50985d5c8e316c5c464f352e79eeebfed1121a9" -PV = "1.1.19+git${SRCPV}" +PV = "1.1.20+git${SRCPV}" # mirror is at git://github.com/kraj/musl.git @@ -22,7 +23,9 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \ libgcc-initial \ linux-libc-headers \ bsd-headers \ + libssp-nonshared \ " +GLIBC_LDSO = "${@get_glibc_loader(d)}" export CROSS_COMPILE="${TARGET_PREFIX}" @@ -59,13 +62,27 @@ do_install() { install -d ${D}${bindir} rm -f ${D}${bindir}/ldd 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 } -RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev" +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} \ + " + +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)" |