summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/musl/libssp-nonshared.bb
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-04-13 22:35:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-05-09 10:39:33 +0100
commitddfab4d021d4daa5aefcd9cdd89d349bbd4b6869 (patch)
treeae21646c5ae739784804201458ba0648116ea893 /meta/recipes-core/musl/libssp-nonshared.bb
parent26a93d2bf7504bf5f3adb085ed2882ae1b1a3701 (diff)
downloadopenembedded-core-contrib-ddfab4d021d4daa5aefcd9cdd89d349bbd4b6869.tar.gz
openembedded-core-contrib-ddfab4d021d4daa5aefcd9cdd89d349bbd4b6869.tar.bz2
openembedded-core-contrib-ddfab4d021d4daa5aefcd9cdd89d349bbd4b6869.zip
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 Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-core/musl/libssp-nonshared.bb')
-rw-r--r--meta/recipes-core/musl/libssp-nonshared.bb39
1 files changed, 39 insertions, 0 deletions
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 <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})"