From 2c456836c5fa6885e2a840db1cd6866287c0d5fb Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 13 Sep 2023 22:44:13 +0800 Subject: improve to extract symbols --- xmake/rules/utils/symbols/extract/xmake.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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}) -- cgit v1.3.1