Skip to content

Commit 9216042

Browse files
authored
Merge pull request #5512 from ChrisCatCP/export_all
fix export_all when use export_filter on arch x86
2 parents c3d03f9 + d6174f9 commit 9216042

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

xmake/rules/utils/symbols/export_all/export_all.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ function _get_allsymbols_by_dumpbin(target, dumpbin, opt)
4242
local symbol = line:match(".*External%s+| (.*)")
4343
if symbol then
4444
symbol = symbol:split('%s')[1]
45+
-- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992
46+
if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("__") and not symbol:startswith("_DllMain@") then
47+
symbol = symbol:sub(2)
48+
end
4549
if export_filter then
4650
if export_filter(symbol) then
4751
allsymbols:insert(symbol)
4852
end
4953
elseif not symbol:startswith("__") then
50-
-- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992
51-
if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("_DllMain@") then
52-
symbol = symbol:sub(2)
53-
end
5454
if export_classes or not symbol:startswith("?") then
5555
if export_classes then
5656
if not symbol:startswith("??_G") and not symbol:startswith("??_E") then
@@ -83,15 +83,15 @@ function _get_allsymbols_by_objdump(target, objdump, opt)
8383
local splitinfo = line:split("%s")
8484
local symbol = splitinfo[#splitinfo]
8585
if symbol then
86+
-- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992
87+
if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("__") and not symbol:startswith("_DllMain@") then
88+
symbol = symbol:sub(2)
89+
end
8690
if export_filter then
8791
if export_filter(symbol) then
8892
allsymbols:insert(symbol)
8993
end
9094
elseif not symbol:startswith("__") then
91-
-- we need ignore DllMain, https://github.com/xmake-io/xmake/issues/3992
92-
if target:is_arch("x86") and symbol:startswith("_") and not symbol:startswith("_DllMain@") then
93-
symbol = symbol:sub(2)
94-
end
9595
if export_classes or not symbol:startswith("?") then
9696
if export_classes then
9797
if not symbol:startswith("??_G") and not symbol:startswith("??_E") then

0 commit comments

Comments
 (0)