From b70d0bd98068028d33f9a825a07a7b71e1b54e5e Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Thu, 4 Aug 2022 13:29:04 +0200 Subject: [PATCH] Disable LTO on non-amd64 builds Coroutines fail with LTO on non-amd64 architectures, see: - https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1921664 - https://bugzilla.redhat.com/show_bug.cgi?id=1952483 Debian doesn't enable LTO by default yet, but this is likely to happen at some point [1]. For the moment this fixes Debian builds when LTO is manually enabled and builds in downstream distros where LTO is enabled by default (e.g. Ubuntu). [1] https://lists.debian.org/debian-devel/2022/06/msg00092.html LP: #1921664 --- debian/rules | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/rules b/debian/rules index f6aabc91f2..39fe1c50a0 100755 --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,13 @@ ifeq (${DEB_HOST_MULTIARCH},) $(foreach d, $(shell dpkg-architecture | sed 's/=/?=/'), $(eval export $d)) endif +# Disable LTO on non-amd64 builds, see: +# https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1921664 +# https://bugzilla.redhat.com/show_bug.cgi?id=1952483 +ifneq ($(DEB_HOST_ARCH),amd64) + export DEB_BUILD_MAINT_OPTIONS += optimize=-lto +endif + ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) VENDOR := UBUNTU DEB_BUILD_PARALLEL = yes -- GitLab