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

Link librt when compiling with --staticbin on Linux

Fixes issue #2457. The workaround is described here: https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec
This commit is contained in:
Federico Poli 2019-11-27 09:45:09 +01:00 committed by Nikolaj Bjorner
parent d14b083bc9
commit 8ebbc094eb

View file

@ -2632,7 +2632,7 @@ def mk_config():
config.write('LINK_FLAGS=\n')
config.write('LINK_OUT_FLAG=-o \n')
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)
config.write('LINK_EXTRA_FLAGS=-Wl,--whole-archive -lrt -lpthread -Wl,--no-whole-archive %s\n' % LDFLAGS)
else:
config.write('LINK_EXTRA_FLAGS=-lpthread %s\n' % LDFLAGS)
config.write('SO_EXT=%s\n' % SO_EXT)