From patchwork Sun Apr 29 19:35:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 134668 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp3037007lji; Sun, 29 Apr 2018 12:36:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoVaqcX2wIf5hF6jpnahNZQqeP54NTH830VE/OLmBcs8nMx7Bo3bEXlpRra6oTDc1Rm6I2M X-Received: by 10.98.135.133 with SMTP id i127mr9718658pfe.201.1525030579871; Sun, 29 Apr 2018 12:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525030579; cv=none; d=google.com; s=arc-20160816; b=zLI8xx0qoG14qaunIMZQfbOHj3YHd7GsWOXeZW58vwj857Zb8l8XEWCe1m7XtQNd+z Y4Usw6w2n1FK7D7tW5KZATXSjcZzMj6dBgiMkB6s3OPl1fRgDMD9Db8uSU77DEQwIvFf Lsxgq2TxNEG0WYidtSHTqIxwQMJ8bdeT536vSRNrTIxnHoa7rfElMYHCAvzXy6eDPdxt xLbw4KGujpA2+VFSF5ARDkFMvz2bgY39mTdi9lZW3nBUpXNuikH7k4UJJBdcPvWYt3No y8yWTdtrd+eOMSeKDWVoQrgLITFA4wSXXbujQ8/JdeIfYE1HUUyX7KVPjd/C8WGClo4a vnsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=vcrdoWkWEyC3HJhnN9PlfNXh2ri8g9AhbZYHDEejUxM=; b=n1Hmozk+1ilUK3YvFjH0LTPNIFOogEkG8+oGCUa8RR0pA2VRTjtV/sWkO6ac4TlNkS 8APUuzVoUKrgbF9YyeKLRw8EFhHx7rUA2pDHvag8IPj6ks1caAs+iQiMpQ54U0gZLQZ1 v7ebFEYtN4lKt+G2Uxu0iAeOLDWdlMSp3eLaaq/yvX6+XHqDKvih9VDi6qCufweLXHAk MKHt03gci11EHKoK0huPyz8PxSnljHWlfFTaW70LEggdk1sltV0P8ztMTH3sIZqynShG nsz8tlSLc4SV+8ZXDGdiUb8Z60N7GEbmANLQxN869AgXJ2UgY+64HJ8gnIRxmBxEtLxX nJNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=lJo8FjsN; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id u7-v6si5211642pgq.232.2018.04.29.12.36.19; Sun, 29 Apr 2018 12:36:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=lJo8FjsN; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 3177472EE1; Sun, 29 Apr 2018 19:36:17 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by mail.openembedded.org (Postfix) with ESMTP id 9546D6093D for ; Sun, 29 Apr 2018 19:36:15 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id i194-v6so4927687pgd.0 for ; Sun, 29 Apr 2018 12:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CSmGuycJctMbok3N6fIQBVZEhOYkYoO9i7FSJYXZxr4=; b=lJo8FjsNJpjwCA35BB8Ss1VKWiR2ipxjKtiQdjpZWVWMCs+/PahApph/G1wCLQA64D 3sOv1KQdYbtsPzQ3+IEd4WbItH1LFjPtlax5Y4ibrct3iXql8dECaosn6wiM5xbYClx7 3jsxTPJjDojYo0IHwr7EqddjC2PCdt3U+G13pF3WuN1bxYNd8demjg8eqHK5YTyjp/SE euocLyIchns/AV+e5QjHN1q3pQI5un/qB2Z8drhqoJ1Zka55pfr+ljmm9U39lC6gV9kl PR1ERos7uKH8UKBg5h+fONjovt4DzRsSBlLSo0+Cw0LzPcJ1o7xwvUmev41x86eFZLvf xAzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CSmGuycJctMbok3N6fIQBVZEhOYkYoO9i7FSJYXZxr4=; b=KaPAQkXQqvNkstIoenG6uuD71UlcPCMbSvmP92KpW8FhblC5bniAYbH4yU4RKi8iRq 0g8Ad6ZmAIG3xBVX7YMfR1PZOWknVjflhjk7ykCDrJIokezBfGOS67UuFgAwCmchkbvL +8Y0CJS1hOyQwCyBbA2I4AOQaP3dr1jTJQa7cymxwqNZzR3poBNY6Fq1LCOV6qoJp+SV Ud4f4m5P8VgRwQwjRH27S8A+C74Ruw660ZHzrBBgxyg3CjPlPyzqAEqTF0YEXq5fvuxh a99nD0MxI/5Kmp+VCFtzJr/EEi9JJlC/L9oNJaFd36eO7766rSdONdHC90YixZTJBdJA OqLw== X-Gm-Message-State: ALQs6tB+2dXnAAvc2Z5KiBrikYM/eb37xnUiNShIPeSuFizoWYuBDMi0 UrAN0YQauX6dCEEcfXSwKlg5Yw== X-Received: by 10.98.56.144 with SMTP id f138mr9619911pfa.173.1525030576226; Sun, 29 Apr 2018 12:36:16 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8880:466c::ddd5]) by smtp.gmail.com with ESMTPSA id 125sm11960737pfc.145.2018.04.29.12.36.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Apr 2018 12:36:15 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sun, 29 Apr 2018 12:35:48 -0700 Message-Id: <3b8f5c652ccde28998678f42575bb9c04c334950.1525029885.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: Subject: [OE-core] [PATCH 01/24] libssp-nonshared: Add recipe X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org libssp-nonshared is a minimal gcc runtime piece which is needed on non-glibc systems which do implement libssp APIs in libc Signed-off-by: Khem Raj --- meta/recipes-core/musl/libssp-nonshared.bb | 39 ++++++++++++++++ .../musl/libssp-nonshared/ssp-local.c | 45 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c -- 2.17.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb new file mode 100644 index 0000000000..00a0a3d411 --- /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} -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/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c new file mode 100644 index 0000000000..8f51afa2c1 --- /dev/null +++ b/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 +. */ + +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 (); +}