core/pkgs/by-name/bi/binutils/packages.nix

67 lines
2.5 KiB
Nix
Raw Normal View History

2024-05-02 00:46:19 +00:00
{ lib, noSysDirs, ... }:
res: pkgs: super:
2024-06-30 08:12:46 +00:00
with pkgs; {
2024-05-02 00:46:19 +00:00
# Here we select the default bintools implementations to be used. Note when
# cross compiling these are used not for this stage but the *next* stage.
# That is why we choose using this stage's target platform / next stage's
# host platform.
#
# Because this is the *next* stages choice, it's a bit non-modular to put
# here. In theory, bootstraping is supposed to not be a chain but at tree,
# where each stage supports many "successor" stages, like multiple possible
# futures. We don't have a better alternative, but with this downside in
# mind, please be judicious when using this attribute. E.g. for building
# things in *this* stage you should use probably `stdenv.cc.bintools` (from a
# default or alternate `stdenv`), at build time, and try not to "force" a
# specific bintools at runtime at all.
#
# In other words, try to only use this in wrappers, and only use those
# wrappers from the next stage.
bintools-unwrapped =
let
inherit (stdenv.targetPlatform) linker;
in
2024-06-30 08:12:46 +00:00
if linker == "lld" then
llvmPackages.bintools-unwrapped
2024-05-02 00:46:19 +00:00
# else if linker == "cctools" then darwin.binutils-unwrapped
2024-06-30 08:12:46 +00:00
else if linker == "bfd" then
binutils-unwrapped
else if linker == "gold" then
binutils-unwrapped.override { enableGoldDefault = true; }
else
null;
2024-05-02 00:46:19 +00:00
bintoolsNoLibc = wrapBintoolsWith {
bintools = bintools-unwrapped;
libc = preLibcCrossHeaders;
};
2024-06-30 08:12:46 +00:00
bintools = wrapBintoolsWith { bintools = bintools-unwrapped; };
2024-05-02 00:46:19 +00:00
bintoolsDualAs = wrapBintoolsWith {
bintools = darwin.binutilsDualAs-unwrapped;
wrapGas = true;
};
binutils-unwrapped = callPackage ./. {
autoreconfHook = autoreconfHook269;
# FHS sys dirs presumably only have stuff for the build platform
noSysDirs = (stdenv.targetPlatform != stdenv.hostPlatform) || noSysDirs;
};
binutils-unwrapped-all-targets = callPackage ./. {
autoreconfHook = if targetPlatform.isiOS then autoreconfHook269 else autoreconfHook;
# FHS sys dirs presumably only have stuff for the build platform
noSysDirs = (stdenv.targetPlatform != stdenv.hostPlatform) || noSysDirs;
withAllTargets = true;
};
2024-06-30 08:12:46 +00:00
binutils = wrapBintoolsWith { bintools = binutils-unwrapped; };
2024-05-02 00:46:19 +00:00
binutils_nogold = lowPrio (wrapBintoolsWith {
2024-06-30 08:12:46 +00:00
bintools = binutils-unwrapped.override { enableGold = false; };
2024-05-02 00:46:19 +00:00
});
binutilsNoLibc = wrapBintoolsWith {
bintools = binutils-unwrapped;
libc = preLibcCrossHeaders;
};
libbfd = callPackage ./libbfd.nix { };
}