From patchwork Mon Dec 19 16:15:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 132279 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 4C7FCB704D for ; Tue, 20 Dec 2011 03:15:41 +1100 (EST) Received: (qmail 22512 invoked by alias); 19 Dec 2011 16:15:29 -0000 Received: (qmail 22491 invoked by uid 22791); 19 Dec 2011 16:15:26 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL, BAYES_00, 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, 19 Dec 2011 16:15:05 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 9B3AF8FA; Mon, 19 Dec 2011 17:15:03 +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 04ZHVk95ZIRY; Mon, 19 Dec 2011 17:15:00 +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 8E18F8F9; Mon, 19 Dec 2011 17:15:00 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id pBJGF04o002452; Mon, 19 Dec 2011 17:15:00 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: fortran@gcc.gnu.org, Richard Henderson Subject: [libgfortran, libitm] Link with -shared-libgcc Date: Mon, 19 Dec 2011 17:15:00 +0100 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 I've just noticed that the superfluous references to __gcc_personality_v0 aren't created any longer and thus my hack http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02113.html isn't needed anymore. When I tried a gas/gld bootstrap on Solaris 11/x86, I still ran into a considerable number of testsuite failures, though: all libgomp.fortran and 32-bit libitm link tests fail: /vol/gcc/bin/gld-2.22: ./allocatable1.exe: hidden symbol `_Unwind_Backtrace' in /var/gcc/gcc-4.7.0-20111216/11-gcc-gas-gld/gcc/libgcc_eh.a(unwind-dw2.o) is referenced by DSO /vol/gcc/bin/gld-2.22: final link failed: Bad value Indeed, libgfortran.so contains unresolved references to libgcc_s.so functions: $ ldd -r libgfortran.so libquadmath.so.0 => /var/gcc/gcc-4.7.0-20111216/11-gcc-gas-gld/i386-pc-solaris2.11/libquadmath/.libs/libquadmath.so.0 libm.so.2 => /lib/libm.so.2 libc.so.1 => /lib/libc.so.1 symbol not found: _Unwind_Backtrace (./libgfortran.so) symbol not found: _Unwind_GetIPInfo (./libgfortran.so) thus needs to be linked with -shared-libgcc. I don't see this with Sun ld, where -shared implies -shared-libgcc. The problem isn't observed with the gfortran.* tests since those are linked with gfortran, which defaults shared_libgcc to 1. The 32-bit libitm.so suffers from a similar problem: $ ldd -r ../.libs/libitm.so libpthread.so.1 => /lib/libpthread.so.1 libc.so.1 => /lib/libc.so.1 symbol not found: _Unwind_DeleteException (../.libs/libitm.so) libm.so.2 => /lib/libm.so.2 This doesn't occur for 64-bit libitm since the 64-bit Solaris 11 libc contains the amd64 unwinder. The patch below fixes both issues and let the i386-pc-solaris2.11 bootstrap complete without unexpected failures. Ok for mainline? Rainer 2011-12-18 Rainer Orth libitm: * Makefile.am (libitm_la_LDFLAGS): Add -Wc,-shared-libgcc. * Makefile.in: Regenerate. libgfortran: * Makefile.am (libgfortran_la_LDFLAGS): Add -Wc,-shared-libgcc. * Makefile.in: Regenerate. # HG changeset patch # Parent 6ed25d2abd3e62ff79829913c0399af94d0a6c64 Link with -shared-libgcc diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -36,7 +36,9 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi toolexeclib_LTLIBRARIES = libgfortran.la toolexeclib_DATA = libgfortran.spec libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS) -libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(LIBQUADLIB) -lm $(extra_ldflags_libgfortran) $(version_arg) +libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ + $(LTLDFLAGS) $(LIBQUADLIB) -lm $(extra_ldflags_libgfortran) \ + $(version_arg) -Wc,-shared-libgcc libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP) myexeclib_LTLIBRARIES = libgfortranbegin.la diff --git a/libitm/Makefile.am b/libitm/Makefile.am --- a/libitm/Makefile.am +++ b/libitm/Makefile.am @@ -54,7 +54,8 @@ libitm_version_info = -version-info $(li # want or need libstdc++. libitm_la_DEPENDENCIES = $(libitm_version_dep) libitm_la_LINK = $(LINK) $(libitm_la_LDFLAGS) -libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) +libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) \ + -Wc,-shared-libgcc libitm_la_SOURCES = \ aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc barrier.cc beginend.cc \