Skip to content

Commit

Permalink
Merge pull request #5631 from KkemChen/dev
Browse files Browse the repository at this point in the history
fix "as_needed" flag order
  • Loading branch information
waruqi authored Sep 18, 2024
2 parents 590fe4c + 3693321 commit b938556
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xmake/modules/core/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b938556

Please sign in to comment.