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

Link pthread using the --whole-archive option #2683

Merged
merged 2 commits into from
Nov 6, 2019

Conversation

fpoli
Copy link
Contributor

@fpoli fpoli commented Nov 6, 2019

This fixes a SIGSEGV on Ubuntu 16.04 when running z3 compiled with --staticbin (issue #2457). It seems that without the --whole-archive option the linker does not statically link all pthread symbols.

The fix is described here: https://stackoverflow.com/a/45271521/2491528

Note: also SLINK_EXTRA_FLAGS provides a -lpthread, but I haven't modified it because I'm not sure how it's used.

NikolajBjorner added a commit that referenced this pull request Nov 6, 2019
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
@NikolajBjorner
Copy link
Contributor

shouldn't it depend on is_static_bin/is_static_lib?

@fpoli
Copy link
Contributor Author

fpoli commented Nov 6, 2019

shouldn't it depend on is_static_bin/is_static_lib?

Ah, yes. Maybe also on is_linux()? It seems that --whole-archive is not available on MacOS (https://z3build.visualstudio.com/Z3Build/_build/results?buildId=1620).

This fixes a SIGSEGV on Ubuntu 16.04 when running z3 compiled with `--staticbin` (issue Z3Prover#2457). It seems that without the --whole-archive option the linker does not statically link all pthread symbols.

The fix is described here: https://stackoverflow.com/a/45271521/2491528
@NikolajBjorner NikolajBjorner merged commit 1048abf into Z3Prover:master Nov 6, 2019
@fpoli fpoli deleted the fix-static-linking branch November 6, 2019 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants