From c7b90f739ff7e9ea5e176d08e0713652450bdb27 Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 11 Apr 2016 15:53:59 +0200 Subject: [PATCH] Use fLTO to reduce the binary size --- Makefile | 4 ++-- loader/Makefile | 2 +- screeninit/Makefile | 2 +- source/memory.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e5036c3..65b90f8 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ dir_build := build dir_out := out ASFLAGS := -mlittle-endian -mcpu=arm946e-s -march=armv5te -CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -ffast-math +CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -flto -ffast-math FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-friendly 3DS CFW." APP_AUTHOR="Reisyukaku/Aurora Wright" --no-print-directory objects_cfw = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \ @@ -114,7 +114,7 @@ $(dir_build)/%.o: $(dir_source)/%.s $(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.c @mkdir -p "$(@D)" - $(COMPILE.c) -Wno-unused-function $(OUTPUT_OPTION) $< + $(COMPILE.c) $(OUTPUT_OPTION) $< $(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.s @mkdir -p "$(@D)" diff --git a/loader/Makefile b/loader/Makefile index 183f193..8f9c035 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -29,7 +29,7 @@ SOURCES := source source/fatfs source/fatfs/sdmmc source/fatfs/option #--------------------------------------------------------------------------------- ARCH := -mthumb -mthumb-interwork -CFLAGS := -g -Wall -O2\ +CFLAGS := -g -Wall -O2 -flto\ -march=armv5te -mtune=arm946e-s\ -ffast-math -Wno-main -std=c99\ $(ARCH) diff --git a/screeninit/Makefile b/screeninit/Makefile index 7fa9bf2..21ec57f 100755 --- a/screeninit/Makefile +++ b/screeninit/Makefile @@ -29,7 +29,7 @@ SOURCES := source #--------------------------------------------------------------------------------- ARCH := -mthumb -mthumb-interwork -CFLAGS := -g -Wall -O2\ +CFLAGS := -g -Wall -O2 -flto\ -mcpu=mpcore -mlittle-endian\ -ffast-math -Wno-main -std=c99\ $(ARCH) diff --git a/source/memory.c b/source/memory.c index 93f6e04..0df7fbf 100644 --- a/source/memory.c +++ b/source/memory.c @@ -17,7 +17,7 @@ void memcpy(void *dest, const void *src, u32 size) destc[i] = srcc[i]; } -void memset(void *dest, int filler, u32 size) +void __attribute__((used)) memset(void *dest, int filler, u32 size) { u8 *destc = (u8 *)dest;