From patchwork Fri Jan 14 16:09:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 78947 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 EA8A6B7088 for ; Sat, 15 Jan 2011 03:12:53 +1100 (EST) Received: (qmail 27421 invoked by alias); 14 Jan 2011 16:10:05 -0000 Received: (qmail 27335 invoked by uid 22791); 14 Jan 2011 16:10:03 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD 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; Fri, 14 Jan 2011 16:09:58 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id DA996D5C; Fri, 14 Jan 2011 17:09:52 +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 jy7fTJ2OUi0F; Fri, 14 Jan 2011 17:09:50 +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 C5848D5B; Fri, 14 Jan 2011 17:09:50 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p0EG9oqD003078; Fri, 14 Jan 2011 17:09:50 +0100 (MET) From: Rainer Orth To: Paolo Bonzini Cc: Ian Lance Taylor , gcc-patches@gcc.gnu.org Subject: Re: [build] Support libgo on Solaris 2 References: <4D300FFF.4040103@gnu.org> Date: Fri, 14 Jan 2011 17:09:50 +0100 In-Reply-To: <4D300FFF.4040103@gnu.org> (Paolo Bonzini's message of "Fri, 14 Jan 2011 09:57:35 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (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 Paolo Bonzini writes: > The way to build a proper feature test would be to compile a sample dynamic > library that uses printf, link it with -Bsymbolic, compile another program > that overrides printf and links with the dynamic library, run the program, > and check that the overridden printf is not used. That's why I mentioned that proper linker feature tests can become quite complicated. > I think that in this case a case statement is better. I suppose the following patch is ok then? It allowed bootstraps with Go included to complete on i386-pc-solaris2.10 (gas/gld), i386-pc-solaris2.11 (as/ld), and sparc-sun-solaris2.11 (as/ld). Btw., before Solaris 11, GNU ld is currently required because libgo/Makefile.am (BUILDGOX) has a hardcoded use of -Wl,--whole-archive which older vendor linkers are unlikely to understand. It happens to work on Solaris 11 since ld aquired may GNU ld command line options. Rainer 2011-01-13 Rainer Orth * configure.ac (gcc_cv_ld_static_dynamic): Solaris 2 ld always supports -Bstatic/-Bdynamic. * configure: Regenerate. diff -r 834971b1dce5 gcc/configure.ac --- a/gcc/configure.ac Fri Jan 14 10:10:37 2011 +0100 +++ b/gcc/configure.ac Fri Jan 14 10:14:34 2011 +0100 @@ -3166,11 +3166,18 @@ gcc_cv_ld_static_dynamic=yes fi elif test x$gcc_cv_ld != x; then - # Check if linker supports -Bstatic/-Bdynamic option - if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ - && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then - gcc_cv_ld_static_dynamic=yes - fi + # Check if linker supports -Bstatic/-Bdynamic option + if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ + && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then + gcc_cv_ld_static_dynamic=yes + else + case "$target" in + # Solaris 2 ld always supports -Bstatic/-Bdynamic. + *-*-solaris2*) + gcc_cv_ld_static_dynamic=yes + ;; + esac + fi fi if test x"$gcc_cv_ld_static_dynamic" = xyes; then AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,