Skip to contentSkip to conversation

systemd: disable link time optimization

PATCH New Eric Le Bihan 2 participants 2 messages Aug 12, 2014 – Aug 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: disable link time optimization

As reported in https://bugs.busybox.net/show_bug.cgi?id=7286,
systemd fails to build with BR2_OPTIMIZE_2=y. This mode activates the GCC options -flto and -ffat-lto-objects, which do not mix well with the GCC tricks used in src/compat-libs/linkwarning.h to build the compatibility libraries.

As a temporary workaround, this patch disables link time optimization for systemd.

---
 package/systemd/systemd.mk | 3 +++
 1 file changed, 3 insertions(+)
package/systemd/systemd.mk +3 -0
index 9729276..edde998 100644
@@ -49,8 +49,11 @@ SYSTEMD_CONF_OPT += \
 	--disable-dbus \
 	--without-python
 
+SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
+
 # Override path to kmod, used in kmod-static-nodes.service
 SYSTEMD_CONF_ENV = \
+	CFLAGS="$(SYSTEMD_CFLAGS)" \
 	ac_cv_path_KMOD=/usr/bin/kmod
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_COMPAT),y)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 systemd: disable link time optimization

Dear Eric Le Bihan,

Quoted 6 lines · Eric Le Bihan

As reported in https://bugs.busybox.net/show_bug.cgi?id=7286,
systemd fails to build with BR2_OPTIMIZE_2=y. This mode activates the GCC options -flto and -ffat-lto-objects, which do not mix well with the GCC tricks used in src/compat-libs/linkwarning.h to build the compatibility libraries.

Quoted 7 lines

As a temporary workaround, this patch disables link time optimization for systemd.

---
 package/systemd/systemd.mk | 3 +++
 1 file changed, 3 insertions(+)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com