Skip to content

Commit

Permalink
SERVER-78304 Disabled debug builds with libunwind on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
IamXander authored and Evergreen Agent committed Jun 22, 2023
1 parent a314158 commit 9637f5c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2173,20 +2173,34 @@ use_libunwind = get_option("use-libunwind")
use_system_libunwind = use_system_version_of_library("libunwind")

# Assume system libunwind works if it's installed and selected.
can_use_libunwind = (use_system_libunwind or env.TargetOSIs('linux') and
(env['TARGET_ARCH'] in ('x86_64', 'aarch64', 'ppc64le', 's390x')))
# TODO SERVER-75120: Revert the special handling for arch when this ticket is complete
can_use_libunwind_arch = env.TargetOSIs(
'linux') and env['TARGET_ARCH'] == 'aarch64' and not debugBuild
can_use_libunwind = (use_system_libunwind
or (env.TargetOSIs('linux')
and env['TARGET_ARCH'] in ('x86_64', 'ppc64le', 's390x'))
or can_use_libunwind_arch)

if use_libunwind == "off":
use_libunwind = False
use_system_libunwind = False
elif use_libunwind == "on":
use_libunwind = True
# TODO SERVER-75120: Revert the special handling for arch when this ticket is complete
if not can_use_libunwind:
env.ConfError("libunwind not supported on target platform")
if not can_use_libunwind_arch:
env.ConfError(
"libunwind not supported on amd64 with debug build see SERVER-75120. Recompile with '--use-libunwind=off'"
)
env.ConfError("libunwind not supported on target platform.")
Exit(1)
elif use_libunwind == "auto":
use_libunwind = can_use_libunwind

# TODO SERVER-75120: Revert the special handling for arch when this ticket is complete
if not can_use_libunwind_arch:
env.Append(LINKFLAGS=['-rdynamic'])

use_vendored_libunwind = use_libunwind and not use_system_libunwind
if use_system_libunwind and not use_libunwind:
print("Error: --use-system-libunwind requires --use-libunwind")
Expand Down

0 comments on commit 9637f5c

Please sign in to comment.