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-07 19:52:19 +0900
commitbb14062fd485c1eb94e9d49d08f3dbe7d4d4fe1f (patch)
tree84575e334cb3078144d413a7865fda7afccf88c8
parent98c33f83790ffc40562267d7adc84469959c88df (diff)
downloadrpm-tizen_base_dev.tar.gz
rpm-tizen_base_dev.tar.bz2
rpm-tizen_base_dev.zip
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 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 \