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 static linking for Ubuntu #1758

Merged
merged 2 commits into from Feb 11, 2019

Conversation

Projects
None yet
2 participants
@jackgerrits
Copy link
Member

jackgerrits commented Feb 11, 2019

Fixes #1745

jackgerrits and others added some commits Feb 11, 2019


set(LINK_THREADS Threads::Threads)
if(STATIC_LINK_VW)
set(LINK_THREADS -Wl,--whole-archive -lpthread -Wl,--no-whole-archive)

This comment has been minimized.

@JohnLangford

JohnLangford Feb 11, 2019

Collaborator

What is the semantics of --whole-archive and --no-whole-archive?

This comment has been minimized.

@jackgerrits

jackgerrits Feb 11, 2019

Author Member

It forces the linker to use every object file in the archive rather than searching for required object files. There is a specific issue with linking pthread which requires this. See here for a GCC post about this issue. And here for a stack overflow post that goes in depth into why it fixes it.

--no-whole-archive then turns off this behavior.

This comment has been minimized.

@JohnLangford

JohnLangford Feb 11, 2019

Collaborator

That's remarkably arcane---I'm not used to commandlines having a temporal semantics.

Anyway, it looks good.

This comment has been minimized.

@jackgerrits

jackgerrits Feb 11, 2019

Author Member

I agree 100%

@JohnLangford JohnLangford merged commit f78a199 into VowpalWabbit:master Feb 11, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment