From patchwork Mon Apr 16 06:50:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 133436 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp3238364ljb; Sun, 15 Apr 2018 23:50:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Ot101xiAag1qcMX48DKd+uaL3sXbGEZiVGiTLvtEX+Py5aOTJKwQNJZ+qSKJ+cqbcd/PS X-Received: by 10.167.129.154 with SMTP id g26mr316496pfi.169.1523861458169; Sun, 15 Apr 2018 23:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523861458; cv=none; d=google.com; s=arc-20160816; b=cC+2vETd4OlrwV/SJd1zz2XwSYWBuFC1ErwMc5JUJmm0rQjPW8Ze3e5ime/FU2gVv8 IKE+6G2nxqPPBECnc7wXfhvj7LhORsaj5P45aYCt/+r20OXuQOUz0n00w/P+H3JR0lq/ fouTOKAfMPcdnyHS/R0aQSLlBcoEo4C4n5nHfopWXmuVT8a3k0Sy0hSudDE0iXGq6EPA Zty342N5i0O+Rl8f5WtxKB21ejGw2zH0slzzehuG0AW6yr+0YMMFgRWReMeKtgR6h2uI aHM90NUwqW9o8DQXTlpcHCOnD1Op2rk/9XaHKDOOvIl93p7ogyFsuFlj53+rS3+u4L4w omkQ== 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=q695EzIBgFGh57dSTzriOqu619GCdZOUPsd05cuRB4A=; b=PvcvF6ntgghAxVewsETb5Zpzv18yKocFyM5UAIJ7vhA0utn2+fAva3PMYNpZVD9o89 p6ro+bdPZUtLwjss++qBVFoTBmGjr5WL8kAgvrWNPSbc51QsEuOrjwUhE/Vo1DE/nQa2 28Qnih8/ms+VjNukONyoI+Mz5o2x2Bgr7ICN6G7n48WY6VCnHEYBVUuyQHq0ZFCEkRur QUNUNbtH/EjyX7x7plxNHFQhbI2wYh6zqprVEJ5qnOZI3MsZngfrHhF9FhJRkmP761Rq py57XpEe6RQOPsJVkr7vb8Cx00+f4hXE63BtYdkuI5JcnJ2vgZB01r3kxsXendX0VPd7 9etg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D9ziJyly; 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 1-v6si11358642plj.247.2018.04.15.23.50.57; Sun, 15 Apr 2018 23:50:58 -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=D9ziJyly; 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 A0EE674524; Mon, 16 Apr 2018 06:50:51 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by mail.openembedded.org (Postfix) with ESMTP id 61395744F9 for ; Mon, 16 Apr 2018 06:50:35 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id t20-v6so9485735ply.9 for ; Sun, 15 Apr 2018 23:50:36 -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=GYC8GjwZodQPQ4S17ZXlj5gEmFAFtoxhcPT1zboyBsc=; b=D9ziJyly5wpq0h0fLYkjwBIgL9n9ZuUKNmzrAHMLqPhLURDRd78K6x2F5Hx5Fbm+TU G97E+JEjYX0+/qintrv9rOWN9e2FrTSdWA2WgISuflNJtPSTkTNo+WJIF5QxJI3RhLiI V0LxDzuUhUSA48z8JZxRbPboMNNusZFuEiCMi1EQWoMJK4whlrDM8xQg5ERY4GWkD05T JORghWvS2BHv7MgA3dmvUAB3pXcyyukB8yoDnbyGmPvB0GgFMjsHoF4TzVLFGcGZceiC TJNUMyO8BrV6OMb1TkpCOwPvehQKlkZkCfe4C/Q3HtZakZjtAf9dFS/Zr1xxpFyBOOZ1 oNAQ== 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=GYC8GjwZodQPQ4S17ZXlj5gEmFAFtoxhcPT1zboyBsc=; b=GK5gOxgx1oT1Ljun7LfpbWk1PKMevee6anGlHkOilA9MM+Cneb9kCEOBU67QP+RVD0 gyTDOSRONWylhLHEXmnF4xQ2ReIVxjEXngxAH13d4bCkVxH3IiyuMSaUu5TeNhtcgzHk ITtM91D+rRe0gqqhun2Dy8VL+2JurgT7P+/dAaiPzc2yX4n0Nvpe8cbKPI65+VKZQTAs PqVLmv3wfmBzD+agmZ4ajOHXiR9vxpsV37soXsyBsMmlTfFqpzpsghCYqVpjOyfcNx7r u9xZr8YSNQZapWrvSTNx/hsz2u6bDwnKGLMJtJ23KjvjNfmZ7KxQiwDvV663LmGvngSa w/gQ== X-Gm-Message-State: ALQs6tB8EjauUyr3q/eE/qJzdVF2XV7KTxIJUA6UtBn7OehB7oqBtjyc dtWE9CD5xgZgpfzNJX6Adn56hQ== X-Received: by 2002:a17:902:bd03:: with SMTP id p3-v6mr14378185pls.236.1523861436234; Sun, 15 Apr 2018 23:50:36 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8880:466c::487b]) by smtp.gmail.com with ESMTPSA id o13sm2388362pgn.54.2018.04.15.23.50.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Apr 2018 23:50:34 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sun, 15 Apr 2018 23:50:13 -0700 Message-Id: <20180416065014.29385-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180416065014.29385-1-raj.khem@gmail.com> References: <20180416065014.29385-1-raj.khem@gmail.com> Subject: [OE-core] [PATCH 3/4] gcc-runtime: Disable gcc version of libssp 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 is implemented fully in glibc as well as in musl so we really do not need the gcc version of this library except may be for mingw, where we keep it enabled anyway gcc in OE is built with the knowledge that C library already provides libssp implementation, we should therefore not need the gcc implementation of same. libssp_nonshared piece is a detail which is needed when gcc is the compiler, in glibc this is part of libc_nonshared.a already and libc_nonshared.a is linked always when linking with -lc becuase libc.so in glibc is actually a linker script GROUP ( /usr/lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /usr/lib/ld-linux-x86-64.so.2 ) ) which automatically links in the needed runtime bits, this however is not the case for musl, where core SSP APIs are implemented in full but compiler specific runtime isn't, for this we add a new package called libssp_nonshared which generate the needed runtime stub and gcc is already carrying patch to link to libssp_nonshared.a on musl This should fix a long standing problem where static PIE executable were not buildable with OE since it was conflicting SSP implementation one from C library and the other one from gcc and we end up with duplicate symbol errors during linking. Signed-off-by: Khem Raj --- meta/recipes-devtools/gcc/gcc-7.3.inc | 4 +++- meta/recipes-devtools/gcc/gcc-runtime.inc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) -- 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-devtools/gcc/gcc-7.3.inc b/meta/recipes-devtools/gcc/gcc-7.3.inc index d968c322d2..7e52afc643 100644 --- a/meta/recipes-devtools/gcc/gcc-7.3.inc +++ b/meta/recipes-devtools/gcc/gcc-7.3.inc @@ -93,10 +93,12 @@ FORTRAN = "" JAVA = "" LTO = "--enable-lto" +SSP ?= "--disable-libssp" +SSP_mingw = "--enable-libssp" EXTRA_OECONF_BASE = "\ ${LTO} \ - --enable-libssp \ + ${SSP} \ --enable-libitm \ --disable-bootstrap \ --disable-libmudflap \ diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc index 97365a21dc..b4e5539575 100644 --- a/meta/recipes-devtools/gcc/gcc-runtime.inc +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc @@ -24,8 +24,10 @@ RUNTIMELIBITM_nios2 = "" RUNTIMELIBITM_microblaze = "" RUNTIMELIBITM_riscv32 = "" RUNTIMELIBITM_riscv64 = "" +RUNTIMELIBSSP ?= "" +RUNTIMELIBSSP_mingw ?= "libssp" -RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \ +RUNTIMETARGET = "libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \ ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \ " RUNTIMETARGET_append_x86 = " libmpx"