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

Fixed linking error with gold #1579

Merged
merged 2 commits into from
Jan 3, 2020
Merged

Fixed linking error with gold #1579

merged 2 commits into from
Jan 3, 2020

Conversation

dutor
Copy link
Contributor

@dutor dutor commented Jan 2, 2020

When using gold as the linker, building fails with undefined referenced symbols. As for the the reason underhood, I will dig it later.

@dutor dutor added the ready-for-testing PR: ready for the CI test label Jan 2, 2020
@dutor
Copy link
Contributor Author

dutor commented Jan 2, 2020

I think the error was due to the linker option --gc-sections, which is enabled with ld.bfd, mostly the default one, while disabled with ld.gold.

To be specific, with --gc-sections, some unused functions are eliminated during the link stage(this is one of several ways I reduce the build size), as well as their dependencies. At the meantime, --gc-sections is disabled when gold linker is used, since it's buggy when they are used together(something tedious on use of systemtap by folly, ignore it if no interest, consult me otherwise).

Copy link
Contributor

@monadbobo monadbobo left a comment

Choose a reason for hiding this comment

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

LGTM.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dangleptr
Copy link
Contributor

Awesome

@dutor dutor merged commit 9ce16c0 into vesoft-inc:master Jan 3, 2020
@dutor dutor deleted the fix-linking branch January 3, 2020 02:15
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
When using gold as the linker, building fails with undefined referenced symbols. As for the the reason underhood, I will dig it later.

I think the error was due to the linker option --gc-sections, which is enabled with ld.bfd, mostly the default one, while disabled with ld.gold.

To be specific, with --gc-sections, some unused functions are eliminated during the link stage(this is one of several ways I reduce the build size), as well as their dependencies. At the meantime, --gc-sections is disabled when gold linker is used, since it's buggy when they are used together(something tedious on use of systemtap by folly, ignore it if no interest, consult me otherwise).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants