From patchwork Mon Jan 30 16:40:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 138610 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 0DDC9B6F71 for ; Tue, 31 Jan 2012 03:40:46 +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=1328546447; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To: Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=xCaoE35vYwKWX+nm8NM/e/lY0Fw=; b=BKC+rveqYYS7zUrCVs2+/+NBSFN8LYig+OzGpx7h0AKU80lSNeg37c4U3jnzeZ 1au76wKZAk0K+yHy0MTyiUcwMTvOps0ndM7S7xdGyEJvgD1aQadDozrT5Ky+6c29 nnKLaypvC1piyPz4yaC4EkhkjdWJ5iNGdJAkCvmmvxy4c= 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:Received:Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=cPzlDY5yTqXslKcHWBuhufuHNQt0miVdPkKpSSth7BvYEu2PBcotppa420pckj B2V61usPc7DZRt/gaxeNEwrCAE3bAuFkvr2BlE0xqpMMqtWKmnfHhqvFvwvAGhth AZgqT3W743KlWtUpCnPEasN0EyohxeliszbRnKM5fO4V0=; Received: (qmail 16381 invoked by alias); 30 Jan 2012 16:40:41 -0000 Received: (qmail 16370 invoked by uid 22791); 30 Jan 2012 16:40:39 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_LG, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Jan 2012 16:40:26 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 067DE408; Mon, 30 Jan 2012 17:40:25 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2io1fn8Q7PJI; Mon, 30 Jan 2012 17:40:22 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 792F5407; Mon, 30 Jan 2012 17:40:22 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q0UGeLJp002963; Mon, 30 Jan 2012 17:40:21 +0100 (MET) From: Rainer Orth To: Richard Henderson Cc: gcc-patches@gcc.gnu.org Subject: Re: [libitm] Link eh-1.exe with -shared-libgcc on Solaris (PR libitm/51822) References: <4F1CADC0.7010309@redhat.com> <4F1EFCCF.7050608@redhat.com> Date: Mon, 30 Jan 2012 17:40:21 +0100 In-Reply-To: <4F1EFCCF.7050608@redhat.com> (Richard Henderson's message of "Wed, 25 Jan 2012 05:47:43 +1100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 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 Richard Henderson writes: > On 01/25/2012 12:03 AM, Rainer Orth wrote: >>> Er.. how did we get two copies? >> >> The link line boils down to >> >> ld -o eh-1.exe crt1.o crti.o crtbegin.o eh-1.o -litm -lstdc++ -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh crtend.o crtn.o >> >> The eh-1.o reference to _Unwind_Resume drags in one copy of the unwinder >> from libgcc_eh.a, while libstdc++.so is linked against libgcc_s.so.1, >> providing another copy. > > So... are we linking with the gcc binary, not the g++ binary? > Because I thought -shared-libgcc is the default for C++. > > If this goes too far down a rat-hole, your original patch is ok. The compiler used is currently set in libitm.exp (libitm_init) without considering the language used. Changing this seems too risky for stage4. I think we can get away with the following patch instead, which hardcodes -shared-libgcc for C++. I think it is safe even with --disable-shared since -shared-libgcc is simply ignored AFAICS, and is already used unconditionally in libffi.special/special.exp. Tested on i386-pc-solaris2.11. Ok for mainline? Rainer 2012-01-28 Rainer Orth PR libstdc++/51296 * testsuite/libitm.c++/c++.exp (lang_link_flags): Add -shared-libgcc. Correct libgomp references. # HG changeset patch # Parent 707821cb5b73761684848cdd143b741881b067ce Link eh-1.exe with -shared-libgcc on Solaris (PR libitm/51822) diff --git a/libitm/testsuite/libitm.c++/c++.exp b/libitm/testsuite/libitm.c++/c++.exp --- a/libitm/testsuite/libitm.c++/c++.exp +++ b/libitm/testsuite/libitm.c++/c++.exp @@ -1,3 +1,5 @@ +# Copyright (C) 2011, 2012 Free Software Foundation, Inc. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -17,14 +19,16 @@ load_lib libitm-dg.exp global shlib_ext set shlib_ext [get_shlib_extension] -set lang_link_flags "-lstdc++" +# The C++ tests should be linked with g++, which defaults to -shared-libgcc. +# Doing that is currently too intrusive, so hardcode here. +set lang_link_flags "-shared-libgcc -lstdc++" set lang_test_file_found 0 set lang_library_path "../libstdc++-v3/src/.libs" # Initialize dg. dg-init -set blddir [lookfor_file [get_multilibs] libgomp] +set blddir [lookfor_file [get_multilibs] libitm] if { $blddir != "" } { @@ -41,7 +45,7 @@ if { $blddir != "" } { } } elseif { [info exists GXX_UNDER_TEST] } { set lang_test_file_found 1 - # Needs to exist for libgomp.exp. + # Needs to exist for libitm.exp. set lang_test_file "" } else { puts "GXX_UNDER_TEST not defined, will not execute c++ tests"