@@ -27,17 +27,27 @@ def _frame_pointers_expected(machine):
2727 )
2828 if "no-omit-frame-pointer" in cflags :
2929 return True
30- if machine in {"aarch64" , "arm64" }:
31- return "-fomit-frame-pointer" not in cflags
32- if machine == "x86_64" :
30+ if "omit-frame-pointer" in cflags :
3331 return False
34- # MSVC ignores /Oy and /Oy- on x64/ARM64.
35- if sys .platform == "win32" and machine == "arm64" :
36- # Windows ARM64 guidelines recommend frame pointers (x29) for stack walking.
32+ if sys .platform == "darwin" :
33+ # macOS x86_64/ARM64 always have frame pointer by default.
3734 return True
38- if sys .platform == "win32" and machine == "x86_64" :
39- # Windows x64 uses unwind metadata; frame pointers are not required.
40- return None
35+ if sys .platform == "linux" :
36+ if machine in {"aarch64" , "arm64" }:
37+ # 32-bit Linux is not supported
38+ if sys .maxsize < 2 ** 32 :
39+ return None
40+ return True
41+ if machine == "x86_64" :
42+ return False
43+ if sys .platform == "win32" :
44+ # MSVC ignores /Oy and /Oy- on x64/ARM64.
45+ if machine == "arm64" :
46+ # Windows ARM64 guidelines recommend frame pointers (x29) for stack walking.
47+ return True
48+ elif machine == "x86_64" :
49+ # Windows x64 uses unwind metadata; frame pointers are not required.
50+ return None
4151 return None
4252
4353
@@ -139,6 +149,7 @@ def _manual_unwind_length(**env):
139149 ) from exc
140150
141151
152+ @unittest .skipIf (support .is_wasi , "test not supported on WASI" )
142153class FramePointerUnwindTests (unittest .TestCase ):
143154
144155 def setUp (self ):
0 commit comments