From 9555c1843dc811bf609760e9d3b6259149b4550a Mon Sep 17 00:00:00 2001 From: 白喵 <478688389@qq.com> Date: Tue, 27 Aug 2024 01:13:22 +0800 Subject: fix export_all when use export_filter on arch x86 --- xmake/rules/utils/symbols/export_all/export_all.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xmake/rules/utils/symbols/export_all/export_all.lua b/xmake/rules/utils/symbols/export_all/export_all.lua index c188d8386..1c2806b79 100644 --- a/xmake/rules/utils/symbols/export_all/export_all.lua +++ b/xmake/rules/utils/symbols/export_all/export_all.lua @@ -42,15 +42,15 @@ function _get_allsymbols_by_dumpbin(target, dumpbin, opt) local symbol = line:match(".*External%s+| (.*)") if symbol then symbol = symbol:split('%s')[1] + -- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992 + if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("__") and not symbol:startswith("_DllMain@") then + symbol = symbol:sub(2) + end if export_filter then if export_filter(symbol) then allsymbols:insert(symbol) end elseif not symbol:startswith("__") then - -- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992 - if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("_DllMain@") then - symbol = symbol:sub(2) - end if export_classes or not symbol:startswith("?") then if export_classes then if not symbol:startswith("??_G") and not symbol:startswith("??_E") then @@ -83,15 +83,15 @@ function _get_allsymbols_by_objdump(target, objdump, opt) local splitinfo = line:split("%s") local symbol = splitinfo[#splitinfo] if symbol then + -- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992 + if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("__") and not symbol:startswith("_DllMain@") then + symbol = symbol:sub(2) + end if export_filter then if export_filter(symbol) then allsymbols:insert(symbol) end elseif not symbol:startswith("__") then - -- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992 - if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("_DllMain@") then - symbol = symbol:sub(2) - end if export_classes or not symbol:startswith("?") then if export_classes then if not symbol:startswith("??_G") and not symbol:startswith("??_E") then -- cgit v1.3.1