Skip to content

Commit

Permalink
toplevel-reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
sbird committed Dec 13, 2024
1 parent a1b5f95 commit 288a468
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/agb_flash.c
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/agb_flash_1m.c
Original file line number Diff line number Diff line change
@@ -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[] =
Expand Down
2 changes: 2 additions & 0 deletions src/agb_flash_le.c
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/agb_flash_mx.c
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/librfu_intr.c
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/librfu_rfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/librfu_sio32id.c
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/librfu_stwi.c
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/m4a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down
2 changes: 2 additions & 0 deletions src/m4a_tables.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 288a468

Please sign in to comment.