From patchwork Tue Aug 26 14:21:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew McDonnell X-Patchwork-Id: 383083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id EE7751400AA for ; Wed, 27 Aug 2014 00:22:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 328BFA0EC7; Tue, 26 Aug 2014 14:22:32 +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 ISxFxG-pgpMv; Tue, 26 Aug 2014 14:22:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E9A8CA0D73; Tue, 26 Aug 2014 14:22:29 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A14A31C214E for ; Tue, 26 Aug 2014 14:22:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9B71491195 for ; Tue, 26 Aug 2014 14:22:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HTqWOWS3C79j for ; Tue, 26 Aug 2014 14:22:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cartman.zuver.net.au (cartman.zuver.net.au [110.232.142.10]) by whitealder.osuosl.org (Postfix) with ESMTPS id F094A81148 for ; Tue, 26 Aug 2014 14:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=andrewmcdonnell.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=8JZpCalAqmzaeDZ0nTZ+ZeARnuuTfgcO0M6WxAJ9ar8=; b=vGYGfG+3eUuIobCokC6Kcg9cuDIc8jQBxvRUCZCEj9kCxu9uIoyq44/rC2L2V7XtSjtdCA+5RF3TnEcH8Qq5Qd2cvFDUFQaqOVEUs/GvPGw3vGFlSEdF2dI6yH63tiahCqxHSwA7n2+D72t6vHiLNpZKzzcJKhZazOhXrciZC4Y=; Received: from 180-150-66-127.cust.aussiebb.net ([180.150.66.127]:48701 helo=atlantis4.eaglenest) by cartman.zuver.net.au with esmtpsa (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XMHdc-000zYa-9Z; Wed, 27 Aug 2014 00:22:20 +1000 From: Andrew McDonnell To: uclibc@uclibc.org Subject: [PATCH] When BUILD_NOEXECSTACK specified, ensure all generated .so have it applied. Date: Tue, 26 Aug 2014 23:51:28 +0930 Message-Id: <1409062888-12041-2-git-send-email-bugs@andrewmcdonnell.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409062888-12041-1-git-send-email-bugs@andrewmcdonnell.net> References: <1409062888-12041-1-git-send-email-bugs@andrewmcdonnell.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cartman.zuver.net.au X-AntiAbuse: Original Domain - uclibc.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - andrewmcdonnell.net X-Get-Message-Sender-Via: cartman.zuver.net.au: authenticated_id: bugs@andrewmcdonnell.net X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org Signed-off-by: Andrew McDonnell --- Rules.mak | 6 ++++++ libpthread/linuxthreads/Makefile.in | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/Rules.mak b/Rules.mak index 9c191f3..1d51d2c 100644 --- a/Rules.mak +++ b/Rules.mak @@ -733,6 +733,12 @@ else DOMULTI:=n endif +ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y) +# Ensure that NX is applied to _all_ .so files generated +# $(eval $(call check-ld-var,-z$(comma)noexecstack)) # <-- doesnt work: the part after -z gets stripped in check_ld +LDFLAGS += -Wl,-z,noexecstack +endif + ifneq ($(strip $(UCLIBC_EXTRA_LDFLAGS)),"") LDFLAGS += $(call qstrip,$(UCLIBC_EXTRA_LDFLAGS)) endif diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in index 697371b..a96f117 100644 --- a/libpthread/linuxthreads/Makefile.in +++ b/libpthread/linuxthreads/Makefile.in @@ -24,7 +24,11 @@ CFLAGS-libpthread/linuxthreads/sysdeps/pthread/ := $(CFLAGS-linuxthreads ifeq ($(PTHREADS_DEBUG_SUPPORT),y) LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs +ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y) +LDFLAGS-libpthread.so += -Wl,-z,noexecstack +endif else +# This will already have noexecstack if required LDFLAGS-libpthread.so := $(LDFLAGS) endif