Files
gentoo/dev-lang/rust/rust-1.95.0.ebuild
Sam James 0a892e7951 dev-lang/rust: fix cross-compilation
libssh2-sys was passing -I/usr/include -I/usr/${CHOST}/include to
the compiler, which would then pick up the multilib wrapper for dev-libs/openssl
for CBUILD and break the build. After a lot of trial and error, it seems
this comes from where zlib is used [0]. Use static zlib instead (which
disables searching for zlib in the zlib-sys crate and builds its own). It
seems Google ran into this at some point too [1].

(This happened with mips-linux-gnu.)

In the process of debugging that, I found the PKG_CONFIG_* exports to be
a bit risky in terms of possibly breaking the build in unexpected ways, so
I've changed them to be scoped to the right target, ditto the OPENSSL_* vars.

[0] https://github.com/alexcrichton/ssh2-rs/blob/libssh2-sys-0.3.1/libssh2-sys/build.rs#L153
[1] https://issues.chromium.org/issues/357917328

Bug: https://bugs.gentoo.org/978022
Signed-off-by: Sam James <sam@gentoo.org>
2026-07-05 03:25:11 +01:00

28 KiB