···212 url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch";
213 sha256 = "0r4zjj0bv1x1m2dgxp3adsf2xkr94fjnyj1igsivd9ilbs5ja0b5";
214 })
215+ ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
216+217+ # Prevent the paths module from emitting symbols that we don't use
218+ # when building with separate outputs.
219+ #
220+ # These cause problems as they're not eliminated by GHC's dead code
221+ # elimination on aarch64-darwin. (see
222+ # https://github.com/NixOS/nixpkgs/issues/140774 for details).
223+ ./cabal-paths.patch
224 ];
225226 postPatch = "patchShebangs .";