summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-07-29 17:24:56 +0200
committerStefan Boberg <[email protected]>2026-07-29 17:36:45 +0200
commit75c7a5d5f97aa726075dcf6570ef1288dfa73a5a (patch)
treea168af1e1244eb4c9a2ff6611bf45e89f062f39f
parent872c74c9f4dbbc9211951a369f1d77e44403c015 (diff)
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 <[email protected]>
-rw-r--r--xmake/modules/core/tools/ml.lua20
1 files 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