From patchwork Tue Feb 1 06:40:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Wildenhues X-Patchwork-Id: 81281 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 E0702B70E7 for ; Tue, 1 Feb 2011 17:40:38 +1100 (EST) Received: (qmail 18716 invoked by alias); 1 Feb 2011 06:40:36 -0000 Received: (qmail 18702 invoked by uid 22791); 1 Feb 2011 06:40:35 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 01 Feb 2011 06:40:30 +0000 Received: (qmail invoked by alias); 01 Feb 2011 06:40:27 -0000 Received: from xdsl-78-35-60-2.netcologne.de (EHLO localhost.localdomain) [78.35.60.2] by mail.gmx.net (mp006) with SMTP; 01 Feb 2011 07:40:27 +0100 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1Pk9uc-0006x4-23; Tue, 01 Feb 2011 07:40:26 +0100 Date: Tue, 1 Feb 2011 07:40:25 +0100 From: Ralf Wildenhues To: Rainer Orth , libtool-patches@gnu.org Cc: gcc-patches@gcc.gnu.org, Ian Lance Taylor Subject: Re: [libgo, build] Use convenience libraries to create .gox files Message-ID: <20110201064025.GA26325@gmx.de> Mail-Followup-To: Rainer Orth , libtool-patches@gnu.org, gcc-patches@gcc.gnu.org, Ian Lance Taylor References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2010-08-04) 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 [ adding libtool-patches ] * Rainer Orth wrote on Mon, Jan 31, 2011 at 03:54:29PM CET: > GNU ld testing failed initially for the 64-bit multilib: > > libtool: link: /vol/gcc/obj/gcc-4.6.0-20110128/11-gcc-gas-gld-go/./gcc/collect-ld -r -o crypto/libsubtle.o --whole-archive crypto/.libs/libsubtle.a --no-whole-archive > /vol/gcc/bin/gld-2.21: Relocatable linking with relocations from format elf64-x86-64-sol2 (sort/.libs/libsort.a(libsort.a.o)) to format elf32-i386-sol2 (sort/libsort.o) is not supported > make[7]: *** [sort/libsort.lo] Error 1 > > Ultimately, this turned out to be a libtool issue: it doesn't handle > Solaris 2/x86 at all, and Solaris 2/SPARC with GNU ld is incomplete in > that it doesn't account for the new *_sol2 emulations in gld 2.21. All > this second-guessing the compiler suggests to me that it's a bad idea to > call the linker directly if gcc is in use. I know libtool bashing is hitting an easy target, but IIRC we still had user reports last year of (probably older) GCC installations where partial linking did not work when using the gcc driver, as opposed to using ld directly (note! for partial linking). Anyway, I'm applying your patch to upstream Libtool, as below. Thanks, Ralf 2011-02-01 Rainer Orth (tiny change) Fix LD setting for 64-bit Solaris 2/x86. * libltdl/m4/libtool.m4 (_LT_ENABLE_LOCK) [*-*-solaris*): Determine GNU ld options for 64-bit Solaris 2/x86. Detect gld 2.21 _sol2 emulations. diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 033c9a0..5cc027b 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -1374,14 +1374,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64"