From accdf6dc34569e4ca6c0df0dbb314409dfac76fa Mon Sep 17 00:00:00 2001 From: Lightos1 <124387232+Lightos1@users.noreply.github.com> Date: Sun, 12 Apr 2026 01:05:11 +0200 Subject: [PATCH] fix Z - thanks masa! --- Source/hoc-clk/sysmodule/Makefile | 9 +++++---- Source/hoc-clk/sysmodule/src/file_utils.cpp | 7 ++++++- Source/hoc-clk/sysmodule/src/main.cpp | 12 ++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Source/hoc-clk/sysmodule/Makefile b/Source/hoc-clk/sysmodule/Makefile index c0d57a2e..27df7afb 100644 --- a/Source/hoc-clk/sysmodule/Makefile +++ b/Source/hoc-clk/sysmodule/Makefile @@ -40,15 +40,16 @@ DEFINES := -DDISABLE_IPC -DTARGET="\"$(TARGET)\"" -DTARGET_VERSION="\"$(TARGET_V ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -CFLAGS := -g -Wall -Os -ffunction-sections \ - $(ARCH) $(DEFINES) -ffast-math +CFLAGS := -g -Wall -Os \ + -ffast-math -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-unwind-tables \ + $(ARCH) $(DEFINES) CFLAGS += $(INCLUDE) -D__SWITCH__ -CXXFLAGS := $(CFLAGS) -fno-rtti -std=gnu++23 +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++23 ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) -Wl,-wrap,__cxa_throw -Wl,-wrap,_Unwind_Resume -Wl,-wrap,__gxx_personality_v0 LIBS := $(foreach lib,$(LIBNAMES),-l$(lib)) -lnx diff --git a/Source/hoc-clk/sysmodule/src/file_utils.cpp b/Source/hoc-clk/sysmodule/src/file_utils.cpp index 5e6a9d5c..7b25d668 100644 --- a/Source/hoc-clk/sysmodule/src/file_utils.cpp +++ b/Source/hoc-clk/sysmodule/src/file_utils.cpp @@ -82,7 +82,12 @@ namespace fileUtils { FILE* file = fopen(FILE_LOG_FILE_PATH, "a"); if (file) { - fprintf(file, "[%lu] ", armGetSystemTick()); + struct timespec now; + struct tm *timeInfo; + clock_gettime(CLOCK_REALTIME, &now); + timeInfo = localtime(&now.tv_sec); + + fprintf(file, "[%02d:%02d:%02d] ", timeInfo->tm_hour, timeInfo->tm_min, timeInfo->tm_sec); vfprintf(file, format, args); fprintf(file, "\n"); fclose(file); diff --git a/Source/hoc-clk/sysmodule/src/main.cpp b/Source/hoc-clk/sysmodule/src/main.cpp index 9921764c..8fdc4845 100644 --- a/Source/hoc-clk/sysmodule/src/main.cpp +++ b/Source/hoc-clk/sysmodule/src/main.cpp @@ -56,19 +56,19 @@ extern "C" // Ty to MasaGratoR for this! // This is done to save some space as they have no practical use in our case - __attribute__((used)) void* __real___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *)); - __attribute__((used)) void* __real__Unwind_Resume(); - __attribute__((used)) void* __real___gxx_personality_v0(); + void* __real___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *)); + void* __real__Unwind_Resume(); + void* __real___gxx_personality_v0(); - __attribute__((used)) void __wrap___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *)) { + void __wrap___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *)) { abort(); } - __attribute__((used)) void __wrap__Unwind_Resume() { + void __wrap__Unwind_Resume() { return; } - __attribute__((used)) void __wrap___gxx_personality_v0() { + void __wrap___gxx_personality_v0() { return; }