From 75c7a5d5f97aa726075dcf6570ef1288dfa73a5a Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 29 Jul 2026 17:24:56 +0200 Subject: fix masm symbol flags for embed/edit levels masm only supports -Zi/-Zd; the -Z7 and -ZI flags of cl.exe are rejected with warning A4018, and without -WX the flag is silently dropped, so `set_symbols("debug", "embed")` produced asm objects without any debug info. -Zi already embeds debug info in the object file (masm has no compile-time pdb), so the embed and edit levels now degrade to it. Also fix the gcc-style -g mapping which had the same problem. Fixes #7675 Co-Authored-By: Claude Fable 5 --- xmake/modules/core/tools/ml.lua | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/xmake/modules/core/tools/ml.lua b/xmake/modules/core/tools/ml.lua index 2e7628cd2..229a7303a 100644 --- a/xmake/modules/core/tools/ml.lua +++ b/xmake/modules/core/tools/ml.lua @@ -35,7 +35,7 @@ function init(self) self:set("mapflags", { -- symbols - ["-g"] = "-Z7" + ["-g"] = "-Zi" , ["-fvisibility=.*"] = "" -- warnings @@ -55,20 +55,14 @@ function init(self) end -- make the symbol flags +-- +-- masm only supports -Zi/-Zd, the -Z7 and -ZI flags of cl.exe are rejected (A4018). +-- -Zi already embeds debug info in the object file (masm has no compile-time pdb), +-- so the "embed" and "edit" levels degrade to it. function nf_symbols(self, levels) - local flags = nil - local values = hashset.from(levels) - if values:has("debug") then - flags = {} - if values:has("edit") then - table.insert(flags, "-ZI") - elseif values:has("embed") then - table.insert(flags, "-Z7") - else - table.insert(flags, "-Zi") - end + if hashset.from(levels):has("debug") then + return {"-Zi"} end - return flags end -- make the warning flag -- cgit v1.3.1