From 288a46806380c919fae022e7598a0738cdf571a0 Mon Sep 17 00:00:00 2001 From: sbird Date: Fri, 13 Dec 2024 15:18:26 +0100 Subject: [PATCH] toplevel-reorder --- Makefile | 4 +--- src/agb_flash.c | 2 ++ src/agb_flash_1m.c | 2 ++ src/agb_flash_le.c | 2 ++ src/agb_flash_mx.c | 2 ++ src/librfu_intr.c | 2 ++ src/librfu_rfu.c | 2 ++ src/librfu_sio32id.c | 2 ++ src/librfu_stwi.c | 2 ++ src/m4a.c | 2 ++ src/m4a_tables.c | 2 ++ 11 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 71d2a48af9a3..df87b8c75edc 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ CPPFLAGS := $(INCLUDE_CPP_ARGS) -Wno-trigraphs -DMODERN=1 -DTESTING=$(TEST) ARMCC := $(PREFIX)gcc PATH_ARMCC := PATH="$(PATH)" $(ARMCC) CC1 := $(shell $(PATH_ARMCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init +override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init ifeq ($(ANALYZE),1) override CFLAGS += -fanalyzer endif @@ -344,9 +344,7 @@ ifeq ($(COMPETITIVE_PARTY_SYNTAX),1) %.h: %.party ; $(CPP) $(CPPFLAGS) -traditional-cpp - < $< | $(TRAINERPROC) -o $@ -i $< - endif -$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast $(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member -$(C_BUILDDIR)/pokedex_plus_hgss.o: CFLAGS := -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init # Annoyingly we can't turn this on just for src/data/trainers.h $(C_BUILDDIR)/data.o: CFLAGS += -fno-show-column -fno-diagnostics-show-caret diff --git a/src/agb_flash.c b/src/agb_flash.c index ffec206fee09..f1b6ada2a7e3 100644 --- a/src/agb_flash.c +++ b/src/agb_flash.c @@ -1,6 +1,8 @@ #include "gba/gba.h" #include "gba/flash_internal.h" +#pragma GCC optimize("no-toplevel-reorder") + static u8 sTimerNum; static u16 sTimerCount; static vu16 *sTimerReg; diff --git a/src/agb_flash_1m.c b/src/agb_flash_1m.c index 6fc4f3d60033..3c3d0af99c0a 100644 --- a/src/agb_flash_1m.c +++ b/src/agb_flash_1m.c @@ -1,6 +1,8 @@ #include "gba/gba.h" #include "gba/flash_internal.h" +#pragma GCC optimize("no-toplevel-reorder") + static const char AgbLibFlashVersion[] = "FLASH1M_V103"; static const struct FlashSetupInfo * const sSetupInfos[] = diff --git a/src/agb_flash_le.c b/src/agb_flash_le.c index 39d956e2778a..09cebe2ff805 100644 --- a/src/agb_flash_le.c +++ b/src/agb_flash_le.c @@ -1,6 +1,8 @@ #include "gba/gba.h" #include "gba/flash_internal.h" +#pragma GCC optimize("no-toplevel-reorder") + const u16 leMaxTime[] = { 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, diff --git a/src/agb_flash_mx.c b/src/agb_flash_mx.c index 01f848901e76..ed41d034806b 100644 --- a/src/agb_flash_mx.c +++ b/src/agb_flash_mx.c @@ -1,6 +1,8 @@ #include "gba/gba.h" #include "gba/flash_internal.h" +#pragma GCC optimize("no-toplevel-reorder") + const u16 mxMaxTime[] = { 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, diff --git a/src/librfu_intr.c b/src/librfu_intr.c index ab4392e22964..63aed7566c2e 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -1,6 +1,8 @@ #include "global.h" #include "librfu.h" +#pragma GCC optimize("no-toplevel-reorder") + static void sio32intr_clock_master(void); static void sio32intr_clock_slave(void); static u16 handshake_wait(u16 slot); diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index 0097ac349ca6..adf88046dfa4 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -9,6 +9,8 @@ #warning "The Wireless Adapter hardware expects a username of no more than 8 bytes." #endif +#pragma GCC optimize("no-toplevel-reorder") + struct LLSFStruct { u8 frameSize; diff --git a/src/librfu_sio32id.c b/src/librfu_sio32id.c index 2a1b0c94c4eb..56439ab1a766 100644 --- a/src/librfu_sio32id.c +++ b/src/librfu_sio32id.c @@ -1,5 +1,7 @@ #include "librfu.h" +#pragma GCC optimize("no-toplevel-reorder") + static void Sio32IDIntr(void); static void Sio32IDInit(void); static s32 Sio32IDMain(void); diff --git a/src/librfu_stwi.c b/src/librfu_stwi.c index 13a7e340828c..6f712d432114 100644 --- a/src/librfu_stwi.c +++ b/src/librfu_stwi.c @@ -1,5 +1,7 @@ #include "librfu.h" +#pragma GCC optimize("no-toplevel-reorder") + static void STWI_intr_timer(void); static u16 STWI_init(u8 request); static s32 STWI_start_Command(void); diff --git a/src/m4a.c b/src/m4a.c index e90e9b06f0ac..ca014bce6d0e 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -2,6 +2,8 @@ #include "gba/m4a_internal.h" #include "global.h" +#pragma GCC optimize("no-toplevel-reorder") + extern const u8 gCgb3Vol[]; #define BSS_CODE __attribute__((section(".bss.code"))) diff --git a/src/m4a_tables.c b/src/m4a_tables.c index 4d012cea2820..c3a45dea4ed7 100644 --- a/src/m4a_tables.c +++ b/src/m4a_tables.c @@ -1,5 +1,7 @@ #include "gba/m4a_internal.h" +#pragma GCC optimize("no-toplevel-reorder") + // Some of these functions have different signatures, so we need to make this // an array of void pointers or a struct. It's simpler to just make it an array // for now.