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

[PATCH v2 8b/16] engine.pl: ignore invalidcontinue.obj which is known to MSVC

From
Philip Oakley <philipoakley@iee.org>
Date
Jul 20, 2015, 22:54 UTC
Message-ID
<1437432846-5796-2-git-send-email-philipoakley@iee.org>
In-Reply-To
<1437432846-5796-1-git-send-email-philipoakley@iee.org>

Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX compatibility, 2014-03-29) introduced invalidcontinue.obj into the Makefile output, which was not parsed correctly by the buildsystem. Ignore it, as it is known to Visual Studio and, there is no matching source file.

Only substitute filenames ending with .o when generating the source .c filename, otherwise a .cbj file may be expected.

Split the .o and .obj processing; 'make' does not produce .obj files.

In the future there may be source files that produce .obj files so keep the two issues (.obj files with & without source files) separate.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
---
 contrib/buildsystems/engine.pl | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 60c7a7d..9db3d43 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -289,7 +289,7 @@ sub handleLibLine
 #    exit(1);
     foreach (@objfiles) {
         my $sourcefile = $_;
-        $sourcefile =~ s/\.o/.c/;
+        $sourcefile =~ s/\.o$/.c/;
         push(@sources, $sourcefile);
         push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
         push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});
@@ -333,8 +333,12 @@ sub handleLinkLine
         } elsif ($part =~ /\.(a|lib)$/) {
             $part =~ s/\.a$/.lib/;
             push(@libs, $part);
-        } elsif ($part =~ /\.(o|obj)$/) {
+        } elsif ($part eq 'invalidcontinue.obj') {
+            # ignore - known to MSVC
+        } elsif ($part =~ /\.o$/) {
             push(@objfiles, $part);
+        } elsif ($part =~ /\.obj$/) {
+            # do nothing, 'make' should not be producing .obj, only .o files
         } else {
             die "Unhandled link option @ line $lineno: $part";
         }
@@ -343,7 +347,7 @@ sub handleLinkLine
 #    exit(1);
     foreach (@objfiles) {
         my $sourcefile = $_;
-        $sourcefile =~ s/\.o/.c/;
+        $sourcefile =~ s/\.o$/.c/;
         push(@sources, $sourcefile);
         push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
         push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});
-- 
2.3.1
Previous: Philip OakleyNext: Philip Oakley
Message 2 of 9 in “Make the msvc-build scripts work again”
  1. 00/16 Make the msvc-build scripts work againPhilip Oakley, Jul 20, 2015
  2. engine.pl: ignore invalidcontinue.obj which is known to MSVCPhilip Oakley, Jul 20, 2015
  3. engine.pl: delete the captured stderr file if emptyPhilip Oakley, Jul 20, 2015
  4. Junio C HamanoJul 20, 2015
  5. Philip OakleyJul 21, 2015
  6. Junio C HamanoJul 21, 2015
  7. Junio C HamanoJul 21, 2015
  8. Philip OakleyJul 21, 2015
  9. Ramsay JonesJul 22, 2015

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.