forked from auxolotl/labs
Compare commits
4 commits
a5b66548d3
...
5bc3ec5eb0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bc3ec5eb0 | |||
| e2f6de0b11 | |||
| 76cd63f5fe | |||
| cb654dbfd0 |
35 changed files with 318 additions and 253 deletions
|
|
@ -1,9 +1,12 @@
|
|||
# Aux Tidepool
|
||||
|
||||
Aux Tidepool is an initial package set built on top of [Aux Foundation](../foundation). Packages
|
||||
are created and managed using [Aux Lib](../lib)'s module system to allow for highly dynamic and
|
||||
Aux Tidepool is an initial package set built on top of [Aux Foundation][foundation]. Packages
|
||||
are created and managed using [Aux Lib][lib]'s module system to allow for highly dynamic and
|
||||
extensible configuration.
|
||||
|
||||
[foundation]: https://git.auxolotl.org/auxolotl/foundation
|
||||
[lib]: https://git.auxolotl.org/auxolotl/lib
|
||||
|
||||
## Installation
|
||||
|
||||
Packages can be imported both with and without Nix Flakes. To import them using Nix Flakes,
|
||||
|
|
@ -32,19 +35,19 @@ in
|
|||
To build a package, you can run the following command inside of the `tidepool` directory:
|
||||
|
||||
```console
|
||||
nix-build -A packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix-build -A packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
If you have `nix-command` experimental feature enabled, you can v3 CLI instead:
|
||||
|
||||
```console
|
||||
nix build -f . packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix build -f . packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
Using flakes, the difference is only in calling:
|
||||
|
||||
```console
|
||||
nix build .#packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix build .#packages.foundation.bash.latest.packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
This interface is verbose, but stable. We are still working out the details for
|
||||
|
|
@ -53,44 +56,44 @@ a friendlier interface!
|
|||
The full command syntax looks like this:
|
||||
|
||||
```console
|
||||
nix-build -A packages.${package-set}.${package}.${version}.packages.${build}.${host}.${target}.package
|
||||
nix-build -A packages.${package-set}.${package}.${version}.packages.${build}.${host}.package
|
||||
```
|
||||
|
||||
Tidepool packages can have multiple versions available. Tidepool also provides aliases
|
||||
for convenience, currently "stable" and "latest". Aliases go directly after `${package}`:
|
||||
|
||||
```console
|
||||
nix-build -A packages.${package-set}.${package}.${alias}.packages.${build}.${host}.${target}.package
|
||||
nix-build -A packages.${package-set}.${package}.${alias}.packages.${build}.${host}.package
|
||||
```
|
||||
|
||||
The actual available versions live one level deeper, under `versions` namespace:
|
||||
|
||||
```console
|
||||
nix-build -A packages.${package-set}.${package}.versions.${version}.packages.${build}.${host}.${target}.package
|
||||
nix-build -A packages.${package-set}.${package}.versions.${version}.packages.${build}.${host}.package
|
||||
```
|
||||
|
||||
Here are a few practical examples for Tidepool. We can use a specific Bash version:
|
||||
|
||||
```console
|
||||
nix-build -A packages.foundation.bash.versions."5.2.15-stage1".packages.x86_64-linux.x86_64-linux.x86_64-linux.package
|
||||
nix-build -A packages.foundation.bash.versions."5.2.15-stage1".packages.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
Get Bash cross-compiled from `i686-linux` to `x86_64-linux`:
|
||||
|
||||
```console
|
||||
nix build .#packages.foundation.bash.latest.packages.i686-linux.x86_64-linux.x86_64-linux.package
|
||||
nix build .#packages.foundation.bash.latest.packages.i686-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
Or a native `aarch64-linux` Bash:
|
||||
|
||||
```console
|
||||
nix build .#packages.foundation.bash.latest.packages.aarch64-linux.aarch64-linux.aarch64-linux.package
|
||||
nix build .#packages.foundation.bash.latest.packages.aarch64-linux.aarch64-linux.package
|
||||
```
|
||||
|
||||
Running this command will:
|
||||
|
||||
- Bootstrap `i686-linux` `gcc` as a dependency of `x86_64-linux` `gcc`
|
||||
- Incrementally bootstrap the actual `x86_64-linux` `gcc`
|
||||
- Bootstrap `i686-linux` `gcc` using Foundation
|
||||
- Incrementally bootstrap `x86_64-linux` `gcc`
|
||||
- Incrementally bootstrap `aarch64-linux` `gcc` from `x86_64-linux` `gcc`
|
||||
- Build the native `aarch64-linux` `gcc`
|
||||
- Build the native `aarch64-linux` `bash`
|
||||
|
|
|
|||
|
|
@ -38,6 +38,15 @@ let
|
|||
./src/mirrors
|
||||
|
||||
recursiveLibModule
|
||||
{
|
||||
config = {
|
||||
systems.extraTargets = {
|
||||
x86_64-linux-musl = {
|
||||
system = "x86_64-unknown-linux-musl";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
++ lib.lists.from.any module;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ in
|
|||
package.env
|
||||
// {
|
||||
inherit (package) name;
|
||||
inherit script system;
|
||||
inherit script;
|
||||
system = (lib.systems.withBuildInfo system).double;
|
||||
|
||||
outputs = builtins.attrNames (lib.packages.getOutputs package);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,19 @@ let
|
|||
|
||||
getDoubles =
|
||||
predicate:
|
||||
builtins.map lib.systems.into.double (builtins.filter predicate lib.systems.doubles.resolved);
|
||||
builtins.filter (double: predicate (lib.systems.from.string double)) lib.systems.doubles.all;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
systems.extraTargets = (
|
||||
lib.options.create {
|
||||
description = "Map of extra target systems.";
|
||||
default.value = { };
|
||||
type = lib.types.either lib.types.string lib.types.attrs.any;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
config = {
|
||||
lib.systems = {
|
||||
match = builtins.mapAttrs (lib.fp.const matchAnyAttrs) lib.systems.patterns;
|
||||
|
|
@ -1752,12 +1762,15 @@ in
|
|||
from = {
|
||||
string =
|
||||
value:
|
||||
let
|
||||
parts = lib.strings.split "-" value;
|
||||
skeleton = lib.systems.skeleton parts;
|
||||
system = lib.systems.create (lib.systems.from.skeleton skeleton);
|
||||
in
|
||||
system;
|
||||
if lib.attrs.has [ value ] config.systems.extraTargets then
|
||||
lib.systems.from.string config.systems.extraTargets."${value}".system
|
||||
else
|
||||
let
|
||||
parts = lib.strings.split "-" value;
|
||||
skeleton = lib.systems.skeleton parts;
|
||||
system = lib.systems.create (lib.systems.from.skeleton skeleton);
|
||||
in
|
||||
system;
|
||||
|
||||
skeleton =
|
||||
spec@{
|
||||
|
|
@ -2433,7 +2446,8 @@ in
|
|||
# Windows
|
||||
"x86_64-windows"
|
||||
"i686-windows"
|
||||
];
|
||||
]
|
||||
++ builtins.attrNames config.systems.extraTargets;
|
||||
|
||||
arm = getDoubles lib.systems.match.isAarch32;
|
||||
armv7 = getDoubles lib.systems.match.isArmv7;
|
||||
|
|
@ -2538,7 +2552,14 @@ in
|
|||
withBuildInfo =
|
||||
args:
|
||||
let
|
||||
settings = if builtins.isString args then { system = args; } else args;
|
||||
settings =
|
||||
if builtins.isString args then
|
||||
if lib.attrs.has [ args ] config.systems.extraTargets then
|
||||
config.systems.extraTargets."${args}"
|
||||
else
|
||||
{ system = args; }
|
||||
else
|
||||
args;
|
||||
|
||||
resolved = {
|
||||
system = lib.systems.from.string (if settings ? triple then settings.triple else settings.system);
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ In this folder, the Tidepool package sets are stored.
|
|||
## Foundation
|
||||
|
||||
The package set under `foundation` is a minimal set to start building everything
|
||||
else. It builds upon and uses packages from [Foundation](https://git.auxolotl.org/auxolotl/foundation),
|
||||
our early bootstrap chain. It provides a comprehensive set of packages that are
|
||||
else. It provides a comprehensive set of packages that are
|
||||
used to build all other basic Linux utilities, and are often transitive dependencies
|
||||
of higher-level packages.
|
||||
|
||||
|
|
@ -25,21 +24,10 @@ binaries to point to our dependencies. This "unbreaks" proprietary
|
|||
binaries by making them point to Tidepool-provided dependencies.
|
||||
Neat!
|
||||
|
||||
The bootstrap chain is based on [full-source](https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/)
|
||||
bootstrap, made possible with amazing work by Guix's people,
|
||||
and Emily Trau's effort on porting it to Nix!
|
||||
It bootstraps a proper `gcc` for `i686-linux`, which can then
|
||||
be used to cross-compile a `gcc` for other architectures, such
|
||||
as `x86_64-linux`.
|
||||
|
||||
To build stage1 (`i686-linux`), run:
|
||||
|
||||
```console
|
||||
nix build --system i686-linux .#packages.foundation.glibc.versions."2.38-stage1-passthrough".packages.i686-linux.x86_64-linux.x86_64-linux.package
|
||||
```
|
||||
|
||||
The full bootstrap chain is available in a confusingly-named
|
||||
[Foundation repository](https://git.auxolotl.org/auxolotl/foundation).
|
||||
The `foundation` package set builds upon and uses packages from [Foundation](https://git.auxolotl.org/auxolotl/foundation),
|
||||
our early bootstrap chain. It augments the packages from Foundation with
|
||||
Tidepool's cross-compilation capabilities, and adds additional flags
|
||||
to compilers to better support our use case.
|
||||
|
||||
## Aux
|
||||
|
||||
|
|
|
|||
|
|
@ -78,12 +78,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -96,17 +92,12 @@ in
|
|||
|
||||
configure =
|
||||
let
|
||||
flags = builtins.concatStringsSep " " (
|
||||
[
|
||||
"--prefix=$out"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--enable-static-link"
|
||||
]
|
||||
++ lib.lists.when (config.platform.host == "i686-linux") [
|
||||
"--without-bash-malloc"
|
||||
]
|
||||
);
|
||||
flags = builtins.concatStringsSep " " ([
|
||||
"--prefix=$out"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--without-bash-malloc"
|
||||
]);
|
||||
in
|
||||
''
|
||||
# Configure
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ in
|
|||
settings = {
|
||||
target = lib.options.create {
|
||||
type = lib.types.nullish lib.types.string;
|
||||
default.value = null;
|
||||
default.value = config.platform.host;
|
||||
};
|
||||
allTargets = lib.options.create {
|
||||
description = "Include all targets (dramatically increases size of binaries).";
|
||||
|
|
@ -36,6 +36,14 @@ in
|
|||
default.value = false;
|
||||
};
|
||||
};
|
||||
target = lib.options.create {
|
||||
type = lib.types.raw;
|
||||
default.value = lib.attrs.generate lib.systems.doubles.all (
|
||||
target:
|
||||
(config.extend { settings.target = target; })
|
||||
.packages.${config.platform.build}.${config.platform.host}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.settings.target;
|
||||
};
|
||||
|
||||
version = lib.strings.removeSuffix "-stage1" config.version;
|
||||
|
|
@ -45,8 +46,8 @@ let
|
|||
++ lib.lists.when (config.settings.allTargets) [
|
||||
"--enable-target=all"
|
||||
]
|
||||
++ lib.lists.when (config.settings.target != null) [
|
||||
"--target=${(lib.systems.withBuildInfo config.settings.target).triple}"
|
||||
++ lib.lists.when (platform.host.triple != platform.target.triple) [
|
||||
"--target=${platform.target.triple}"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
|
@ -54,7 +55,7 @@ in
|
|||
settings = {
|
||||
target = lib.options.create {
|
||||
type = lib.types.nullish lib.types.string;
|
||||
default.value = null;
|
||||
default.value = config.platform.host;
|
||||
};
|
||||
allTargets = lib.options.create {
|
||||
description = "Include all targets (dramatically increases size of binaries).";
|
||||
|
|
@ -62,6 +63,14 @@ in
|
|||
default.value = false;
|
||||
};
|
||||
};
|
||||
target = lib.options.create {
|
||||
type = lib.types.raw;
|
||||
default.value = lib.attrs.generate lib.systems.doubles.all (
|
||||
target:
|
||||
(config.extend { settings.target = target; })
|
||||
.packages.${config.platform.build}.${config.platform.host}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -129,12 +138,8 @@ in
|
|||
}
|
||||
)
|
||||
// (lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -77,12 +77,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -68,12 +68,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -84,12 +84,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ let
|
|||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker=${foundation.stage1-musl}/lib/libc.so"
|
||||
"-Wl,-rpath,${foundation.stage1-musl}/lib"
|
||||
"-B${foundation.stage1-musl}/lib"
|
||||
];
|
||||
in
|
||||
|
|
|
|||
|
|
@ -7,24 +7,39 @@ let
|
|||
builders
|
||||
;
|
||||
|
||||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.settings.target;
|
||||
};
|
||||
|
||||
package =
|
||||
if
|
||||
config.platform.build == config.platform.host && config.platform.host != config.settings.target
|
||||
platform.build.triple == platform.host.triple && platform.host.triple != platform.target.triple
|
||||
then
|
||||
packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
builtins.trace "CROSS ${config.platform.host} ${config.settings.target}"
|
||||
packages.foundation.gcc.versions."13.2.0-stage2".extend
|
||||
{
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
settings.target = config.settings.target;
|
||||
}
|
||||
else if
|
||||
platform.build.triple != platform.host.triple && platform.host.triple == platform.target.triple
|
||||
then
|
||||
builtins.trace "CROSSED" packages.foundation.gcc.versions."13.2.0-stage3".extend {
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
settings.target = config.settings.target;
|
||||
}
|
||||
else if
|
||||
config.platform.build != config.platform.host && config.platform.host == config.settings.target
|
||||
platform.build.triple != platform.host.triple && platform.host.triple != platform.target.triple
|
||||
then
|
||||
packages.foundation.gcc.versions."13.2.0-stage3".extend {
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
}
|
||||
throw "Canadian cross is not supported"
|
||||
else
|
||||
packages.foundation.gcc.versions."13.2.0-stage4".extend {
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
};
|
||||
builtins.trace "NATIVE ${config.platform.host} ${config.settings.target}"
|
||||
packages.foundation.gcc.versions."13.2.0-stage4".extend
|
||||
{
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
settings.target = builtins.trace "TARGET ${config.settings.target}" config.settings.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
|
@ -33,6 +48,14 @@ in
|
|||
default.value = config.platform.host;
|
||||
description = "Target of the compiler";
|
||||
};
|
||||
target = lib.options.create {
|
||||
type = lib.types.raw;
|
||||
default.value = lib.attrs.generate lib.systems.doubles.all (
|
||||
target:
|
||||
(config.extend { settings.target = target; })
|
||||
.packages.${config.platform.build}.${config.platform.host}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,14 @@ in
|
|||
default.value = "x86_64-linux";
|
||||
description = "Target of the compiler";
|
||||
};
|
||||
target = lib.options.create {
|
||||
type = lib.types.raw;
|
||||
default.value = lib.attrs.generate lib.systems.doubles.all (
|
||||
target:
|
||||
(config.extend { settings.target = target; })
|
||||
.packages.${config.platform.build}.${config.platform.host}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -168,9 +176,8 @@ in
|
|||
}
|
||||
)
|
||||
// {
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.settings.target;
|
||||
};
|
||||
binutils-cross =
|
||||
packages.foundation.binutils.versions."2.41-stage1".target.${config.settings.target};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ let
|
|||
];
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker=${config.deps.host.glibc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.glibc.package}/lib"
|
||||
"-L${config.deps.host.glibc.package}/lib"
|
||||
"-B${config.deps.host.glibc.package}/lib"
|
||||
"-Wl,-dynamic-linker=${config.deps.host.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
"-L${config.deps.host.libc.package}/lib"
|
||||
"-B${config.deps.host.libc.package}/lib"
|
||||
"-L${config.package.outPath}${libPrefix}/lib"
|
||||
"-B${config.package.outPath}${libPrefix}/lib"
|
||||
];
|
||||
|
|
@ -49,9 +49,9 @@ let
|
|||
"--disable-libsanitizer"
|
||||
"--disable-lto"
|
||||
"--disable-multilib"
|
||||
"--with-headers=${config.deps.host.glibc.package}/include"
|
||||
"--with-headers=${config.deps.host.libc.package}/include"
|
||||
"--with-build-sysroot=/"
|
||||
"--with-native-system-header-dir=${config.deps.host.glibc.package}/include"
|
||||
"--with-native-system-header-dir=${config.deps.host.libc.package}/include"
|
||||
"--with-build-time-tools=${config.deps.build.binutils-cross.package}/bin"
|
||||
];
|
||||
in
|
||||
|
|
@ -82,6 +82,14 @@ in
|
|||
default.value = "x86_64-linux";
|
||||
description = "Target of the compiler";
|
||||
};
|
||||
target = lib.options.create {
|
||||
type = lib.types.raw;
|
||||
default.value = lib.attrs.generate lib.systems.doubles.all (
|
||||
target:
|
||||
(config.extend { settings.target = target; })
|
||||
.packages.${config.platform.build}.${config.platform.host}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -171,22 +179,31 @@ in
|
|||
}
|
||||
)
|
||||
// {
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.settings.target;
|
||||
};
|
||||
binutils-cross =
|
||||
packages.foundation.binutils.versions."2.41-stage1".target.${config.settings.target};
|
||||
};
|
||||
|
||||
host = {
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1".extend {
|
||||
platform.host = lib.modules.overrides.force config.settings.target;
|
||||
};
|
||||
libc =
|
||||
if platform.target.libc == "glibc" then
|
||||
packages.foundation.glibc.versions."2.38-stage1".extend {
|
||||
platform.host = lib.modules.overrides.force config.settings.target;
|
||||
}
|
||||
else
|
||||
packages.foundation.musl.versions."1.2.4-stage1".extend {
|
||||
platform.host = lib.modules.overrides.force config.settings.target;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.glibc.dynamicLinker} -B${config.deps.host.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.host.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.host.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = builtins.concatStringsSep " " [
|
||||
"-Wl,-dynamic-linker=${config.deps.host.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
"-B${config.deps.host.libc.package}/lib"
|
||||
];
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.host.libc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.host.libc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
@ -232,9 +249,9 @@ in
|
|||
|
||||
# TODO(vlinkz) Hack to fix missing crti.o and crtn.o. Figure out how to properly find their paths.
|
||||
mkdir gcc
|
||||
ln -sv ${config.deps.host.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
ln -sv ${config.deps.host.libc.package}/lib/{crti.o,crtn.o} gcc
|
||||
mkdir -p ${platform.target.triple}/libstdc++-v3/src
|
||||
ln -sv ${config.deps.host.glibc.package}/lib/{crti.o,crtn.o} ${platform.target.triple}/libstdc++-v3/src
|
||||
ln -sv ${config.deps.host.libc.package}/lib/{crti.o,crtn.o} ${platform.target.triple}/libstdc++-v3/src
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " configureFlags}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ let
|
|||
];
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker=${config.deps.host.glibc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.glibc.package}/lib"
|
||||
"-L${config.deps.host.glibc.package}/lib"
|
||||
"-B${config.deps.host.glibc.package}/lib"
|
||||
"-Wl,-dynamic-linker=${config.deps.host.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
"-L${config.deps.host.libc.package}/lib"
|
||||
"-B${config.deps.host.libc.package}/lib"
|
||||
"-L${config.package.outPath}/lib"
|
||||
"-B${config.package.outPath}/lib"
|
||||
];
|
||||
|
|
@ -39,7 +39,7 @@ let
|
|||
"--disable-bootstrap"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-multilib"
|
||||
"--with-native-system-header-dir=${config.deps.host.glibc.package}/include"
|
||||
"--with-native-system-header-dir=${config.deps.host.libc.package}/include"
|
||||
"--with-gxx-include-dir=${builtins.placeholder "out"}/include/c++/${config.version}/"
|
||||
"--with-build-sysroot=/"
|
||||
];
|
||||
|
|
@ -142,7 +142,11 @@ in
|
|||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage4";
|
||||
glibc = packages.foundation.glibc.versions."2.38-bootstrap";
|
||||
libc =
|
||||
if platform.host.libc == "glibc" then
|
||||
packages.foundation.glibc.versions."2.38-bootstrap"
|
||||
else
|
||||
packages.foundation.musl.versions."1.2.4-bootstrap";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -159,31 +163,52 @@ in
|
|||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage4";
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1-passthrough";
|
||||
libc =
|
||||
if platform.host.libc == "glibc" then
|
||||
packages.foundation.glibc.versions."2.38-stage1-passthrough"
|
||||
else
|
||||
packages.foundation.musl.versions."1.2.4-stage1-passthrough";
|
||||
}
|
||||
)
|
||||
// {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
|
||||
host = {
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1";
|
||||
libc =
|
||||
if platform.host.libc == "glibc" then
|
||||
packages.foundation.glibc.versions."2.38-stage1"
|
||||
else
|
||||
packages.foundation.musl.versions."1.2.4-stage1";
|
||||
};
|
||||
};
|
||||
|
||||
env = rec {
|
||||
CFLAGS_FOR_BUILD = "-Wl,-dynamic-linker -Wl,${config.deps.build.glibc.dynamicLinker} -B${config.deps.build.glibc.package}/lib";
|
||||
LDFLAGS_FOR_BUILD = "-L${config.deps.build.gcc.package}/lib -L${config.deps.build.glibc.package}/lib -Wl,-rpath,${config.deps.build.gcc.package}/lib -Wl,-rpath,${config.deps.build.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.glibc.dynamicLinker} -B${config.deps.host.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.host.triple}/libgcc -L${config.deps.host.glibc.package}/lib";
|
||||
CFLAGS = CFLAGS_FOR_TARGET;
|
||||
LDFLAGS = LDFLAGS_FOR_TARGET;
|
||||
LIBRARY_PATH = "${config.deps.host.glibc.package}/lib";
|
||||
env = {
|
||||
CFLAGS_FOR_BUILD = builtins.concatStringsSep " " [
|
||||
"-Wl,-dynamic-linker=${config.deps.build.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.build.libc.package}/lib"
|
||||
"-B${config.deps.build.libc.package}/lib"
|
||||
"-Wl,-rpath,${config.deps.build.gcc.package}/lib"
|
||||
"-B${config.deps.build.gcc.package}/lib"
|
||||
];
|
||||
LDFLAGS_FOR_BUILD = builtins.concatStringsSep " " [
|
||||
"-Wl,-rpath,${config.deps.build.gcc.package}/lib"
|
||||
"-Wl,-rpath,${config.deps.build.libc.package}/lib"
|
||||
];
|
||||
CFLAGS_FOR_TARGET = builtins.concatStringsSep " " [
|
||||
"-Wl,-dynamic-linker=${config.deps.host.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${builtins.placeholder "out"}/lib"
|
||||
"-B${builtins.placeholder "out"}/lib"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
"-B${config.deps.host.libc.package}/lib"
|
||||
];
|
||||
LDFLAGS_FOR_TARGET = builtins.concatStringsSep " " [
|
||||
"-L$(pwd)/${platform.host.triple}/libgcc"
|
||||
"-Wl,-rpath,${builtins.placeholder "out"}/lib"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
];
|
||||
LIBRARY_PATH = "${config.deps.host.libc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.settings.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
@ -21,10 +22,10 @@ let
|
|||
];
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker=${config.deps.host.glibc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.glibc.package}/lib"
|
||||
"-L${config.deps.host.glibc.package}/lib"
|
||||
"-B${config.deps.host.glibc.package}/lib"
|
||||
"-Wl,-dynamic-linker=${config.deps.host.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
"-L${config.deps.host.libc.package}/lib"
|
||||
"-B${config.deps.host.libc.package}/lib"
|
||||
"-L${config.package.outPath}/lib"
|
||||
"-B${config.package.outPath}/lib"
|
||||
];
|
||||
|
|
@ -39,7 +40,7 @@ let
|
|||
"--disable-libsanitizer"
|
||||
"--disable-multilib"
|
||||
"--with-build-sysroot=/"
|
||||
"--with-native-system-header-dir=${config.deps.host.glibc.package}/include"
|
||||
"--with-native-system-header-dir=${config.deps.host.libc.package}/include"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
|
@ -63,6 +64,16 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
settings.target = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default.value = config.platform.host;
|
||||
description = "Target of the compiler";
|
||||
apply =
|
||||
value:
|
||||
assert (lib.systems.withBuildInfo value).triple == platform.host.triple;
|
||||
value;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -146,17 +157,33 @@ in
|
|||
host =
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
glibc = packages.foundation.glibc.versions."2.38-bootstrap";
|
||||
libc =
|
||||
if platform.host.libc == "glibc" then
|
||||
packages.foundation.glibc.versions."2.38-bootstrap"
|
||||
else
|
||||
packages.foundation.musl.versions."1.2.4-bootstrap";
|
||||
}
|
||||
else
|
||||
{
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1-passthrough";
|
||||
libc =
|
||||
if platform.host.libc == "glibc" then
|
||||
packages.foundation.glibc.versions."2.38-stage1-passthrough"
|
||||
else
|
||||
packages.foundation.musl.versions."1.2.4-stage1-passthrough";
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.glibc.dynamicLinker}";
|
||||
LIBRARY_PATH = "${config.deps.host.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = builtins.concatStringsSep " " [
|
||||
"-Wl,-dynamic-linker=${config.deps.host.libc.dynamicLinker}"
|
||||
"-Wl,-rpath,${builtins.placeholder "out"}/lib"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
];
|
||||
LDFLAGS_FOR_TARGET = builtins.concatStringsSep " " [
|
||||
"-Wl,-rpath,${builtins.placeholder "out"}/lib"
|
||||
"-Wl,-rpath,${config.deps.host.libc.package}/lib"
|
||||
];
|
||||
LIBRARY_PATH = "${config.deps.host.libc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ in
|
|||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default = "ld-linux-x86-64.so.2";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ in
|
|||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default = "ld-linux-x86-64.so.2";
|
||||
default.value = "ld-linux-x86-64.so.2";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
|
@ -99,12 +99,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage1".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
host = {
|
||||
linux-headers = packages.foundation.linux-headers.versions."6.5.6-stage1";
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -85,12 +85,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-passthrough".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,18 @@
|
|||
{ global }:
|
||||
{ config, global }:
|
||||
|
||||
let
|
||||
inherit (global) lib builders;
|
||||
inherit (global.internal.packages) foundation;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default.value = "${config.package.outPath}/lib/libc.so";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "An efficient, small, quality libc implementation.";
|
||||
|
|
|
|||
|
|
@ -23,6 +23,14 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default.value = "${config.package.outPath}/lib/libc.so";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "An efficient, small, quality libc implementation.";
|
||||
|
|
|
|||
|
|
@ -12,6 +12,14 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default.value = "${config.package.outPath}/lib/libc.so";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "An efficient, small, quality libc implementation.";
|
||||
|
|
@ -67,20 +75,9 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage1".target.${config.platform.host};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
# target = lib.attrs.when (config.platform.host != config.platform.target) {
|
||||
# gcc = packages.foundation.gcc.versions."13.2.0-stage2";
|
||||
# binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
# };
|
||||
host = lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
bash = packages.foundation.bash.versions."5.2.15-stage1";
|
||||
};
|
||||
};
|
||||
|
||||
phases = {
|
||||
|
|
@ -123,12 +120,9 @@ in
|
|||
install = ''
|
||||
# Install
|
||||
make -j $NIX_BUILD_CORES install
|
||||
sed -i 's|/bin/sh|${
|
||||
if (config.platform.build != config.platform.host) then
|
||||
config.deps.host.bash.package
|
||||
else
|
||||
config.deps.build.bash.package
|
||||
}/bin/bash|' $out/bin/*
|
||||
${lib.strings.when (config.platform.build == config.platform.host) ''
|
||||
sed -i 's|/bin/sh|${config.deps.build.bash.package}/bin/bash|' $out/bin/*
|
||||
''}
|
||||
ln -s ../lib/libc.so $out/bin/ldd
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -81,12 +81,8 @@ in
|
|||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
python = packages.foundation.python.versions."3.12.0-stage1";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".target.${config.platform.host};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
|
||||
host = {
|
||||
|
|
|
|||
|
|
@ -75,12 +75,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".target.${config.platform.host};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -68,12 +68,8 @@ in
|
|||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2".target.${config.platform.host};
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1".target.${config.platform.host};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue