@@ -2173,20 +2173,34 @@ use_libunwind = get_option("use-libunwind")
2173
2173
use_system_libunwind = use_system_version_of_library ("libunwind" )
2174
2174
2175
2175
# Assume system libunwind works if it's installed and selected.
2176
- can_use_libunwind = (use_system_libunwind or env .TargetOSIs ('linux' ) and
2177
- (env ['TARGET_ARCH' ] in ('x86_64' , 'aarch64' , 'ppc64le' , 's390x' )))
2176
+ # TODO SERVER-75120: Revert the special handling for arch when this ticket is complete
2177
+ can_use_libunwind_arch = env .TargetOSIs (
2178
+ 'linux' ) and env ['TARGET_ARCH' ] == 'aarch64' and not debugBuild
2179
+ can_use_libunwind = (use_system_libunwind
2180
+ or (env .TargetOSIs ('linux' )
2181
+ and env ['TARGET_ARCH' ] in ('x86_64' , 'ppc64le' , 's390x' ))
2182
+ or can_use_libunwind_arch )
2178
2183
2179
2184
if use_libunwind == "off" :
2180
2185
use_libunwind = False
2181
2186
use_system_libunwind = False
2182
2187
elif use_libunwind == "on" :
2183
2188
use_libunwind = True
2189
+ # TODO SERVER-75120: Revert the special handling for arch when this ticket is complete
2184
2190
if not can_use_libunwind :
2185
- env .ConfError ("libunwind not supported on target platform" )
2191
+ if not can_use_libunwind_arch :
2192
+ env .ConfError (
2193
+ "libunwind not supported on amd64 with debug build see SERVER-75120. Recompile with '--use-libunwind=off'"
2194
+ )
2195
+ env .ConfError ("libunwind not supported on target platform." )
2186
2196
Exit (1 )
2187
2197
elif use_libunwind == "auto" :
2188
2198
use_libunwind = can_use_libunwind
2189
2199
2200
+ # TODO SERVER-75120: Revert the special handling for arch when this ticket is complete
2201
+ if not can_use_libunwind_arch :
2202
+ env .Append (LINKFLAGS = ['-rdynamic' ])
2203
+
2190
2204
use_vendored_libunwind = use_libunwind and not use_system_libunwind
2191
2205
if use_system_libunwind and not use_libunwind :
2192
2206
print ("Error: --use-system-libunwind requires --use-libunwind" )
0 commit comments