commit:     7bfa843e2bec0fea79a22040d477cf42d1abe54c
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Sep 20 12:26:20 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 20 13:34:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bfa843e

net-dns/dnsdist: disable LTO for mixed C++/Rust configuration

There is currently no good or reliable way to make this work,
due to myriad combinations of compilers, linkers and limitations
of the Rust toolchain.

Closes: https://bugs.gentoo.org/963128
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Part-of: https://github.com/gentoo/gentoo/pull/43861
Closes: https://github.com/gentoo/gentoo/pull/43861
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-dns/dnsdist/dnsdist-2.0.1.ebuild | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net-dns/dnsdist/dnsdist-2.0.1.ebuild 
b/net-dns/dnsdist/dnsdist-2.0.1.ebuild
index 3efa0746c516..1891cad99c67 100644
--- a/net-dns/dnsdist/dnsdist-2.0.1.ebuild
+++ b/net-dns/dnsdist/dnsdist-2.0.1.ebuild
@@ -8,7 +8,7 @@ PYTHON_COMPAT=( python3_{11..14} )
 RUST_MIN_VER=1.85.1
 RUST_OPTIONAL=1
 
-inherit cargo flag-o-matic lua-single python-any-r1
+inherit cargo flag-o-matic lua-single python-any-r1 toolchain-funcs
 
 DESCRIPTION="A highly DNS-, DoS- and abuse-aware loadbalancer"
 HOMEPAGE="https://www.dnsdist.org/index.html";
@@ -77,6 +77,13 @@ src_configure() {
        # bug #822855
        append-lfs-flags
 
+       # There is currently no reliable way to handle mixed C++/Rust + LTO
+       # correctly: https://bugs.gentoo.org/963128
+       if use yaml && tc-is-lto ; then
+               ewarn "Disabling LTO because of mixed C++/Rust toolchains."
+               filter-lto
+       fi
+
        # some things can only be enabled/disabled by defines
        ! use dnstap && append-cppflags -DDISABLE_PROTOBUF
        ! use web && append-cppflags -DDISABLE_BUILTIN_HTML

Reply via email to