From patchwork Mon Sep 2 06:37:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 1156470 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=opteya.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46ML4470Lgz9s7T for ; Mon, 2 Sep 2019 16:37:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EBC7985E98; Mon, 2 Sep 2019 06:37:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nJPPMYc8Ulgo; Mon, 2 Sep 2019 06:37:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 60CBC85EAC; Mon, 2 Sep 2019 06:37:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8B6131BF2C7 for ; Mon, 2 Sep 2019 06:37:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 887E685EAC for ; Mon, 2 Sep 2019 06:37:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hsZOxU4knomu for ; Mon, 2 Sep 2019 06:37:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ou.quest-ce.net (ou.quest-ce.net [195.154.187.82]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 741D985E98 for ; Mon, 2 Sep 2019 06:37:34 +0000 (UTC) Received: from [2a01:e35:39f2:1220:9dd7:c176:119b:4c9d] (helo=test.quest-ce.net) by ou.quest-ce.net with esmtpsa (TLS1.1:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1i4fy0-0006KC-4w; Mon, 02 Sep 2019 08:37:32 +0200 From: Yann Droneaud To: buildroot@buildroot.org Date: Mon, 2 Sep 2019 08:37:27 +0200 Message-Id: <20190902063728.31203-1-ydroneaud@opteya.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a01:e35:39f2:1220:9dd7:c176:119b:4c9d X-SA-Exim-Mail-From: ydroneaud@opteya.com X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ou.quest-ce.net) Subject: [Buildroot] [PATCH 1/2] toolchain/external: copy libssp.so if SSP is enabled X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yann Droneaud , Thomas De Schampheleire , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Unlike libgcc_s.so, libssp.so is not copied on the target file system. As it's available at link time, allowing packages such as sox to be linked against the library. As it's not copied, running programs linked against libssp.so lead to failure such as the following: $ sox sox: error while loading shared libraries: libssp.so.0: cannot open shared object file: No such file or directory $ rec rec: error while loading shared libraries: libssp.so.0: cannot open shared object file: No such file or directory If BR2_SSP_REGULAR, BR2_SSP_STRONG, or BR2_SSP_ALL is set, as libssp.so provides __stack_chk_fail, and *_chk symbols, the library must be copied to the target filesystem, like libgcc_s.so. If BR2_SSP_NONE is set, there should be no need to copy it. Signed-off-by: Yann Droneaud --- toolchain/toolchain-external/pkg-toolchain-external.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index c3ddff263fe9..175a87756437 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -114,6 +114,10 @@ endif TOOLCHAIN_EXTERNAL_LIBS += ld*.so* libgcc_s.so.* libatomic.so.* +ifneq ($(BR2_SSP_NONE),y) +TOOLCHAIN_EXTERNAL_LIBS += libssp.so.* +endif + ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) TOOLCHAIN_EXTERNAL_LIBS += libc.so.* libcrypt.so.* libdl.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.* ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)