From patchwork Sun Mar 11 00:42:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 131321 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2623195lja; Sat, 10 Mar 2018 16:44:19 -0800 (PST) X-Google-Smtp-Source: AG47ELsPdWoV/cRzXu+HZ7g8khuHp2ahVohMrJKzKpsVqYYvcq6hYstyvnWVUNWrNliKXZE7ZJC9 X-Received: by 2002:a17:902:5803:: with SMTP id m3-v6mr3381017pli.389.1520729058980; Sat, 10 Mar 2018 16:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520729058; cv=none; d=google.com; s=arc-20160816; b=MoT9vwq/6lB+o1D7oTXCq2DaNWDlf4P8y9Ll5by4i700cjHGNheO1UgTkQuhJz9xx1 B4IE0VHPRCMhsyE+slZZCyuhzlRBuXr+RqI0fpDlC9omTUAPQzUeEutswjDah/trxxan lFAiLDeXlNPekMSq8td4tFzCWG0TJDu0zg0stgh2uggVxUHRyqc0Q9SjZ8o/reJAIUI/ u5XhZnYnHvk/irEDzru+SUkdkRnDRRBV94sGhUGv9lFNVJIfRT+sg46OSuSvud8tYL2i ftSN+R7ggoPNAetgmGZRh+BkXheE0aG8hSOaSzMIFNJO1rZsUl6DYlKUca6nV1ottr8I jUEA== 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=mfjLnpJSWFa8HKkS2n/kPNxO/h1x6CgU0kenUI4aiknq6rutq65vB5PsO2Z2TcpxU0 m1vXCsEMRLLwLVHC9DneplcaBbazQAxA5Al48Kv+JQY5ANipnH4zgsDC+rQSkP0QvMaT ZSt9L3EwqyugxY2AvfJ3wItsGAoMPgHn1Br2S6CCAei2tNy5KWm5+pHQEk1Jdn1623MB eDrCdRmaLFmZo4rgCR8BBWzuleH/7sOLQ/mVo2h3QUbrqDmWVPDf0dgaJb7uy8clJKW0 4BBqmnHk7WVnArK+iGOW0q1R9zSCy7aZTGwUxjnFMyzA4aWd409jUFuPkxjd0pIHBCQ8 /q9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=uN+rrBPi; 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 g63si3508562pfb.52.2018.03.10.16.44.18; Sat, 10 Mar 2018 16:44:18 -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=uN+rrBPi; 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 633B078948; Sun, 11 Mar 2018 00:43:04 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by mail.openembedded.org (Postfix) with ESMTP id C82B8788AC for ; Sun, 11 Mar 2018 00:42:46 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id o8so12317617wra.1 for ; Sat, 10 Mar 2018 16:42:48 -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=uN+rrBPiUpOskEMS0lU44cIdmTOuITBV0vonwc150tPrw+PHxEcEbn2uHnX7w9RpbW DcE24wwWJEaFCPFAyYrz4lcQOtCH4dxReZEUQXU18irMizfymFoLSTLyTRY6n8YSS0Js CfUQXxG6m1jKHOpM2imfe8FvmT2t7d7nCfUYYsJ6uyNwOUI4qXQsrx36bqu3aKyEqwk1 NKnJOGpIOasaSvipLZkTJci4VmAuNaBzYlxAjMZw+rhaf1OeYUEGWgfVjhNCxid+yF0q ODFps90ArfwGFO6UpR2fvvcIQ6PbqaJKxADXbCAkAD3tWqgAZUp88Mbb3Y2MqfAdirtB Vy9Q== 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=mtwC90fRXtNUb85NZgKAQUdNV3HygaxoqDD+Z489cS4hSGOM761wLJ2HAsMrISMUL6 AumfoOHp6yK3GRgjUsahPFKGBa7WHR+a2U3ppjW9CsckwvRuYgy32jKT5dLXNsLHlwUc MWkwlUIZ76M6jCG3zcbjBqeIGBSVp6ZqVyF62ii+isU43CmhQ44w4Q3co+5shmAXPbeG 8BQ6O7fRYP6JtrgvZeB+QMjF7KXupbKqX/3Xti6hV6I0qg1Py9sIFVSZCG5hbR27h5fa T877vZEjoejt7PrXivcps9z3JRbyyUQiY918HMqRk6y3JN+YT/QEBgqTk21RErP3Chtz fWug== X-Gm-Message-State: AElRT7Goku8ix1d07+bXcZ4hosEk/mc/RLFJfke2r8kSkvvbkVJazJUw z+3o07O+gdgk4kiCtVV0yMNYeg== X-Received: by 10.223.195.9 with SMTP id n9mr1236592wrf.252.1520728968019; Sat, 10 Mar 2018 16:42:48 -0800 (PST) Received: from localhost ([217.30.68.212]) by smtp.gmail.com with ESMTPSA id c14sm3090193wmh.15.2018.03.10.16.42.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Mar 2018 16:42:47 -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:42:24 +0000 Message-Id: <7d391a9e566a6ddc2970fc666a45570310bdc780.1520728802.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: Subject: [OE-core] [morty][PATCH 12/16] 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