diff --git a/Makefile.arm11 b/Makefile.arm11 index 996007b..4422743 100644 --- a/Makefile.arm11 +++ b/Makefile.arm11 @@ -32,17 +32,17 @@ #--------------------------------------------------------------------------------- ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mthumb-interwork -CFLAGS := $(ARCH) -std=c11 -O2 -g -fstrict-aliasing -mword-relocations -fomit-frame-pointer \ +CFLAGS := $(ARCH) -std=c11 -O2 -g -flto -fstrict-aliasing -mword-relocations -fomit-frame-pointer \ -ffast-math -ffunction-sections -Wall -Wextra CFLAGS += $(INCLUDE) $(DEFINES) -CXXFLAGS := $(ARCH) -std=c11 -O2 -g -fno-rtti -fno-exceptions -fstrict-aliasing \ +CXXFLAGS := $(ARCH) -std=c11 -O2 -g -flto -fno-rtti -fno-exceptions -fstrict-aliasing \ -mword-relocations -fomit-frame-pointer -ffast-math -ffunction-sections -Wall -Wextra CXXFLAGS += $(INCLUDE) $(DEFINES) -ASFLAGS := $(ARCH) -g $(INCLUDE) $(DEFINES) +ASFLAGS := $(ARCH) -g -flto $(INCLUDE) $(DEFINES) -LDFLAGS = $(ARCH) -g -Wl,--use-blx,--gc-sections,-Map,$(notdir $*.map) -nostartfiles -T ../$(LDNAME) +LDFLAGS = $(ARCH) -g -flto -Wl,--use-blx,--gc-sections,-Map,$(notdir $*.map) -nostartfiles -T ../$(LDNAME) #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project diff --git a/include/arm11/main.h b/include/arm11/main.h index 4522d27..b060c90 100644 --- a/include/arm11/main.h +++ b/include/arm11/main.h @@ -1,4 +1,4 @@ #pragma once -extern bool g_poweroffAllowed; -extern bool g_startFirmLaunch; +extern volatile bool g_poweroffAllowed; +extern volatile bool g_startFirmLaunch; diff --git a/include/types.h b/include/types.h index 89d6554..262c353 100644 --- a/include/types.h +++ b/include/types.h @@ -10,6 +10,7 @@ #define PACKED __attribute__((packed)) +#define USED __attribute__((used)) #define UNUSED __attribute__((unused)) #define NAKED __attribute__((naked)) diff --git a/source/arm11/main.c b/source/arm11/main.c index 795c63d..6894259 100644 --- a/source/arm11/main.c +++ b/source/arm11/main.c @@ -9,8 +9,8 @@ #include "arm11/firm.h" -bool g_poweroffAllowed = false; -bool g_startFirmLaunch = false; +volatile bool g_poweroffAllowed = false; +volatile bool g_startFirmLaunch = false;