From bb14062fd485c1eb94e9d49d08f3dbe7d4d4fe1f Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Mon, 20 Mar 2023 10:22:29 +0300 Subject: Switch to gcc-ar, gcc-nm, gcc-ranlib Switching to Binutils wrappers for ar, nm and ranlib are required for proper functioning of Link-Time Optimization features. Currently full support of LTO plugin is not ready in Binutils, so we need to use wrappers to prevent "undefined reference" errors: https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ#ar.2C_nm_and_ranlib Change-Id: I7b6cdd8d29588014d9dc1d9ea8ec91414ae95260 Signed-off-by: Slava Barinov --- packaging/rpm-tizen_macros | 9 +++++++++ packaging/rpm.spec | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/packaging/rpm-tizen_macros b/packaging/rpm-tizen_macros index e5798b399..f3fa58cd1 100644 --- a/packaging/rpm-tizen_macros +++ b/packaging/rpm-tizen_macros @@ -89,6 +89,9 @@ # Tizen # %configure \ + AR="%__ar"; export AR ; \ + NM="%__nm"; export NM ; \ + RANLIB="%__ranlib"; export RANLIB ; \ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ @@ -110,6 +113,9 @@ %reconfigure \ + AR="%__ar"; export AR ; \ + NM="%__nm"; export NM ; \ + RANLIB="%__ranlib"; export RANLIB ; \ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ @@ -131,6 +137,9 @@ --infodir=%{_infodir} %autogen \ + AR="%__ar"; export AR ; \ + NM="%__nm"; export NM ; \ + RANLIB="%__ranlib"; export RANLIB ; \ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ diff --git a/packaging/rpm.spec b/packaging/rpm.spec index 8a4b3c71d..3dd31dddb 100644 --- a/packaging/rpm.spec +++ b/packaging/rpm.spec @@ -159,6 +159,11 @@ export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections" export CPPFLAGS="$CPPFLAGS -DHWASAN_BUILD" } +# Turn on Binutils wrappers to support LTO plugin for all architectures +export AR=gcc-ar +export NM=gcc-nm +export RANLIB=gcc-ranlib + %reconfigure \ --disable-dependency-tracking \ --with-lua \ -- cgit v1.2.3