diff --git a/Makefile.ngc b/Makefile.ngc index 4b8c0c7c63..fd8b6ff696 100644 --- a/Makefile.ngc +++ b/Makefile.ngc @@ -4,6 +4,8 @@ DEBUG = 0 HAVE_LOGGER = 1 HAVE_FILE_LOGGER = 0 PERF_TEST = 0 +WHOLE_ARCHIVE_LINK = 0 +BIG_STACK = 0 PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7" PC_DEVELOPMENT_UDP_PORT = 3490 @@ -32,8 +34,15 @@ LIBDIRS := -L$(DEVKITPRO)/libogc/lib/cube -L. MACHDEP := -DGEKKO -DHW_DOL -mogc -mcpu=750 -meabi -mhard-float CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE) -LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map -T gx/ld/ogc.ld -LIBS := -lfat -lretro_ngc -logc +ifeq ($(WHOLE_ARCHIVE_LINK), 1) + WHOLE_START := -Wl,--whole-archive + WHOLE_END := -Wl,--no-whole-archive +endif +LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map +ifeq ($(BIG_STACK), 1) + LDFLAGS += -T gx/ld/ogc.ld +endif +LIBS := -lfat $(WHOLE_START) -lretro_ngc $(WHOLE_END) -logc OBJ = console/griffin/griffin.o diff --git a/Makefile.wii b/Makefile.wii index d90446e342..ba0a331efb 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -4,7 +4,8 @@ DEBUG = 0 HAVE_LOGGER = 0 HAVE_FILE_LOGGER = 0 PERF_TEST = 0 -WHOLE_ARCHIVE_LINK = 0 +WHOLE_ARCHIVE_LINK = 0 +BIG_STACK = 0 PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.100" PC_DEVELOPMENT_UDP_PORT = 3490 @@ -36,10 +37,13 @@ LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii -L. MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE) ifeq ($(WHOLE_ARCHIVE_LINK), 1) -WHOLE_START := -Wl,--whole-archive -WHOLE_END := -Wl,--no-whole-archive + WHOLE_START := -Wl,--whole-archive + WHOLE_END := -Wl,--no-whole-archive +endif +LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size +ifeq ($(BIG_STACK), 1) + LDFLAGS += -T gx/ld/rvl.ld endif -LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size -T gx/ld/rvl.ld LIBS := -lfat $(WHOLE_START) -lretro_wii $(WHOLE_END) -logc $(LDFLAGS_WIIUSE) -lbte APP_BOOTER_DIR = wii/app_booter diff --git a/dist-scripts/ngc-cores.sh b/dist-scripts/ngc-cores.sh index e9eb06f5da..62b3139774 100755 --- a/dist-scripts/ngc-cores.sh +++ b/dist-scripts/ngc-cores.sh @@ -5,12 +5,15 @@ make -C ../ -f Makefile.ngc clean || exit 1 for f in *_ngc.a ; do name=`echo "$f" | sed 's/\(_libretro\|\)_ngc.a$//'` whole_archive= + big_stack= if [ $name = "nxengine" ] ; then whole_archive="WHOLE_ARCHIVE_LINK=1" - echo $name yes + fi + if [ $name = "tyrquake" ] ; then + big_stack="BIG_STACK=1" fi cp -f "$f" ../libretro_ngc.a - make -C ../ -f Makefile.ngc $whole_archive -j3 || exit 1 + make -C ../ -f Makefile.ngc $whole_archive $big_stack -j3 || exit 1 mv -f ../retroarch_ngc.dol ../ngc/pkg/$name.dol rm -f ../retroarch_ngc.dol ../retroarch_ngc.elf ../retroarch_ngc.elf.map done diff --git a/dist-scripts/wii-cores.sh b/dist-scripts/wii-cores.sh index cc0ed766cf..0d90919069 100755 --- a/dist-scripts/wii-cores.sh +++ b/dist-scripts/wii-cores.sh @@ -9,12 +9,15 @@ make -C ../ -f Makefile.wii.salamander pkg || exit 1 for f in *_wii.a ; do name=`echo "$f" | sed 's/\(_libretro\|\)_wii.a$//'` whole_archive= + big_stack= if [ $name = "nxengine" ] ; then whole_archive="WHOLE_ARCHIVE_LINK=1" - echo $name yes + fi + if [ $name = "tyrquake" ] ; then + big_stack="BIG_STACK=1" fi cp -f "$f" ../libretro_wii.a - make -C ../ -f Makefile.wii $whole_archive -j3 || exit 1 + make -C ../ -f Makefile.wii $whole_archive $big_stack -j3 || exit 1 mv -f ../retroarch_wii.dol ../wii/pkg/$name.dol rm -f ../retroarch_wii.dol ../retroarch_wii.elf ../retroarch_wii.elf.map done diff --git a/gx/ld/ogc.ld b/gx/ld/ogc.ld index 0086209667..d6d06bc2ce 100644 --- a/gx/ld/ogc.ld +++ b/gx/ld/ogc.ld @@ -257,7 +257,7 @@ SECTIONS } __isIPL = 0; -__stack_addr = (__bss_start + SIZEOF(.bss) + 0x40000 + 7) & (-8); +__stack_addr = (__bss_start + SIZEOF(.bss) + 0x80000 + 7) & (-8); __stack_end = (__bss_start + SIZEOF(.bss)); __intrstack_addr = (__stack_addr + 0x4000); __intrstack_end = (__stack_addr); diff --git a/gx/ld/rvl.ld b/gx/ld/rvl.ld index 7a9867c2f4..e790eec2db 100644 --- a/gx/ld/rvl.ld +++ b/gx/ld/rvl.ld @@ -268,7 +268,7 @@ SECTIONS } __isIPL = 0; -__stack_addr = (__bss_start + SIZEOF(.bss) + 0x40000 + 7) & (-8); +__stack_addr = (__bss_start + SIZEOF(.bss) + 0x80000 + 7) & (-8); __stack_end = (__bss_start + SIZEOF(.bss)); __intrstack_addr = (__stack_addr + 0x4000); __intrstack_end = (__stack_addr);