From patchwork Tue Nov 11 13:41:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 3649 Received: (qmail 12159 invoked by alias); 11 Nov 2014 13:41:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 12149 invoked by uid 89); 11 Nov 2014 13:41:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 11 Nov 2014 13:41:19 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sABDfGik003560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Nov 2014 08:41:16 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sABDfEmr005735; Tue, 11 Nov 2014 08:41:15 -0500 Message-ID: <546211FA.4070002@redhat.com> Date: Tue, 11 Nov 2014 13:41:14 +0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Filipe Utzig , gdb-patches Subject: Re: [PATCH] Fix cross-compiling with static linking in gdbserver Makefile.in References: In-Reply-To: Hi Filipe, On 11/10/2014 10:46 AM, Filipe Utzig wrote: > The Makefile.in of gdbserver is written to use gcc instead ${CC} when > you choose to compile the target with libraries linked statically. In > fact is not a bug itself, but the comment says to set that line if you > want/need to compile with the -static flag, and I saw some users > having troubles with this, so I believe that's a good idea do the > comment in the right way. Hmm, odd comment. > This patch should fix that. > index 8b0318a..c2ef44c 100644 > --- a/gdb/gdbserver/Makefile.in > +++ b/gdb/gdbserver/Makefile.in > @@ -78,7 +78,7 @@ VPATH = @srcdir@ > > # Set this up with gcc if you have gnu ld and the loader will print out > # line numbers for undefinded refs. > -#CC-LD=gcc -static > +#CC-LD=${CC} -static > CC-LD=${CC} IMO, afterwards, the comment makes even less sense, for still talking about gcc. Why not just use LDFLAGS, as in: $ make LDFLAGS="-static" ? I see that gdb/Makefile.in has the same comment. I think we should just delete that comment and the commented out bit. From 1fa406f22d6f62db3421426c2b868295c7526846 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 11 Nov 2014 12:55:02 +0000 Subject: [PATCH] gdb/gdbserver: don't suggest overriding CC_LD/CC-LD in Makefile.in Ref: . Looking at git history, I traced this commented out the -static all the way back to gdb-3.3 (4187119d): /* Set this up with gcc if you have gnu ld and the loader will print out line numbers for undefinded refs. */ /* CC-LD=gcc -static */ CC-LD=${CC} And, before that, gdb-3.1 (e91b87a3) already had the comment in gdb/Makefile: # Set this up with gcc if you have gnu ld and the loader will print out # line numbers for undefinded refs. CC-LD=${CC} (but no explicit mention of -static). There's a standard mechanism to pass linker flags to the linker (override LDFLAGS, e.g.: 'make LDFLAGS="-static"'), no need to suggest a custom way. gdb/ 2014-11-11 Pedro Alves * Makefile.in: Remove comment suggesting setting up CC_LD to gcc -static. gdb/gdbserver/ 2014-11-11 Pedro Alves * Makefile.in: Remove comment suggesting setting up CC_LD to gcc -static. --- gdb/ChangeLog | 5 +++++ gdb/gdbserver/ChangeLog | 5 +++++ gdb/Makefile.in | 3 --- gdb/gdbserver/Makefile.in | 3 --- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0a8bee8..c0adce3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-11-11 Pedro Alves + + * Makefile.in: Remove comment suggesting setting up CC_LD to gcc + -static. + 2014-11-07 Pedro Alves * infrun.c (process_event_stop_test) : Don't diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 0940fa0..b482f6a 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2014-11-11 Pedro Alves + + * Makefile.in: Remove comment suggesting setting up CC_LD to gcc + -static. + 2014-10-15 Pedro Alves PR server/17487 diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 1da8af6..336096c 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -120,9 +120,6 @@ MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS) MAKEHTML = $(MAKEINFO_CMD) --html MAKEHTMLFLAGS = -# Set this up with gcc if you have gnu ld and the loader will print out -# line numbers for undefined references. -#CC_LD=gcc -static CC_LD=$(CC) # Where is our "include" directory? Typically $(srcdir)/../include. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 8b0318a..25dc15d 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -76,9 +76,6 @@ VPATH = @srcdir@ # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which # is where it should be according to Posix). -# Set this up with gcc if you have gnu ld and the loader will print out -# line numbers for undefinded refs. -#CC-LD=gcc -static CC-LD=${CC} # Where is the "include" directory? Traditionally ../include or ./include