diff options
| author | ruki <[email protected]> | 2026-07-30 09:58:51 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-07-30 09:58:51 +0800 |
| commit | a928217681c4c5dc60b80a230182e5254bc30c8d (patch) | |
| tree | 4dfc736ee3f97dd20422cdb5d3aec4f8f0e626e1 | |
| parent | e095ba9030d7c3296a7bf6e9c0595300501941e9 (diff) | |
| parent | 75c7a5d5f97aa726075dcf6570ef1288dfa73a5a (diff) | |
Merge pull request #7676 from bionicbeagle/fix-masm-symbol-flags
fix masm symbol flags for embed/edit levels (A4018)
| -rw-r--r-- | xmake/modules/core/tools/ml.lua | 20 |
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 |
