From patchwork Mon Sep 2 06:37:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 1156471 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 46ML480jngz9s7T for ; Mon, 2 Sep 2019 16:37:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 64DC285FD6; Mon, 2 Sep 2019 06:37:39 +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 LHPJy8iw4R4Z; Mon, 2 Sep 2019 06:37:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 80E7C85F8C; Mon, 2 Sep 2019 06:37:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 307ED1BF2C7 for ; Mon, 2 Sep 2019 06:37:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2D82B8789C for ; Mon, 2 Sep 2019 06:37:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ESTiymzgxJvp for ; Mon, 2 Sep 2019 06:37:35 +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 hemlock.osuosl.org (Postfix) with ESMTPS id 0930487877 for ; Mon, 2 Sep 2019 06:37:35 +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-0006KH-OA; Mon, 02 Sep 2019 08:37:32 +0200 From: Yann Droneaud To: buildroot@buildroot.org Date: Mon, 2 Sep 2019 08:37:28 +0200 Message-Id: <20190902063728.31203-2-ydroneaud@opteya.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902063728.31203-1-ydroneaud@opteya.com> References: <20190902063728.31203-1-ydroneaud@opteya.com> 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 2/2] packages/sox: disable stack protector if SSP is not 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" By default, sox link with libssp.so when available. libssp.so is usually available within builtroot, as it's provided by almost, if not all, external cross toolchains. Unfortunately, unlike libgcc_s.so, libssp.so is not copied on the target filesystem, so it's only available at link time and not at runtime, hence the following failures on target: $ 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_NONE is set, libssp.so is not expected to be copied, so sox must not use it, and must be configured with --disable-stack-protector. 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 should be made available on target, so sox could use it. Signed-off-by: Yann Droneaud --- package/sox/sox.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/sox/sox.mk b/package/sox/sox.mk index 0b3dc136d815..a3d1089bf747 100644 --- a/package/sox/sox.mk +++ b/package/sox/sox.mk @@ -13,6 +13,10 @@ SOX_CONF_OPTS = --with-distro="Buildroot" --without-ffmpeg --disable-gomp \ SOX_LICENSE = GPL-2.0+ (sox binary), LGPL-2.1+ (libraries) SOX_LICENSE_FILES = LICENSE.GPL LICENSE.LGPL +ifeq ($(BR2_SSP_NONE),y) +SOX_CONF_OPTS += --disable-stack-protector +endif + # MIPS Codescape toolchains don't support stack-smashing protection # despite of using glibc. ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS)$(BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS),y)