The ebuild does not handle adding --with-cyrus-sasl or --without-cyrus-sasl properly when the minimal USE flag is set, and the default behaviour of checking for cyrus-sasl and using it if it is available. So, openldap will end up linking against it without the user's knowledge. Reproducible: Always Steps to Reproduce: 1. Install dev-libs/cyrus-sasl 2. Install net-nds/openldap with USE="minimal -sasl" 3. Check libldap linkage with e.g lddtree Actual Results: libldap does not link to libsasl2 as USE="-ldap is set" Expected Results: libldap does link to libsasl2 Package info: [ebuild R ] net-nds/openldap-2.6.4-r1:0/2.6::gentoo USE="argon2 crypt ipv6 minimal ssl syslog systemd -autoca -cleartext -cxx -debug -experimental -gnutls -iodbc -kerberos -kinit -odb -overlays -pbkdf2 -perl -samba -sasl (-selinux) -sha2 -smbkrb5passwd -static-libs -tcpd -test" ABI_X86="32 (64) (-x32)" 0 KiB [ebuild R ] dev-libs/cyrus-sasl-2.1.28-r4:2::gentoo USE="gdbm pam ssl urandom -authdaemond -berkdb -kerberos -ldapdb -mysql -openldap -postgres -sample (-selinux) -sqlite -srp -static-libs" ABI_X86="(64) -32 (-x32)" 0 KiB lddtree output: $ lddtree /usr/lib64/libldap.so.2.0.200 /usr/lib64/libldap.so.2.0.200 (interpreter => None) liblber.so.2 => /usr/lib64/liblber.so.2 libsasl2.so.3 => /usr/lib64/libsasl2.so.3 libssl.so.3 => /usr/lib64/libssl.so.3 libcrypto.so.3 => /usr/lib64/libcrypto.so.3 libc.so.6 => /usr/lib64/libc.so.6 ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2
> Actual Results: > libldap does not link to libsasl2 as USE="-ldap is set" > > Expected Results: > libldap does link to libsasl2 Whoops, got these backwards.