commit:     6ea4d86aa5b5c3c3e685dc6e490767be7c630917
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 12 03:21:13 2025 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Thu Aug 14 05:01:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ea4d86a

net-dns/djbdns: mark as LTO-unsafe

Try doing it a little harder right from the start. djb software has a
reputation, and we don't really want to debug it.

Closes: https://bugs.gentoo.org/954231
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 net-dns/djbdns/djbdns-1.05-r40.ebuild | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/net-dns/djbdns/djbdns-1.05-r40.ebuild 
b/net-dns/djbdns/djbdns-1.05-r40.ebuild
index 3ceac85f940c..4bde149f4e9c 100644
--- a/net-dns/djbdns/djbdns-1.05-r40.ebuild
+++ b/net-dns/djbdns/djbdns-1.05-r40.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -83,6 +83,16 @@ src_prepare() {
 }
 
 src_compile() {
+       # djb is a skeptic when it comes to optimizing compilers. He doesn't 
like
+       # them "ruining" his code, thinks only algorithms matter for 
performance,
+       # and writes code that triggers UB warnings. Respect his point of view.
+       if is-flagq -O?; then
+               CFLAGS="-O2"
+       else
+               CFLAGS=""
+       fi
+       append-flags -fno-strict-aliasing
+
        # Bug 927539. This is beyond our ability to realistically fix due
        # to patch conflicts.
        append-cflags $(test-flags-CC -Wno-error=incompatible-pointer-types)

Reply via email to