From patchwork Sun Mar 11 00:43:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 131330 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2624158lja; Sat, 10 Mar 2018 16:46:11 -0800 (PST) X-Google-Smtp-Source: AG47ELsTT3DRCDJedhtJpyQDkzKlRsylJuq1hZwnuh5UZTWAjI8z49MypoYPBNsA0/70a2K+Pj3a X-Received: by 10.99.157.142 with SMTP id i136mr2877524pgd.14.1520729171128; Sat, 10 Mar 2018 16:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520729171; cv=none; d=google.com; s=arc-20160816; b=QzKZg7/koAlfyAWZ5HOcpNVQnRCWnZsNYvdKkA6uJ7xp/ncBachcM7sysB4Ie7c57u QDMCPjLMVp0GSKy4quKPoP6p6kh+CuvJuLhxt4o5eoV6+Ah5PQsDn72LB7Uj/9445Pvw sJERFQQmWVaeIGi8a1iQ2gRT6SH8WsoWupg8wxOODwlLLUPoatmYGAMbk8KCqTCs6RnY +eX00Sjm/k5K2KqnFar7MRxQzlLbbJ95453VJXBKhhAm1Mu2UCx6/GkaC5Ap9t+rdXkL AWsSEwuIIT486Tg3Y0W6xIvFN8bMl2b2xMLJ1wY/R/lAwO+tvMnVc2xRNwy7K+NnyVlE lfww== 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=Zsbbb2l+nNL9uvXDtRTGaxDoWDyvOk5f77ukKT+YXoQ=; b=Ocee0UN7DJ5VNEFCaWOm/GO0RDxwSp3N+n7Nz1g48X/2R/wbPqtXUsV1iONsUhC43C uv2loP4uZjlk1LrB2l25OaQqPonpAr2BRwr290e+46w2E3mj9tc1ky2DNDIkFujJZ89q vCCvEGQvZVR3PUjGVLJdI/L02LvhsSxeZLNcXF2eALQG7gIhTzR7ottsySBZjToIzK2F /wmqv7wwYNhp6zs+fok+O6AdJka28tYIfSEvP7oHBeJ1UE5UsL76GJ/HIPtU/CPS7viv Ubstenm2qVoOLWs6vRSjUTD2ugvbKUBkbE/NbPYCphClds4mt4K6Gjnyqz1EO79nr8fq 6BjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=bY7RCRvv; 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 c11-v6si3448502pls.723.2018.03.10.16.46.10; Sat, 10 Mar 2018 16:46:11 -0800 (PST) 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=bY7RCRvv; 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 EBB8478986; Sun, 11 Mar 2018 00:43:25 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by mail.openembedded.org (Postfix) with ESMTP id 17B6478989 for ; Sun, 11 Mar 2018 00:43:22 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id r66so4711913wrb.6 for ; Sat, 10 Mar 2018 16:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=H1hYZ+f9bWqN2yxiSUbhXgKM48fI15FL5ieBxRF7sdc=; b=bY7RCRvvUDg8NIFuGvazPQKwUdzrxzN2rppRDCiMwOPCX/F9KgPRK5iBhj2Keit5lP VLN1fPwtwvxH9UegyxTcpzFmR0+zik480QPJrYRd1/MgZpZcqudDoKABvv+23JzWw+ke Y/nHsiUOeGrP6lMB7I2GOy0woN3pSU3ACfzengrjgNBQ20vgrCY4n1gIT5Zn7cbaY2hk gMi5+Wk5c2oOWZ6pEKycZGfq0qRYpmTQxU1JgfkJ0K3Yj5bUYkoubGPgS9kihUTUCfd4 NHcVI48eFh0CxTYQ7OKzuHL4kPR57L8K/lEtvBcL1zdgJdpaO3zV91QVC8T/foMsybXH ORdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=H1hYZ+f9bWqN2yxiSUbhXgKM48fI15FL5ieBxRF7sdc=; b=Nn9ewEZBAImglFRTjTN3dGavGBWWnBNA/20FGa5PiRYK/vqM+bY+CAmikI9uidDgMt atsDbNOMF/UK55HW8EIkoADNXmlOrh70ivrTOj3FNwifW4GqRZiiWKUAAN+O0sWVnvUL qmZfDmoVNorRySt/dQEy904fF/do49ZAqnA39UbwWtPGooydiF+9j+b6wTnxwYH3qo8K t58x4zfuITQL72582UQVv0/+aSna9RcGJf4jm+Wqbp8lt3r5ufOLgCgI9HW/qQjeWqbg mxK5Yzdn4tqEeZBr0fNzm27ZZCQTiuLmrcXKRncIIBmtHwDS1gLXfhmVhbu4eVk7NMdr COqg== X-Gm-Message-State: AElRT7Hp2QolB57nToIbVhW2Q/Xy0Fj9kvmtJMm9un0YuWaHw9pE6RfT HiZ53/t+EaPd1UrUKjh7yUxdFg== X-Received: by 10.223.191.6 with SMTP id p6mr2413463wrh.247.1520729003301; Sat, 10 Mar 2018 16:43:23 -0800 (PST) Received: from localhost ([217.30.68.212]) by smtp.gmail.com with ESMTPSA id i49sm5004423wra.44.2018.03.10.16.43.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Mar 2018 16:43:22 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: Armin Kuster , openembedded-core@lists.openembedded.org Date: Sun, 11 Mar 2018 00:43:13 +0000 Message-Id: X-Mailer: git-send-email 2.15.1 In-Reply-To: References: Subject: [OE-core] [rocko][PATCH 4/8] gcc: Fix libssh_nonshared linker specs for ppc/musl 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 From: Khem Raj The change to link libssp_nonshared.a only for musl was to move spec file changes to config/linux.h under a conditional when DEFAULT_LIBC == LIBC_MUSL which worked fine for all but ppc since gcc for ppc provided its own linux.h overrides which are used. This patch duplicates the change in those headers too Cherry-picked from oe-core master 9d39168a6acfa1f289a4448271c0bf9caaea10ec Signed-off-by: Khem Raj Signed-off-by: Ross Burton Signed-off-by: Martin Jansa --- ...shared-to-link-commandline-for-musl-targe.patch | 55 ++++++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) -- 2.15.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch index 310f7aacba..29b7ce72d2 100644 --- a/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch +++ b/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch @@ -1,4 +1,4 @@ -From 75a42d6d0f1f9784327f74882195a5c24843d5a8 Mon Sep 17 00:00:00 2001 +From 210f6b3b82084cc756e02b8bc12f909a43b14ee8 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 27 Jun 2017 18:10:54 -0700 Subject: [PATCH 40/49] Add ssp_nonshared to link commandline for musl targets @@ -17,18 +17,21 @@ Upstream-Status: Pending Signed-off-by: Khem Raj --- - gcc/config/linux.h | 6 ++++++ - 1 file changed, 6 insertions(+) + gcc/config/linux.h | 7 +++++++ + gcc/config/rs6000/linux.h | 10 ++++++++++ + gcc/config/rs6000/linux64.h | 10 ++++++++++ + 3 files changed, 27 insertions(+) diff --git a/gcc/config/linux.h b/gcc/config/linux.h -index 2e683d0c430..5ff0a2cb2ff 100644 +index 2e683d0c430..1b4df798671 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h -@@ -182,6 +182,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +@@ -182,6 +182,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ { 0, 0, 0, 0, 0, 0 } \ } +#ifdef TARGET_LIBC_PROVIDES_SSP ++#undef LINK_SSP_SPEC +#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit" \ + ":-lssp_nonshared}" @@ -37,6 +40,48 @@ index 2e683d0c430..5ff0a2cb2ff 100644 #endif #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ +diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h +index 684afd6c190..22cfa391b89 100644 +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -91,6 +91,16 @@ + " -m elf32ppclinux") + #endif + ++/* link libssp_nonshared.a with musl */ ++#if DEFAULT_LIBC == LIBC_MUSL ++#ifdef TARGET_LIBC_PROVIDES_SSP ++#undef LINK_SSP_SPEC ++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ ++ "|fstack-protector-strong|fstack-protector-explicit" \ ++ ":-lssp_nonshared}" ++#endif ++#endif ++ + #undef LINK_OS_LINUX_SPEC + #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 3b00ec0fcf0..8371f8d7b6b 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -465,6 +465,16 @@ extern int dot_symbols; + " -m elf64ppc") + #endif + ++/* link libssp_nonshared.a with musl */ ++#if DEFAULT_LIBC == LIBC_MUSL ++#ifdef TARGET_LIBC_PROVIDES_SSP ++#undef LINK_SSP_SPEC ++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ ++ "|fstack-protector-strong|fstack-protector-explicit" \ ++ ":-lssp_nonshared}" ++#endif ++#endif ++ + #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ + -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \ -- 2.13.2