3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-05 17:14:07 +00:00

Merge pull request #2683 from fpoli/fix-static-linking

Link pthread using the --whole-archive option
This commit is contained in:
Nikolaj Bjorner 2019-11-06 11:22:52 +01:00 committed by GitHub
commit 1048abfd9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2631,10 +2631,10 @@ def mk_config():
config.write('LINK=%s\n' % CXX)
config.write('LINK_FLAGS=\n')
config.write('LINK_OUT_FLAG=-o \n')
if build_static_lib() or build_static_bin():
if is_linux() and (build_static_lib() or build_static_bin()):
config.write('LINK_EXTRA_FLAGS=-Wl,--whole-archive -lpthread -Wl,--no-whole-archive %s\n' % LDFLAGS)
else:
config.write('LINK_EXTRA_FLAGS= -lpthread %s\n' % LDFLAGS)
config.write('LINK_EXTRA_FLAGS=-lpthread %s\n' % LDFLAGS)
config.write('SO_EXT=%s\n' % SO_EXT)
config.write('SLINK=%s\n' % CXX)
config.write('SLINK_FLAGS=%s\n' % SLIBFLAGS)