diff options
| author | ruki <[email protected]> | 2023-09-13 22:44:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-09-13 22:44:13 +0800 |
| commit | 2c456836c5fa6885e2a840db1cd6866287c0d5fb (patch) | |
| tree | 969ffca93587889f3179c9009dbeb821d8fb5f29 | |
| parent | 6f5d273b4bb94ad5ba718922bbb54c74ed57d06a (diff) | |
improve to extract symbols
| -rw-r--r-- | xmake/rules/utils/symbols/extract/xmake.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/rules/utils/symbols/extract/xmake.lua b/xmake/rules/utils/symbols/extract/xmake.lua index cdc1e044a..222634688 100644 --- a/xmake/rules/utils/symbols/extract/xmake.lua +++ b/xmake/rules/utils/symbols/extract/xmake.lua @@ -32,6 +32,7 @@ rule("utils.symbols.extract") and (targetkind == "binary" or targetkind == "shared") and platform.tool("strip") then -- only for strip command target:data_set("utils.symbols.extract", true) target:set("strip", "none") -- disable strip in link stage, because we need to run separate strip commands + target:data_set("strip.origin", strip) end end) after_link(function (target, opt) @@ -109,7 +110,12 @@ rule("utils.symbols.extract") table.insert(strip_argv, "-S") else -- -s/--strip-all for gnu strip - table.insert(strip_argv, "-s") + local strip = target:data("strip.origin") + if strip == "debug" then + table.insert(strip_argv, "-S") + else + table.insert(strip_argv, "-s") + end end table.insert(strip_argv, targetfile) os.vrunv(strip, strip_argv, {dryrun = dryrun}) |
