From 26a172ef41e38be61d19fa47697d5469ed862794 Mon Sep 17 00:00:00 2001 From: Dongkyun Son Date: Tue, 20 Feb 2024 15:27:44 +0900 Subject: [PATCH] Tizen-Base-Toolchain: update project_config add macros for _lto_flag_enable and lto_incompatible_pkgs Change-Id: I4305c5b1c098a3b2af4ead1a5a5aab6897d6f7f0 Signed-off-by: Dongkyun Son --- TIZEN/Tizen/Tizen-Base-Toolchain/project_config | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/TIZEN/Tizen/Tizen-Base-Toolchain/project_config b/TIZEN/Tizen/Tizen-Base-Toolchain/project_config index 46037b4..130bcbc 100644 --- a/TIZEN/Tizen/Tizen-Base-Toolchain/project_config +++ b/TIZEN/Tizen/Tizen-Base-Toolchain/project_config @@ -254,12 +254,23 @@ Substitute: libgcc_s1-32bit libgcc-32bit Substitute: glibc-devel-32bit %endif +%ifarch aarch64 +Macros: +%_lto_flag -fvisibility=hidden -flto +%lto_incompatible_pkgs alsa-lib autogen binuils binutils-armv7hl binutils-armv7l binutils-riscv64 bzip2 ccache cmake db4 doxygen e2fsprogs elfutils expect fribidi gcc gcc-armv7hl gcc-armv7l gcc-riscv64 gettext glibc gn guile help2man iproute2 iptables itstool keyutils krb5 libcap libevent libjpeg-turbo libnl2 libnl3 libsigc++ libsndfile libunistring libunwind libwebp libxml2 libxslt llvm lttng-ust lua mtdev ncurses net-tools nghttp2 ninja nss openfst openssl openssl1.1 openssl3 pam perl perl-DBD-SQLite popt python python3 python3-base smack texinfo userspace-rcu util-linux xmlsec1 xz zlib zstd +:Macros +%define _lto_flag -fvisibility=hidden -flto + +%define _lto_flag_enable %{lua:if (nil == string.find(" " .. rpm.expand("%lto_incompatible_pkgs") .. " "," " .. rpm.expand("%name") .. " ", 1, true)) then print(rpm.expand("%_lto_flag")) end} +%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 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 -Optflags: aarch64 %{__global_cflags} -feliminate-unused-debug-types -Wformat -march=armv8-a+fp+simd+crc+crypto -mtune=cortex-a57.cortex-a53 -fvisibility=hidden -flto +Optflags: aarch64 %{__global_cflags} -feliminate-unused-debug-types -Wformat -march=armv8-a+fp+simd+crc+crypto -mtune=cortex-a57.cortex-a53 %{?_lto_flag_enable} Optflags: i686 %{__global_cflags} -feliminate-unused-debug-types --param=ssp-buffer-size=4 -fdiagnostics-color=never -m32 -march=i686 -mtune=i686 -msse4.2 -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -mstackrealign -Wl,-z,noseparate-code Optflags: x86_64 %{__global_cflags} -feliminate-unused-debug-types --param=ssp-buffer-size=4 -fdiagnostics-color=never -m64 -march=nehalem -msse4.2 -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer Optflags: riscv64 %{__global_cflags} -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -- 2.7.4