Skip to content

Commit 837d7b2

Browse files
jedludlowtwiecki
authored andcommitted
Disable C++ exception handling
Update GCC compiler options to disable C++ exception handling altogether. Also disable the creation of stack unwinding tables since these will not be required without exceptions enabled.
1 parent a9c72be commit 837d7b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pymc/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ def __set_compiler_flags():
3434

3535
current = aesara.config.gcc__cxxflags
3636
augmented = f"{current} -Wno-c++11-narrowing"
37+
3738
# Work around compiler bug in GCC < 8.4 related to structured exception
3839
# handling registers on Windows.
3940
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 for details.
40-
augmented = f"{augmented} -fno-asynchronous-unwind-tables"
41+
# First disable C++ exception handling altogether since it's not needed
42+
# for the C extensions that we generate.
43+
augmented = f"{augmented} -fno-exceptions"
44+
# Now disable the generation of stack unwinding tables.
45+
augmented = f"{augmented} -fno-unwind-tables -fno-asynchronous-unwind-tables"
46+
4147
aesara.config.gcc__cxxflags = augmented
4248

4349

0 commit comments

Comments
 (0)