diff options
| author | ruki <[email protected]> | 2025-12-03 22:39:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-03 22:39:36 +0800 |
| commit | 4b24a3cb479df5ce3dd19eefa0c8ad0b794e5a4c (patch) | |
| tree | 33dcfaf1a96a914da5c2da9ef8363a915ea4eebc /xmake/modules/core/tools/flang.lua | |
| parent | 9a131d04c140ed7fdb2e7839ea14ac77b937dcb5 (diff) | |
improve flang
Diffstat (limited to 'xmake/modules/core/tools/flang.lua')
| -rw-r--r-- | xmake/modules/core/tools/flang.lua | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/flang.lua b/xmake/modules/core/tools/flang.lua index 2b0661e24..41e7643de 100644 --- a/xmake/modules/core/tools/flang.lua +++ b/xmake/modules/core/tools/flang.lua @@ -42,10 +42,28 @@ function init(self) self:set("mapflags", { -- visibility flags (not supported by Fortran) - ["-fvisibility=.*"] = "" + ["-fvisibility=.*"] = "", + -- strip flags (not supported by flang, use nf_strip instead) + ["^-s$"] = "" }) end +-- make the strip flag +-- flang doesn't support -s directly, use -Wl,-s for linker +function nf_strip(self, level) + local maps = { + debug = "-Wl,-S" + , all = "-Wl,-s" + } + if self:is_plat("macosx", "iphoneos", "watchos", "appletvos", "applexros") then + maps.all = {"-Wl,-x", "-Wl,-dead_strip"} + elseif self:is_plat("windows") then + -- flang doesn't support strip on windows + maps = {} + end + return maps[level] +end + -- make the symbol flag -- Fortran doesn't support visibility flags, only debug symbols function nf_symbol(self, level) |
