diff --git a/repos/base-nova/lib/mk/base-nova-common.mk b/repos/base-nova/lib/mk/base-nova-common.mk index 81ebc9f3d3..e990dc33f7 100644 --- a/repos/base-nova/lib/mk/base-nova-common.mk +++ b/repos/base-nova/lib/mk/base-nova-common.mk @@ -14,3 +14,8 @@ SRC_CC += stack_area_addr.cc SRC_CC += cap_map.cc SRC_CC += capability.cc SRC_CC += signal_transmitter.cc + +# +# Prevent the compiler from deleting null pointer checks related to 'this == 0' +# +CC_OPT += -fno-delete-null-pointer-checks diff --git a/repos/base-nova/lib/mk/base-nova.mk b/repos/base-nova/lib/mk/base-nova.mk index 0040696ef0..3fb92e156f 100644 --- a/repos/base-nova/lib/mk/base-nova.mk +++ b/repos/base-nova/lib/mk/base-nova.mk @@ -4,3 +4,8 @@ LIBS += base-nova-common cxx timeout SRC_CC += thread_start.cc SRC_CC += cache.cc SRC_CC += signal.cc + +# +# Prevent the compiler from deleting null pointer checks related to 'this == 0' +# +CC_OPT += -fno-delete-null-pointer-checks