From patchwork Fri Mar 9 05:52:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ollie Wild X-Patchwork-Id: 145662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DD782B6FC5 for ; Fri, 9 Mar 2012 16:52:49 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331877172; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=yPBx+6h Kf1PPpRg5WU/fNbJ3lNQ=; b=DYEYVGIj8vPI+ftieqJhsY0VlD2pYj9HONXYlVI xrrNzhhc7BeShtM4sGiMbQ10SQMWuH4NjnRdrcah3B3aVlAzIxIS4MfaXityzfF/ /zqzkVdr2msUIqQ22ET9ebaq9AJxDd33fPeBB93gWJqog/86i4EFPXgeM+hNduDo zuyo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=R6Vd3w2gKlhK+2gX5HrJE70a6kXYJPUZdMmVA6kYfLVopvE/awW7iBeAUXAGdH AS6IA3l9hdWPR/sIXvaC28YbOBZNpJKsgcuhg5q/tJeWkYPftD6HI43zi5BIQQUb 20Y3GvrgPJsTdzq5HzoHXa01ZrPm29AXZD4WZYLpk1gag=; Received: (qmail 4745 invoked by alias); 9 Mar 2012 05:52:42 -0000 Received: (qmail 4734 invoked by uid 22791); 9 Mar 2012 05:52:40 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, TW_GR, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vw0-f73.google.com (HELO mail-vw0-f73.google.com) (209.85.212.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 05:52:27 +0000 Received: by vbbfc26 with SMTP id fc26so163243vbb.2 for ; Thu, 08 Mar 2012 21:52:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=qjAA1E4G6mbcorAf6p1/UE+mpqlkQtIDIS8vEad7owM=; b=W20YHEhYkPmK/fHBILFwQS52BYbmYgRwHeASRgZmW6mqiDFSszhVJXe3VYFaTq9D01 rpDnP3KAm+TCwrMtJQXtmsnkesqUD01QKmBel6PKdDtik95u8q3AtryQZ6eFQItU2dOw QIlFBqQe4GtFo3MQy0w5/P+Jw5c72LKYuf8EMp9dZFhpZTabDKnUVBx2tTc+cN62xAFb gRdoMp2V07nGDRYGZaSm3t+8tRvbFB3W6kDVaSkDySfhYZrhiosR1bdHRG6dS018elWe uwrgbINmbG3NiKy0Lb8c2KuHTgB4iuva5Fg0LrW3gkl8ocyDDd5zAw0qzYIyiTgPDHrG KcrQ== Received: by 10.236.146.106 with SMTP id q70mr1654999yhj.0.1331272346270; Thu, 08 Mar 2012 21:52:26 -0800 (PST) Received: by 10.236.146.106 with SMTP id q70mr1654984yhj.0.1331272346213; Thu, 08 Mar 2012 21:52:26 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id f16si1185138ann.3.2012.03.08.21.52.26 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 08 Mar 2012 21:52:26 -0800 (PST) Received: from xoom.chi.corp.google.com (xoom.chi.corp.google.com [172.31.47.91]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 28E3710004D; Thu, 8 Mar 2012 21:52:26 -0800 (PST) Received: by xoom.chi.corp.google.com (Postfix, from userid 26705) id 9672FA1DB7; Thu, 8 Mar 2012 23:52:25 -0600 (CST) To: reply@codereview.appspotmail.com, ppluzhnikov@google.com, gcc-patches@gcc.gnu.org Subject: [google/integration] disable symbol hiding in libgcc for grtev3 targets (issue5792054) Message-Id: <20120309055225.9672FA1DB7@xoom.chi.corp.google.com> Date: Thu, 8 Mar 2012 23:52:25 -0600 (CST) From: aaw@google.com (Ollie Wild) X-Gm-Message-State: ALoCoQlUpTEP/jo1kmyo5STTD6uO13uyF3Tn1Iez9R2t5Irpah/WsuNTHlPVgxDxAUk01wrt9lVqlE6/O3NkfUVl37+HEYAmkM4Ghyz/3FQzXey4l+aj0zv0TNxHMQk16hrw7T/xJzzjcOsXAZw+N2kfeBwXJZDRp6upGtLKys/UKuRvJuJwHeU= X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org To be submitted to google/integration and merged to google/{main,gcc-4_7}. Would also like to have this considered for trunk, since this patch has no impact on non-grtev3 targets. Disable hiding of symbols in static libgcc libraries when built for GRTE v3. This allows pthread_cancel to perform stack unwinding when libgcc_eh.a is linked into dynamic executables. However, this opens up a hole wherein shared libraries linked with -static-libgcc cannot be individually modified without risk of breaking dependent libraries. That's okay in the GRTE v3 environment because libgcc is compiled without -fPIC anyway. See http://gcc.gnu.org/ml/gcc/2012-03/msg00104.html for details. Google ref 5836136. 2012-03-08 Ollie Wild * libgcc/Makefile.in (vis_hide): Move default initialization before inclusion of $(tmake_file). * libgcc/config.host (*-grtev3-*): Disable hiding of symbols in static libraries. * libgcc/config/t-static-no-vis-hide: New file. --- This patch is available for review at http://codereview.appspot.com/5792054 diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index 23b72b9..41fbb96 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -334,6 +334,12 @@ LIBUNWIND = SHLIBUNWIND_LINK = SHLIBUNWIND_INSTALL = +# For -fvisibility=hidden. We need both a -fvisibility=hidden on +# the command line, and a #define to prevent libgcc2.h etc from +# overriding that with #pragmas. This is set before including $(tmake_file) +# so it can be overridden on a host-specific basis. +vis_hide = @vis_hide@ + tmake_file = @tmake_file@ include $(srcdir)/empty.mk $(tmake_file) @@ -363,11 +369,6 @@ ifeq ($(enable_shared),yes) install-libunwind = install-libunwind endif -# For -fvisibility=hidden. We need both a -fvisibility=hidden on -# the command line, and a #define to prevent libgcc2.h etc from -# overriding that with #pragmas. -vis_hide = @vis_hide@ - ifneq (,$(vis_hide)) # If we have -fvisibility=hidden, then we need to generate hide diff --git a/libgcc/config.host b/libgcc/config.host index 257622a..242fbd5 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1174,3 +1174,10 @@ i[34567]86-*-linux* | x86_64-*-linux*) tm_file="${tm_file} i386/value-unwind.h" ;; esac + +case ${host} in +*-grtev3-*) + # Don't hide symbols in static libraries. + tmake_file="${tmake_file} t-static-no-vis-hide" + ;; +esac diff --git a/libgcc/config/t-static-no-vis-hide b/libgcc/config/t-static-no-vis-hide new file mode 100644 index 0000000..955ff35 --- /dev/null +++ b/libgcc/config/t-static-no-vis-hide @@ -0,0 +1,2 @@ +# Don't hide symbols in static libraries. +vis_hide =