From: Peter Harris <git@peter.is-a-geek.org>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Junio C Hamano <gitster@pobox.com>,
GIT Mailing-list <git@vger.kernel.org>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH 4/4] Makefile: Don't pass $(ALL_CFLAGS) to the linker
Date: Thu, 24 Jun 2010 11:30:09 -0400 [thread overview]
Message-ID: <AANLkTinmGOSwNzLBngXHOU-pxNTbHFJQyCLIHQWFW6Eo@mail.gmail.com> (raw)
In-Reply-To: <4C226520.5080009@ramsay1.demon.co.uk>
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
On Wed, Jun 23, 2010 at 3:48 PM, Ramsay Jones wrote:
>
> The msvc debug build (make MSVC=1 DEBUG=1) issues a warning
> on every invocation of the linker:
>
> LINK : warning LNK4044: unrecognized option '/Zi'; ignored
>
> In order to suppress the warning, we refrain from passing the
> $(ALL_CFLAGS) macro to the linker.
Alternatively, we could leave the makefile alone and fix it up in
compat/vcbuild/scripts/clink.pl
(Apologies for the patch attached instead of inline; I'm not using a
whitespace-clean email client at the moment.)
Peter Harris
[-- Attachment #2: msvc.patch --]
[-- Type: application/octet-stream, Size: 1010 bytes --]
diff --git a/Makefile b/Makefile
index 7134509..dccee8e 100644
--- a/Makefile
+++ b/Makefile
@@ -1072,7 +1072,8 @@ ifndef DEBUG
BASIC_LDFLAGS += -LTCG
AR += -LTCG
else
BASIC_CFLAGS += -Zi -MTd
+ BASIC_LDFLAGS = -DEBUG -MAP
endif
X = .exe
endif
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 4374771..aec9980 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -12,10 +12,14 @@
use strict;
my @args = ();
my @cflags = ();
+my @lflags = ();
my $is_linking = 0;
+my %linkflag = ( '-DEBUG' => 1, '-MAP' => 1 );
while (@ARGV) {
my $arg = shift @ARGV;
- if ("$arg" =~ /^-[DIMGO]/) {
+ if ($linkflag{$arg}) {
+ push(@lflags, $arg);
+ } elsif ("$arg" =~ /^-[DIMGOZ]/) {
push(@cflags, $arg);
} elsif ("$arg" eq "-o") {
my $file_out = shift @ARGV;
@@ -44,6 +48,7 @@ while (@ARGV) {
}
if ($is_linking) {
unshift(@args, "link.exe");
+ push(@args, @lflags);
} else {
unshift(@args, "cl.exe");
push(@args, @cflags);
next prev parent reply other threads:[~2010-06-24 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 19:48 [PATCH 4/4] Makefile: Don't pass $(ALL_CFLAGS) to the linker Ramsay Jones
2010-06-23 21:08 ` Jonathan Nieder
2010-06-26 17:59 ` Ramsay Jones
2010-06-26 18:19 ` Jonathan Nieder
2010-06-30 19:40 ` Ramsay Jones
2010-06-30 21:16 ` Andreas Schwab
2010-06-27 9:44 ` Bernhard R. Link
2010-06-24 15:30 ` Peter Harris [this message]
2010-06-25 20:24 ` Ramsay Jones
2010-06-27 20:45 ` Peter Harris
2010-06-30 19:52 ` Ramsay Jones
2010-07-01 21:27 ` Peter Harris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTinmGOSwNzLBngXHOU-pxNTbHFJQyCLIHQWFW6Eo@mail.gmail.com \
--to=git@peter.is-a-geek.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).