From 5d006774c0de6e698ad96bdc0dd3acf779b167da Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 12 Oct 2025 14:30:04 -0400 Subject: [PATCH] openssl: help build system to detect cross builds Specifically, some tests that rely on build and host platforms using the same libc will then be skipped. --- pkgs/development/libraries/openssl/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 0d4e99a4394b..cf34b3325180 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -191,6 +191,11 @@ let "--openssldir=/.$(etc)/etc/ssl" ) ] + # Tell build system it's cross environment. This allows to skip tests + # that would fail when libc is different. Otherwise, run the tests. + ++ lib.optional ( + !lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform + ) "--cross-compile-prefix=${lib.getBin stdenv.cc}/bin/" ++ lib.optionals withCryptodev [ "-DHAVE_CRYPTODEV" "-DUSE_CRYPTODEV_DIGESTS"