From be600d88c7d98cda9000265b356baee8a4a92541 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Apr 2018 22:35:49 -0700 Subject: libssp-nonshared: Add recipe libssp-nonshared is a minimal gcc runtime piece which is needed on non-glibc systems which do implement libssp APIs in libc Use PIE flags to compile libssp_nonshared.a so it works with security flags on as well (From OE-Core rev: ddfab4d021d4daa5aefcd9cdd89d349bbd4b6869) Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- meta/recipes-core/musl/libssp-nonshared.bb | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb (limited to 'meta/recipes-core/musl/libssp-nonshared.bb') diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb new file mode 100644 index 0000000000..458eafef52 --- /dev/null +++ b/meta/recipes-core/musl/libssp-nonshared.bb @@ -0,0 +1,39 @@ +# Copyright (C) 2018 Khem Raj +# 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})" -- cgit v1.2.3-54-g00ecf