From 152def19c07d60b909e289772cb5061f868b0664 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 1 Dec 2020 17:34:09 -0800 Subject: [PATCH] kern: build as -Os instead of -O2 --- libraries/config/templates/mesosphere.mk | 2 +- libraries/libmesosphere/Makefile | 2 +- .../libmesosphere/include/mesosphere/kern_k_auto_object.hpp | 6 +++--- .../include/mesosphere/kern_k_scheduler_lock.hpp | 2 +- .../mesosphere/kern_k_scoped_scheduler_lock_and_sleep.hpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/config/templates/mesosphere.mk b/libraries/config/templates/mesosphere.mk index 19a8dd2a0..142dfc852 100644 --- a/libraries/config/templates/mesosphere.mk +++ b/libraries/config/templates/mesosphere.mk @@ -7,7 +7,7 @@ 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 -Wextra -Werror -fno-non-call-exceptions +export SETTINGS := $(ATMOSPHERE_SETTINGS) -Os -mgeneral-regs-only -ffixed-x18 -Wextra -Werror -fno-non-call-exceptions export CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) export CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit export ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) diff --git a/libraries/libmesosphere/Makefile b/libraries/libmesosphere/Makefile index 14e7bc50d..7e8c26d0b 100644 --- a/libraries/libmesosphere/Makefile +++ b/libraries/libmesosphere/Makefile @@ -11,7 +11,7 @@ include $(CURRENT_DIRECTORY)/../config/common.mk PRECOMPILED_HEADERS := include/mesosphere.hpp DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_MESOSPHERE -SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -mgeneral-regs-only -ffixed-x18 -Wextra -Werror -fno-non-call-exceptions +SETTINGS := $(ATMOSPHERE_SETTINGS) -Os -mgeneral-regs-only -ffixed-x18 -Wextra -Werror -fno-non-call-exceptions CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit -flto ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp index e0000ad53..8f429bf55 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp @@ -192,13 +192,13 @@ namespace ams::kern { } public: constexpr ALWAYS_INLINE KScopedAutoObject() : obj(nullptr) { /* ... */ } - constexpr ALWAYS_INLINE KScopedAutoObject(T *o) : obj(o) { + constexpr KScopedAutoObject(T *o) : obj(o) { if (this->obj != nullptr) { this->obj->Open(); } } - ALWAYS_INLINE ~KScopedAutoObject() { + ~KScopedAutoObject() { if (this->obj != nullptr) { this->obj->Close(); } @@ -206,7 +206,7 @@ namespace ams::kern { } template requires (std::derived_from || std::derived_from) - constexpr ALWAYS_INLINE KScopedAutoObject(KScopedAutoObject &&rhs) { + constexpr KScopedAutoObject(KScopedAutoObject &&rhs) { if constexpr (std::derived_from) { /* Upcast. */ this->obj = rhs.obj; diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp index 355719f13..b9beaf49d 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp @@ -67,7 +67,7 @@ namespace ams::kern { } } - ALWAYS_INLINE void Unlock() { + void Unlock() { MESOSPHERE_ASSERT_THIS(); MESOSPHERE_ASSERT(this->IsLockedByCurrentThread()); MESOSPHERE_ASSERT(this->lock_count > 0); diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_scoped_scheduler_lock_and_sleep.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_scoped_scheduler_lock_and_sleep.hpp index f7f973b11..37b1cfbf3 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_scoped_scheduler_lock_and_sleep.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_scoped_scheduler_lock_and_sleep.hpp @@ -37,7 +37,7 @@ namespace ams::kern { *out_timer = this->timer; } - ALWAYS_INLINE ~KScopedSchedulerLockAndSleep() { + ~KScopedSchedulerLockAndSleep() { /* Register the sleep. */ if (this->timeout_tick > 0) { this->timer->RegisterAbsoluteTask(this->thread, this->timeout_tick);