diff options
| author | Alex Tunstall <alex@tunstall.xyz> | 2023-07-23 10:01:19 +0100 |
|---|---|---|
| committer | sternenseemann <sternenseemann@systemli.org> | 2024-09-08 23:50:05 +0200 |
| commit | 884a76c5e61c25d94695433101b9a9d46814193d (patch) | |
| tree | a38b67688669430b07173812b6bd34e92a58300b /pkgs/development/python-modules/httpserver | |
| parent | bd331dc379a1f3e6967d7e98e032a860ed30fccb (diff) | |
haskell.compiler.ghc*: use host->target CC and tools in settings
GHC's build system assumes that the C compiler, tools etc. discovered
during configure can also be used at runtime. This means that the CC,
LD, AR etc. variables given at runtime are used to populate the settings
file which GHC uses to lookup the tools it needs.
The implicit assumption of this mechanism is that the build and runtime
environment of GHC are similar enough and PATH is used to find the
tools. I. e. if we set CC=clang, we wouldn't need to worry about this as
much. We, however, pass absolute paths which is useful since it allows
GHC to work outside of stdenv (as long as e. g. no FFI is involved).
Even so, until now, we didn't really have any problems stemming from
this, as we used pkgsBuildTarget to get everything we need. The
compiler we'd want to execute would in principle need to come
from pkgsHostTarget.
1. For native compilers, all package sets are the same since
build == host == target.
2. For cross compilers build == host, so pkgsBuildTarget
is practically the same as pkgsHostTarget.
When cross-compiling a native compiler, build != host, so we need to
actually ensure that GHC uses different tools at runtime compared to
bootstrapping. There is currently no intended way to achieve this, so we
use a custom tool to edit the settings file. An alternative would be to
patch the build system, but this would be difficult to maintain. We
could go down this route if there's interest from upstream to provide a
proper way to specify the runtime tools.
Co-authored-by: sternenseemann <sternenseemann@systemli.org>
Diffstat (limited to 'pkgs/development/python-modules/httpserver')
0 files changed, 0 insertions, 0 deletions
