summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Barinov <v.barinov@samsung.com>2023-03-20 10:22:29 +0300
committerDongkyun Son <dongkyun.s@samsung.com>2023-06-28 13:01:33 +0900
commit4b1e53accb8ddd17fa2280bb9a1ceb35f42832ca (patch)
tree340a5a918360efa6610184be0b5c73a2f7e0b924
parent9086b711be0947f1ddbdf4061212c5a2968ae12c (diff)
downloadrpm-4b1e53accb8ddd17fa2280bb9a1ceb35f42832ca.tar.gz
rpm-4b1e53accb8ddd17fa2280bb9a1ceb35f42832ca.tar.bz2
rpm-4b1e53accb8ddd17fa2280bb9a1ceb35f42832ca.zip
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 <v.barinov@samsung.com>
-rw-r--r--packaging/rpm-tizen_macros9
-rw-r--r--packaging/rpm.spec5
2 files changed, 14 insertions, 0 deletions
diff --git a/packaging/rpm-tizen_macros b/packaging/rpm-tizen_macros
index 843a6587e..dbedbf7eb 100644
--- a/packaging/rpm-tizen_macros
+++ b/packaging/rpm-tizen_macros
@@ -94,6 +94,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 ; \
@@ -115,6 +118,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 ; \
@@ -136,6 +142,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 a5c031de3..d5a585ed3 100644
--- a/packaging/rpm.spec
+++ b/packaging/rpm.spec
@@ -160,6 +160,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 \