From patchwork Mon Apr 11 12:57:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 90592 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 66882B6F18 for ; Mon, 11 Apr 2011 22:58:08 +1000 (EST) Received: (qmail 6259 invoked by alias); 11 Apr 2011 12:58:07 -0000 Received: (qmail 6249 invoked by uid 22791); 11 Apr 2011 12:58:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_BJ, 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; Mon, 11 Apr 2011 12:58:02 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 7B887928; Mon, 11 Apr 2011 14:58:01 +0200 (CEST) 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 qFxMQAFDTn9I; Mon, 11 Apr 2011 14:57:59 +0200 (CEST) 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 816B4926; Mon, 11 Apr 2011 14:57:59 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p3BCvwak026080; Mon, 11 Apr 2011 14:57:58 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou , "David S. Miller" , Paolo Bonzini Subject: [build] Avoid ld -v error message with Sun ld on SPARC Date: Mon, 11 Apr 2011 14:57:58 +0200 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 While observing the output from gcc/configure on Solaris 11/SPARC, I noticed the following error: checking assembler for GOTDATA_OP relocs... ld: fatal: unrecognized option '-v' ld: fatal: use the -z help option for usage information yes There are at least two problems here: * Sun ld doesn't support -v, but uses -V instead. * One should check ld_ver instead, as done in many other places. * Why would one check for GNU ld at all? If one can detect from the output if the linker used is buggy or not, it shouldn't matter. The only reason I could see is avoiding to rely on objdump on Solaris, but that is used in too many other places to be a real issue. The follwing patch uses the easy way out and just tests ld_ver. Tested with make configure-gcc on sparc-sun-solaris2.11 with Sun as/ld, GNU as/Sun ld, and GNU as/ld without change to gcc/auto-host.h and no linker error. Ok for mainline? Rainer 2011-04-09 Rainer Orth * configure.ac (gcc_cv_as_sparc_gotdata_op): Test ld_ver instead of $gcc_cv_ld -v. * configure: Regenerate. diff --git a/gcc/configure.ac b/gcc/configure.ac --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3344,7 +3344,7 @@ bar: ld [[%l7 + %g1]], %g2, %gdop(foo)], [if test x$gcc_cv_ld != x \ && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then - if $gcc_cv_ld -v | grep GNU >/dev/null 2>&1; then + if echo "$ld_ver" | grep GNU > /dev/null; then if test x$gcc_cv_objdump != x; then if $gcc_cv_objdump -s -j .text conftest 2> /dev/null \ | grep ' 03000004 82186004 c405c001'> /dev/null 2>&1; then