From 571e7eb5d272b9c6b0700fe49b14501e6f090c71 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Tue, 12 Nov 2024 01:57:52 +0000 Subject: [PATCH] haskellPackages: disable shared libraries on android-prebuilt Fixes build of `pkgsCross.aarch64-android-prebuilt.haskell.packages.ghc910.attoparsec`: ``` RPATH of binary /nix/store/g6ncgk2b04mv722hh2jgfbixyawbwabv-attoparsec-aarch64-unknown-linux-android-0.14.4/lib/ghc-9.10.1/lib/aarch64-android-ghc-9.10.1-inplace/libHSattoparsec-0.14.4-GkMCGqk5eKArKmd1r9IB7-ghc9.10.1.so contains a forbidden reference to /build/ ``` --- pkgs/development/haskell-modules/generic-builder.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 6e5cb29be5fb..4c7db9d149e9 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -82,7 +82,10 @@ in profilingDetail ? "exported-functions", # TODO enable shared libs for cross-compiling enableSharedExecutables ? false, - enableSharedLibraries ? !stdenv.hostPlatform.isStatic && (ghc.enableShared or false), + enableSharedLibraries ? + !stdenv.hostPlatform.isStatic + && (ghc.enableShared or false) + && !stdenv.hostPlatform.useAndroidPrebuilt, enableDeadCodeElimination ? (!stdenv.hostPlatform.isDarwin), # TODO: use -dead_strip for darwin # Disabling this for ghcjs prevents this crash: https://gitlab.haskell.org/ghc/ghc/-/issues/23235 enableStaticLibraries ?