diff options
author | Andrew Morrow <acm@mongodb.com> | 2021-04-05 17:30:54 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-09 16:40:20 +0000 |
commit | 7dfd7920c9cc023f88813f6146c33c7649acba1f (patch) | |
tree | ad3f69de6c95487aa5224a59cc01f85c72911a9b | |
parent | eff94d95aeb52906cb8066159606e1e0f0f81565 (diff) | |
download | mongo-7dfd7920c9cc023f88813f6146c33c7649acba1f.tar.gz |
SERVER-49322 Darwin doesn't need libunwind to use hidden visibility
-rw-r--r-- | SConstruct | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct index 414e9aecb08..564282f6568 100644 --- a/SConstruct +++ b/SConstruct @@ -2499,13 +2499,21 @@ if env.TargetOSIs('posix'): if not "tbaa" in selected_experimental_optimizations: env.Append(CCFLAGS=["-fno-strict-aliasing"]) - # The hidden visibility requires that we have libunwind in play. - if "vishidden" in selected_experimental_optimizations and use_libunwind: + # Enabling hidden visibility on non-darwin requires that we have + # libunwind in play, since glibc backtrace will not work + # correctly. + if "vishidden" in selected_experimental_optimizations and (env.TargetOSIs('darwin') or use_libunwind): if link_model.startswith('dynamic'): # In dynamic mode, we can't make the default visibility # hidden because not all libraries have export tags. But # we can at least make inlines hidden. - env.Append(CXXFLAGS=["-fvisibility-inlines-hidden"]) + # + # TODO: Except on macOS, where we observe lots of crashes + # when we enable this. We should investigate further but + # it isn't relevant for the purpose of exploring these + # flags on linux, where they seem to work fine. + if not env.TargetOSIs('darwin'): + env.Append(CXXFLAGS=["-fvisibility-inlines-hidden"]) else: # In static mode, we need an escape hatch for a few # libraries that don't work correctly when built with |