diff mbox

[1/1] systemd: disable link time optimization

Message ID 1407875307-12036-1-git-send-email-eric.le.bihan.dev@free.fr
State Accepted
Headers show

Commit Message

Eric Le Bihan Aug. 12, 2014, 8:28 p.m. UTC
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.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/systemd/systemd.mk | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Petazzoni Aug. 15, 2014, 8:31 p.m. UTC | #1
Dear Eric Le Bihan,

On Tue, 12 Aug 2014 22:28:27 +0200, Eric Le Bihan wrote:
> 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.
> 
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> ---
>  package/systemd/systemd.mk | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks.

Thomas
diff mbox

Patch

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 9729276..edde998 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -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)