git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Modify MSVC wrapper script

From
Peter Harris <pharris@opentext.com>
Date
Jul 5, 2010, 19:41 UTC
Message-ID
<1278358897-488-2-git-send-email-pharris@opentext.com>
In-Reply-To
<1278358897-488-1-git-send-email-pharris@opentext.com>

This reduces warnings, and supports additional linker flags (such as -DEBUG and -MAP)

Signed-off-by: Peter Harris <pharris@opentext.com>
---
 Makefile                        |    1 +
 compat/vcbuild/scripts/clink.pl |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 7134509..d4fd4b0 100644
--- a/Makefile
+++ b/Makefile
@@ -1073,6 +1073,7 @@ ifndef DEBUG
 	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..3f51886 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" =~ /^-[DIMGOWZ]/) {
 		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);
-- 
1.7.1.msysgit.0.4.gea744.MSVC
Previous: Peter HarrisNext: Johannes Sixt
Message 2 of 4 in “Fix MSVC build”
  1. 1/2 Fix MSVC buildPeter Harris, Jul 5, 2010
  2. 2/2 Modify MSVC wrapper scriptPeter Harris, Jul 5, 2010
  3. Johannes SixtJul 6, 2010
  4. Johannes SchindelinJul 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.