summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-08-26 23:13:47 +0800
committerruki <[email protected]>2020-08-26 23:13:47 +0800
commitac25a656e8bef9274a98f76c78626a2aeb514d33 (patch)
tree102c23f26dddee6398c7990364ea100283c6f584
parent2eb5e5f42578eea6a5d0773529b5636c5ac1ece4 (diff)
improve tcc
-rw-r--r--xmake/modules/core/tools/tcc.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua
index f6001f156..62a5f970c 100644
--- a/xmake/modules/core/tools/tcc.lua
+++ b/xmake/modules/core/tools/tcc.lua
@@ -36,7 +36,7 @@ function init(self)
, "-DIBAction=void)__attribute__((ibaction)")
-- init shflags
- self:set("shflags", "-shared")
+ self:set("shflags", "-shared", "-rdynamic")
-- init cxflags for the kind: shared
self:set("shared.cxflags", "-fPIC")
@@ -135,7 +135,13 @@ end
-- make the link arguments list
function linkargv(self, objectfiles, targetkind, targetfile, flags)
- return self:program(), table.join("-o", targetfile, objectfiles, flags)
+ local argv
+ if targetkind == "static" then
+ argv = table.join("-ar", "cr", targetfile, objectfiles)
+ else
+ argv = table.join("-o", targetfile, objectfiles, flags)
+ end
+ return self:program(), argv
end
-- link the target file