From 4f59e2fa23e1a8be23f95e12c9ee14b1124da002 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 31 Oct 2025 21:35:45 +0000 Subject: [PATCH] whisper: built with `-no-pie` (prebuilt libraries) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change the build fails as https://hydra.nixos.org/build/310775846: ld: libs/libz.a(deflate.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE ld: failed to set dynamic section sizes: bad value It happens because `libs/libz.a` comes from a "source" tarball. As some libraries are not packaged in `nixpkgs` let's fall back to `-no-pie`. Co-authored-by: Justin Bedő --- pkgs/by-name/wh/whisper/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/wh/whisper/package.nix b/pkgs/by-name/wh/whisper/package.nix index 08aa9ffc4c0b..9ce1836b25d3 100644 --- a/pkgs/by-name/wh/whisper/package.nix +++ b/pkgs/by-name/wh/whisper/package.nix @@ -35,6 +35,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + # The package comes with prebuilt static + # libraries of bzip2, zlib, libdeflate and asmlib. + # They are not built with -fPIE and thus linking fails. + # As asmlib is not packages in nixpkgs let's disable PIE. + env.NIX_LDFLAGS = "-no-pie"; + installPhase = '' runHook preInstall install -Dt $out/bin whisper whisper-index @@ -48,5 +54,6 @@ stdenv.mkDerivation rec { homepage = "https://github.com/refresh-bio/whisper"; maintainers = with maintainers; [ jbedo ]; platforms = platforms.x86_64; + sourceProvenance = [ sourceTypes.binaryNativeCode ]; }; }