Add -flto to CXXFLAGS
Per openbmc/openbmc#3364, adding -flto to CXX flags
in order to reduce overall library and binary sizes.
Ref: https://gcc.gnu.org/wiki/LinkTimeOptimization
Change-Id: Idacb03d1ce6ad0253979f5e8b2638ac5129a6216
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/Makefile.am b/Makefile.am
index 7912a11..cf45c3b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,7 +32,8 @@
ipmid_CXXFLAGS = -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\" \
$(BOOST_CXX) \
$(PHOSPHOR_LOGGING_CFLAGS) \
- $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+ $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
+ -flto
ipmid_LDFLAGS = \
$(SYSTEMD_LIBS) \
$(libmapper_LIBS) \
@@ -97,7 +98,8 @@
-version-info 0:0:0 -shared
libipmi20_la_CXXFLAGS = $(SYSTEMD_CFLAGS) $(libmapper_CFLAGS) \
$(BOOST_CXX) $(PHOSPHOR_LOGGING_CFLAGS) \
- $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+ $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
+ -flto
libsysintfcmdsdir = ${libdir}/ipmid-providers
libsysintfcmds_LTLIBRARIES = libsysintfcmds.la
@@ -115,7 +117,8 @@
$(libmapper_CFLAGS) \
$(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
$(PHOSPHOR_LOGGING_CFLAGS) \
- $(SDBUSPLUS_CFLAGS)
+ $(SDBUSPLUS_CFLAGS) \
+ -flto
nobase_include_HEADERS = \
host-ipmid/ipmid-api.h \