NASM Forum > Using NASM

Compiling recent versions of NASM with VC++ 2017

(1/2) > >>

mh-nexus:
Hello,

I am trying to compile a recent version of NASM with VC++ 2017 but it fails with the most recent versions.
The issue starts with version 2.15.03 and later, the previous one 2.15.02, still compiles.

Here is the error I get.

--- Code: ---> nmake /f Mkfiles/msvc.mak

Microsoft (R) Program Maintenance Utility, Version 14.16.27030.1
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

NMAKE :  U1073: "config\config.h.in" could not be created
Stop.
Mkfiles/msvc.mak(410) : fatal error U1050: Unable to rebuild dependencies file msvc.dep
Stop.

--- End code ---

Any clues on what could be causing this?

mh-nexus:
To answer my own question: 2.15.03 is missing config\config.h.in. Copying it from 2.15.04 solves the compiling problem for 2.15.03.

However 2.15.04 and 2.15.05 still don't compile because of this error:

--- Quote ---Microsoft (R) Program Maintenance Utility, Version 14.16.27030.1
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

NMAKE : fatal error U1071: Schleife im Abhängigkeitsstruktur für Ziel "asm\nasm.
obj"
Stop.
--- End quote ---

mh-nexus:
After some more digging I found out the issue. Apparently the following makefile entries in msvc.mak cause the "A circular dependency exists in the dependency tree for the given target. " error.

The relevant 4 lines, starting at line no 231, are:

--- Code: --- $(MAKE) asm\warnings.time

asm\warnings.time: $(ALLOBJ:.@OBJEXT@=.c)
: > asm\warnings.time
--- End code ---

Comment out these 4 lines, then create the empty file asm\warnings.time manually.

After these steps compiling works again as expected with the usual command:
nmake /f Mkfiles\msvc.mak

I haven't found out a way to fix this issue properly yet, but this stackoverflow entry might give a hint:
https://stackoverflow.com/questions/32394965/makefile-cycle-in-dependency-tree

mh-nexus:
Line 234 has the statement:

--- Code: ---: > asm\warnings.time
--- End code ---
Which is an illegal command under Windows. I assume it is supposed to update the file modification time, which can be achieved like this:

--- Code: ---type NUL > asm\warnings.time
--- End code ---
It will also create the file in case it does not exist.

But the real issue is the condition $(ALLOBJ:.@OBJEXT@=.c) in the line 233:

--- Code: ---asm\warnings.time: $(ALLOBJ:.@OBJEXT@=.c)
--- End code ---

But even if that issue would be solved, I am not sure I understand the logic behind that statement. The file asm\warnings.time has to exist already (which it does not in the default distribution), or nmake will still fail.

mh-nexus:
There are two issues with substring replacement $(ALLOBJ:.@OBJEXT@=.c).

@OBJEXT@ has no effect since macro expansion is not supported by nmake:
https://stackoverflow.com/questions/18374299/how-do-i-substitute-a-string-and-add-a-prefix-or-suffix-in-microsoft-nmake

Therefore it has to be rewritten with string literals, as such:
$(ALLOBJ:.obj=.c)

Fixing all the bugs mentioned in the posts so far, we get:

--- Quote ---asm\warnings.time: $(ALLOBJ:.obj=.c)
   type NUL > asm\warnings.time
   $(MAKE) $(WARNFILES)
--- End quote ---

But eventhough this string replacement works, we still have cyclic dependencies, for example:

asm\warnings.time -> asm\warnings.c -> asm\warnings.time

The last dependency occurs due to line 237:

--- Code: ---asm\warnings.c: asm\warnings.pl asm\warnings.times
--- End code ---
and the first dependency due to

--- Code: ---asm\warnings.time: $(ALLOBJ:.obj=.c)
--- End code ---

Whatever the purpose of this added code to the makefile was, it will not work with nmake, due to the cyclic dependency. So until the original developer fixes it, the best option is to edit the makefile as mentioned in my third post.

Navigation

[0] Message Index

[#] Next page

Go to full version