From d8be2a1ca7bbc360a808eb921607fad74095f3cf Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 22 Oct 2022 00:53:40 +0800 Subject: fix armlink for long path #2952 --- xmake/modules/core/tools/armlink.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xmake/modules/core/tools/armlink.lua b/xmake/modules/core/tools/armlink.lua index e25a81967..fa8a1510f 100644 --- a/xmake/modules/core/tools/armlink.lua +++ b/xmake/modules/core/tools/armlink.lua @@ -49,8 +49,17 @@ function nf_runtime(self, runtime) end -- make the link arguments list -function linkargv(self, objectfiles, targetkind, targetfile, flags) - return self:program(), table.join("-o", targetfile, objectfiles, flags) +function linkargv(self, objectfiles, targetkind, targetfile, flags, opt) + opt = opt or {} + local argv = table.join("-o", targetfile, objectfiles, flags) + if is_host("windows") and not opt.rawargs then + argv = winos.cmdargv(argv, {escape = true}) + if #argv > 0 and argv[1] and argv[1]:startswith("@") then + argv[1] = argv[1]:replace("@", "", {plain = true}) + table.insert(argv, 1, "--via") + end + end + return self:program(), argv end -- link the target file -- cgit v1.3.1