瀏覽代碼

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.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Eric Le Bihan 11 年之前
父節點
當前提交
d9054017cf
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      package/systemd/systemd.mk

+ 3 - 0
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)