Base-Toolchain: optimize option O2 -> Os 14/304514/2
authorDongkyun Son <dongkyun.s@samsung.com>
Thu, 18 Jan 2024 08:02:38 +0000 (17:02 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Mon, 29 Jan 2024 05:20:02 +0000 (05:20 +0000)
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 <dongkyun.s@samsung.com>
TIZEN/Tizen/Tizen-Base-Toolchain/project_config

index 73ede57..6c92223 100644 (file)
@@ -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