From a6a0528a24a3a415278328c4b19f69ae226fb756 Mon Sep 17 00:00:00 2001 From: Dongkyun Son Date: Thu, 18 Jan 2024 17:02:38 +0900 Subject: [PATCH] Base-Toolchain: optimize option O2 -> Os Binary size and performance need to be evaluated with the change. -Os Optimize for size. -Os enables all -O2 optimizations except those that often increase code size: -falign-functions -falign-jumps -falign-labels -falign-loops -fprefetch-loop-arrays -freorder-blocks-algorithm=stc It also enables -finline-functions, causes the compiler to tune for code size rather than execution speed, and performs further optimizations designed to reduce code size. Change-Id: I5d7d0ebfa3f0d311439e0b67aa3def8e02fc52c6 Signed-off-by: Dongkyun Son --- TIZEN/Tizen/Tizen-Base-Toolchain/project_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TIZEN/Tizen/Tizen-Base-Toolchain/project_config b/TIZEN/Tizen/Tizen-Base-Toolchain/project_config index 73ede57..6c92223 100644 --- a/TIZEN/Tizen/Tizen-Base-Toolchain/project_config +++ b/TIZEN/Tizen/Tizen-Base-Toolchain/project_config @@ -244,7 +244,7 @@ Substitute: glibc-devel-32bit %endif ########## compilation flags ########## -%define __global_cflags -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -fmessage-length=0 -frecord-gcc-switches -Wl,-z,relro,--as-needed +%define __global_cflags -Os -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -fmessage-length=0 -frecord-gcc-switches -Wl,-z,relro,--as-needed Optflags: armv7l %{__global_cflags} --param=ssp-buffer-size=4 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -mthumb -Wp,-D__SOFTFP__ -Wl,-O1 -Wl,--hash-style=gnu -Wa,-mimplicit-it=thumb -D_FILE_OFFSET_BITS=64 Optflags: armv7hl %{__global_cflags} --param=ssp-buffer-size=4 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=hard -mthumb -Wl,-O1 -Wl,--hash-style=gnu -Wa,-mimplicit-it=thumb -D_FILE_OFFSET_BITS=64 -- 2.7.4