diff --git a/debian/rules b/debian/rules index 02e03001509..64866631839 100644 --- a/debian/rules +++ b/debian/rules @@ -4,6 +4,11 @@ # https://wiki.debian.org/Hardening export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Disable LTO on Ubuntu, see LP: #1970634 and https://jira.mariadb.org/browse/MDEV-25633 +ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes), yes) + export DEB_BUILD_MAINT_OPTIONS += optimize=-lto +endif + DPKG_EXPORT_BUILDFLAGS = 1 # Include all defaults, including buildflags.mk include /usr/share/dpkg/default.mk