diff --git a/libraries/config/templates/mesosphere.mk b/libraries/config/templates/mesosphere.mk index 542d6e970..a8a36c9e6 100644 --- a/libraries/config/templates/mesosphere.mk +++ b/libraries/config/templates/mesosphere.mk @@ -7,9 +7,9 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../common.mk # options for code generation #--------------------------------------------------------------------------------- export DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_MESOSPHERE -export SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -mgeneral-regs-only -ffixed-x18 -Werror +export SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -mgeneral-regs-only -ffixed-x18 -Werror -fno-non-call-exceptions export CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) -export CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) +export CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit export ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES) export LDFLAGS = -specs=$(TOPDIR)/$(notdir $(TOPDIR)).specs -nostdlib -nostartfiles -g $(SETTINGS) -Wl,-Map,$(notdir $*.map) -Wl,-z,relro,-z,now diff --git a/libraries/libmesosphere/Makefile b/libraries/libmesosphere/Makefile index e3047967b..d8799a192 100644 --- a/libraries/libmesosphere/Makefile +++ b/libraries/libmesosphere/Makefile @@ -7,9 +7,9 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../config/common.mk # options for code generation #--------------------------------------------------------------------------------- DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_MESOSPHERE -SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -mgeneral-regs-only -ffixed-x18 -Werror +SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -mgeneral-regs-only -ffixed-x18 -Werror -fno-non-call-exceptions CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) -CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -flto +CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit -flto ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) LIBS := diff --git a/libraries/libmesosphere/source/libc/kern_cxx.c b/libraries/libmesosphere/source/libc/kern_cxx.cpp similarity index 91% rename from libraries/libmesosphere/source/libc/kern_cxx.c rename to libraries/libmesosphere/source/libc/kern_cxx.cpp index 9d3dbd0de..9262db6f8 100644 --- a/libraries/libmesosphere/source/libc/kern_cxx.c +++ b/libraries/libmesosphere/source/libc/kern_cxx.cpp @@ -19,8 +19,7 @@ extern "C" { #endif -void __dso_handle() { /* ... */ } -void __cxa_atexit() { /* ... */ } +/* cxx implementation details to be stubbed here, as needed. */ #ifdef __cplusplus } /* extern "C" */