diff options
| author | ruki <[email protected]> | 2024-09-18 22:11:15 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-18 22:11:15 +0800 |
| commit | b9385560675a37623b2d4d385b6290b87b824d66 (patch) | |
| tree | b515cc1e54a128dd5e3aabd2c542615eb8d4e09f | |
| parent | 590fe4cce9d024eb8b42755b0a83e9c479a97c6a (diff) | |
| parent | 3693321efa174749eb3c255a4ded0d78f8fb4aac (diff) | |
Merge pull request #5631 from KkemChen/dev
fix "as_needed" flag order
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 97b826b68..c04d06e8a 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -368,10 +368,13 @@ function nf_linkgroup(self, linkgroup, opt) table.insert(prefix_flags, "-Wl,-Bstatic") table.insert(suffix_flags, 1, "-Wl,-Bdynamic") end + -- https://github.com/xmake-io/xmake/issues/5621 if as_needed then - -- https://github.com/xmake-io/xmake/issues/5621 table.insert(prefix_flags, "-Wl,--as-needed") table.insert(suffix_flags, 1, "-Wl,--no-as-needed") + elseif as_needed == false then + table.insert(prefix_flags, "-Wl,--no-as-needed") + table.insert(suffix_flags, 1, "-Wl,--as-needed") end if whole then table.insert(prefix_flags, "-Wl,--whole-archive") |
