Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "as_needed" flag order #5631

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions xmake/modules/core/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ function nf_linkgroup(self, linkgroup, opt)
table.insert(prefix_flags, "-Wl,-Bstatic")
table.insert(suffix_flags, 1, "-Wl,-Bdynamic")
end
if as_needed then
if not as_needed then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能这么判断,没设置 as_needed ,就是 nil,不得一样被设置。。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所得思呐🤗

-- https://github.com/xmake-io/xmake/issues/5621
table.insert(prefix_flags, "-Wl,--as-needed")
table.insert(suffix_flags, 1, "-Wl,--no-as-needed")
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
Loading