mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
0cac1f100d
Some GHC bindists have a normal `$out/lib` directory which contains symlinks to all core libs. Because it is a normal lib directory, the bintools setup hook will pick up on it and cause ld to pass the appropriate -L and -rpath flags. We do not want this to happen, especially in the case of the stage2 compiler. Not only will the final ghc have an unnecessary reference (and thus increased closure size) to the binary ghc, but the extra libraries in the rpath mess with the rts and cause e.g. segfaults in GHCi. Unfortunately, there is no way to prevent this. It is a fundamental flaw in the cc and bintools wrappers that they do not actually distinguish between the roles of dependencies (build, host, target). Instead the mangleVar* function will translate the dependencies split up by roles into platforms. This means that the wrappers can't distinguish between depsBuildBuild and depsHostTarget (== buildInputs) when natively compiling. As long as we are natively compiling the wrappers will put the stage0 ghc (be it in depsBuildBuild, nativeBuildInputs etc.) into the linker flags of the final ghc. The solution is to sidestep the issue. We just had ghc in depsBuildBuild to have it added to PATH. GHC itself will pass the appropriate linker flags if necessary. To avoid the setup hooks picking up on the GHC libraries we just don't put it into depsBuildBuild or any other dependency list. Since the GHC build system accepts the GHC binary via an absolute path, we don't even need to add the stage0 GHC to PATH. |
||
---|---|---|
.. | ||
pkg-config | ||
ada-packages.nix | ||
agda-packages.nix | ||
aliases.nix | ||
all-packages.nix | ||
beam-packages.nix | ||
by-name-overlay.nix | ||
config.nix | ||
coq-packages.nix | ||
cubocore-packages.nix | ||
cuda-packages.nix | ||
darwin-aliases.nix | ||
darwin-packages.nix | ||
default.nix | ||
dhall-packages.nix | ||
dotnet-packages.nix | ||
emacs-packages.nix | ||
emilua-plugins.nix | ||
emscripten-packages.nix | ||
gnuradio-packages.nix | ||
hare-third-party.nix | ||
haskell-packages.nix | ||
haxe-packages.nix | ||
impure.nix | ||
java-packages.nix | ||
kodi-packages.nix | ||
linux-kernels.nix | ||
lua-packages.nix | ||
make-tarball.nix | ||
metrics.nix | ||
nim-overrides.nix | ||
nixpkgs-basic-release-checks.nix | ||
ocaml-packages.nix | ||
octave-packages.nix | ||
packages-config.nix | ||
perl-packages.nix | ||
php-packages.nix | ||
python2-packages.nix | ||
python-aliases.nix | ||
python-packages.nix | ||
qt5-packages.nix | ||
qt6-packages.nix | ||
release-alternatives.nix | ||
release-attrpaths-superset.nix | ||
release-cross.nix | ||
release-cuda.nix | ||
release-haskell.nix | ||
release-lib.nix | ||
release-outpaths.nix | ||
release-python.nix | ||
release-r.nix | ||
release-small.nix | ||
release.nix | ||
ruby-packages.nix | ||
splice.nix | ||
stage.nix | ||
unixtools.nix | ||
wine-packages.nix |