‘--as-needed’ is a linker option. It affects linking of dynamic
libraries which follow the ‘—as-needed’ flag on the linker command
line. Normally, the linker will generate a runtime dependency against
all dynamic libraries mentioned on command line regardless of whether
libraries are actually needed or not. ‘--as-needed’ option causes
dependency to be only emitted for a library that at that point in the
link.
Change-Id: Id7306902cfcb495825b9f708b55364479a8fb545
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
%endif
########## compilation flags ##########
-%define __global_cflags -O2 -g2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector -Wformat-security -fmessage-length=0
+%define __global_cflags -O2 -g2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector -Wformat-security -fmessage-length=0 -Wl,--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
Optflags: aarch64 %{__global_cflags} -feliminate-unused-debug-types -Wformat -march=armv8-a+fp+simd+crc+crypto -mtune=cortex-a57.cortex-a53