fix: make gcc cross compiling not require emulation
This commit is contained in:
parent
80b7c3cc27
commit
9cdcd52e5d
8 changed files with 418 additions and 27 deletions
|
|
@ -8,14 +8,16 @@
|
|||
{
|
||||
config.packages.foundation.gcc = {
|
||||
stable = config.packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
latest = config.packages.foundation.gcc.versions."13.2.0-stage4";
|
||||
latest = config.packages.foundation.gcc.versions."13.2.0-stage5";
|
||||
|
||||
versions = {
|
||||
"13.2.0-stage5" = ./versions/13.2.0-stage5.nix;
|
||||
"13.2.0-stage4" = ./versions/13.2.0-stage4.nix;
|
||||
"13.2.0-stage3-passthrough" = ./versions/13.2.0-stage3-passthrough.nix;
|
||||
"13.2.0-stage3" = ./versions/13.2.0-stage3.nix;
|
||||
"13.2.0-stage2" = ./versions/13.2.0-stage2.nix;
|
||||
"13.2.0-stage1" = ./versions/13.2.0-stage1.nix;
|
||||
"13.2.0-stage0" = ./versions/13.2.0-stage0.nix;
|
||||
"13.2.0-bootstrap" = ./versions/13.2.0-bootstrap.nix;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ in
|
|||
|
||||
hooks = ctx: {
|
||||
"aux:gcc:env" = lib.dag.entry.before [ "unpack" ] ''
|
||||
export CC='gcc -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so'
|
||||
export CXX='g++ -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so'
|
||||
export CC='gcc -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so -B${foundation.stage1-musl}/lib'
|
||||
export CXX='g++ -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so -B${foundation.stage1-musl}/lib'
|
||||
export CC_FOR_TARGET=$CC
|
||||
export CXX_FOR_TARGET=$CXX
|
||||
export CC_FOR_BUILD=$CC
|
||||
|
|
|
|||
208
tidepool/src/packages/foundation/gcc/versions/13.2.0-stage0.nix
Normal file
208
tidepool/src/packages/foundation/gcc/versions/13.2.0-stage0.nix
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
# gcc-bootstrap-glibc
|
||||
{ config, global }:
|
||||
|
||||
let
|
||||
inherit (global)
|
||||
lib
|
||||
packages
|
||||
builders
|
||||
mirrors
|
||||
;
|
||||
inherit (global.internal.packages) foundation;
|
||||
|
||||
version = lib.strings.removeSuffix "-stage0" config.version;
|
||||
|
||||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
../patches/libstdc++-target.patch
|
||||
];
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.target.target.glibc.dynamicLinker}"
|
||||
"-B${config.deps.target.target.glibc.package}/lib"
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-lto"
|
||||
"--disable-bootstrap"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-multilib"
|
||||
"--with-build-sysroot=/"
|
||||
"--with-native-system-header-dir=${config.deps.target.target.glibc.package}/include"
|
||||
];
|
||||
in
|
||||
{
|
||||
options = {
|
||||
gmp.version = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Version of gmp.";
|
||||
};
|
||||
|
||||
mpfr.version = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Version of mpfr.";
|
||||
};
|
||||
|
||||
mpc.version = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Version of mpc.";
|
||||
};
|
||||
|
||||
isl.version = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "GNU Compiler Collection.";
|
||||
homepage = "https://gcc.gnu.org";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
};
|
||||
|
||||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
isl.version = "0.24";
|
||||
|
||||
src = {
|
||||
gcc = builtins.fetchurl {
|
||||
url = "${mirrors.gnu}/gcc/gcc-${version}/gcc-${version}.tar.xz";
|
||||
sha256 = "4nXnZEKmBnNBon8Exca4PYYTFEAEwEE1KIY9xrXHQ9o=";
|
||||
};
|
||||
|
||||
gmp = builtins.fetchurl {
|
||||
url = "${mirrors.gnu}/gmp/gmp-${config.gmp.version}.tar.xz";
|
||||
sha256 = "o8K4AgG4nmhhb0rTC8Zq7kknw85Q4zkpyoGdXENTiJg=";
|
||||
};
|
||||
|
||||
mpfr = builtins.fetchurl {
|
||||
url = "${mirrors.gnu}/mpfr/mpfr-${config.mpfr.version}.tar.xz";
|
||||
sha256 = "J3gHNTpnJpeJlpRa8T5Sgp46vXqaW3+yeTiU4Y8fy7I=";
|
||||
};
|
||||
|
||||
mpc = builtins.fetchurl {
|
||||
url = "${mirrors.gnu}/mpc/mpc-${config.mpc.version}.tar.gz";
|
||||
sha256 = "q2QkkvXPiCt0qgy3MM1BCoHtzb7IlRg86TDnBsHHWbg=";
|
||||
};
|
||||
|
||||
isl = builtins.fetchurl {
|
||||
url = "https://gcc.gnu.org/pub/gcc/infrastructure/isl-${config.isl.version}.tar.bz2";
|
||||
sha256 = "/PeN2WVsEOuM+fvV9ZoLawE4YgX+GTSzsoegoYmBRcA=";
|
||||
};
|
||||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build = {
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-bootstrap";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-bootstrap";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-bootstrap";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-bootstrap";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
};
|
||||
|
||||
host = {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
};
|
||||
};
|
||||
|
||||
target = {
|
||||
target = {
|
||||
glibc = packages.foundation.glibc.versions."2.38-bootstrap";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.target.target.glibc.dynamicLinker} -B${config.deps.target.target.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.target.target.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.target.target.glibc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
"aux:gcc:env" = lib.dag.entry.between [ "unpack" ] [ "configure" ] ''
|
||||
export CC='${config.package}/bin/gcc ${builtins.concatStringsSep " " gccFlags}'
|
||||
export CXX='${config.package}/bin/g++ ${builtins.concatStringsSep " " gccFlags}'
|
||||
export CC_FOR_TARGET=$CC
|
||||
export CXX_FOR_TARGET=$CXX
|
||||
export CC_FOR_BUILD=$CC
|
||||
export CXX_FOR_BUILD=$CXX
|
||||
alias gcc='$CC'
|
||||
alias g++='$CXX'
|
||||
'';
|
||||
};
|
||||
|
||||
phases = {
|
||||
unpack = ''
|
||||
# Unpack
|
||||
tar xf ${config.src.gcc}
|
||||
tar xf ${config.src.gmp}
|
||||
tar xf ${config.src.mpfr}
|
||||
tar xf ${config.src.mpc}
|
||||
tar xf ${config.src.isl}
|
||||
cd gcc-${version}
|
||||
|
||||
ln -s ../gmp-${config.gmp.version} gmp
|
||||
ln -s ../mpfr-${config.mpfr.version} mpfr
|
||||
ln -s ../mpc-${config.mpc.version} mpc
|
||||
ln -s ../isl-${config.isl.version} isl
|
||||
'';
|
||||
|
||||
patch = ''
|
||||
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
|
||||
'';
|
||||
|
||||
configure = ''
|
||||
# Configure
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " configureFlags}
|
||||
'';
|
||||
|
||||
build = ''
|
||||
# Build
|
||||
make -j $NIX_BUILD_CORES V=1
|
||||
'';
|
||||
|
||||
install = ''
|
||||
# Install
|
||||
${lib.strings.when (platform.host.is64bit) ''
|
||||
mkdir -p $out/lib
|
||||
ln -s lib $out/lib64
|
||||
''}
|
||||
make -j $NIX_BUILD_CORES install
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -45,7 +45,6 @@ let
|
|||
"--disable-multilib"
|
||||
"--with-headers=${config.deps.target.target.glibc.package}/include"
|
||||
"--with-build-sysroot=/"
|
||||
# "--with-sysroot=${config.deps.target.target.glibc.package}"
|
||||
"--with-native-system-header-dir=${config.deps.target.target.glibc.package}/include"
|
||||
"--with-build-time-tools=${config.deps.build.target.binutils.package}/bin"
|
||||
];
|
||||
|
|
@ -181,14 +180,13 @@ in
|
|||
};
|
||||
|
||||
env = {
|
||||
CC = "gcc -Wl,-dynamic-linker";
|
||||
CXX = "g++ -Wl,-dynamic-linker";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.target.target.glibc.dynamicLinker} -B${config.deps.target.target.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.target.target.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.target.target.glibc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
"aux:gcc:env" = lib.dag.entry.before [ "unpack" "configure" "build" "install" ] ''
|
||||
"aux:gcc-cross:env" = lib.dag.entry.before [ "unpack" "configure" "build" "install" ] ''
|
||||
export CC='${config.package}/bin/${prefix}gcc ${builtins.concatStringsSep " " gccFlags}'
|
||||
export CXX='${config.package}/bin/${prefix}g++ ${builtins.concatStringsSep " " gccFlags}'
|
||||
export CC_FOR_TARGET=$CC
|
||||
|
|
@ -222,16 +220,14 @@ in
|
|||
|
||||
configure = ''
|
||||
# Configure
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
echo PATH=$PATH
|
||||
|
||||
# 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.target.target.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
mkdir -p x86_64-unknown-linux-gnu/libstdc++-v3/src
|
||||
ln -sv ${config.deps.target.target.glibc.package}/lib/{crti.o,crtn.o} x86_64-unknown-linux-gnu/libstdc++-v3/src
|
||||
mkdir -p ${platform.target.triple}/libstdc++-v3/src
|
||||
ln -sv ${config.deps.target.target.glibc.package}/lib/{crti.o,crtn.o} ${platform.target.triple}/libstdc++-v3/src
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " configureFlags}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# gcc-bootstrap
|
||||
# gcc-crossed
|
||||
{ config, global }:
|
||||
|
||||
let
|
||||
|
|
@ -37,12 +37,9 @@ let
|
|||
|
||||
configureFlags = [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
# Pretend we're native even though we're not
|
||||
"--build=${platform.target.triple}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--with-as=${config.deps.build.target.binutils.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.target.binutils.package}/bin/${prefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-lto"
|
||||
"--disable-bootstrap"
|
||||
|
|
@ -94,6 +91,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
@ -147,6 +149,8 @@ in
|
|||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage0";
|
||||
glibc = packages.foundation.glibc.versions."2.38-bootstrap";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -162,6 +166,8 @@ in
|
|||
gzip = packages.foundation.gzip.versions."1.13-stage1-passthrough";
|
||||
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";
|
||||
};
|
||||
|
||||
host = {
|
||||
|
|
@ -180,10 +186,23 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker}";
|
||||
LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
env = rec {
|
||||
CC_FOR_BUILD = "${config.deps.build.build.gcc.package}/bin/gcc -Wl,-dynamic-linker -Wl,${config.deps.build.build.glibc.dynamicLinker} -B${config.deps.build.build.glibc.package}/lib";
|
||||
CXX_FOR_BUILD = "${config.deps.build.build.gcc.package}/bin/g++ -Wl,-dynamic-linker -Wl,${config.deps.build.build.glibc.dynamicLinker} -B${config.deps.build.build.glibc.package}/lib";
|
||||
CFLAGS_FOR_BUILD = "-Wl,-dynamic-linker -Wl,${config.deps.build.build.glibc.dynamicLinker} -B${config.deps.build.build.glibc.package}/lib";
|
||||
LDFLAGS_FOR_BUILD = "-L${config.deps.build.build.gcc.package}/lib -L${config.deps.build.build.glibc.package}/lib -Wl,-rpath,${config.deps.build.build.gcc.package}/lib -Wl,-rpath,${config.deps.build.build.glibc.package}/lib";
|
||||
|
||||
CC_FOR_TARGET = "${prefix}gcc -Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker} -B${config.deps.host.host.glibc.package}/lib";
|
||||
CXX_FOR_TARGET = "${prefix}g++ -Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker} -B${config.deps.host.host.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker} -B${config.deps.host.host.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.host.host.glibc.package}/lib";
|
||||
CC = CC_FOR_TARGET;
|
||||
CXX = CXX_FOR_TARGET;
|
||||
CFLAGS = CFLAGS_FOR_TARGET;
|
||||
LDFLAGS = LDFLAGS_FOR_TARGET;
|
||||
|
||||
LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
LD_LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
@ -200,6 +219,10 @@ in
|
|||
};
|
||||
|
||||
phases = {
|
||||
"aux:gcc:env" = '''';
|
||||
|
||||
"aux:gcc-cross:env" = '''';
|
||||
|
||||
unpack = ''
|
||||
# Unpack
|
||||
tar xf ${config.src.gcc}
|
||||
|
|
@ -241,9 +264,5 @@ in
|
|||
make -j $NIX_BUILD_CORES install
|
||||
'';
|
||||
};
|
||||
|
||||
context = {
|
||||
a = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
{ config, global }:
|
||||
|
||||
let
|
||||
inherit (global)
|
||||
lib
|
||||
packages
|
||||
builders
|
||||
mirrors
|
||||
;
|
||||
inherit (global.internal.packages) foundation;
|
||||
|
||||
package =
|
||||
builtins.trace
|
||||
"gcc stage5 ${config.platform.build} ${config.platform.host} ${config.platform.target}"
|
||||
(
|
||||
if
|
||||
config.platform.build == config.platform.host && config.platform.host != config.platform.target
|
||||
then
|
||||
packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
}
|
||||
else if
|
||||
config.platform.build != config.platform.host && config.platform.host == config.platform.target
|
||||
then
|
||||
packages.foundation.gcc.versions."13.2.0-stage3".extend {
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
}
|
||||
else
|
||||
packages.foundation.gcc.versions."13.2.0-stage4".extend {
|
||||
platform = lib.modules.overrides.force config.platform;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
config = {
|
||||
meta = {
|
||||
description = "GNU Compiler Collection.";
|
||||
homepage = "https://gcc.gnu.org";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
};
|
||||
|
||||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "aarch64-linux";
|
||||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
hooks = package.hooks;
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
settings = {
|
||||
derivation = package.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,10 +1,30 @@
|
|||
{ config, global }:
|
||||
|
||||
let
|
||||
inherit (global) lib packages builders;
|
||||
inherit (global)
|
||||
lib
|
||||
packages
|
||||
builders
|
||||
mirrors
|
||||
;
|
||||
inherit (global.internal.packages) foundation;
|
||||
|
||||
version = lib.strings.removeSuffix "-bootstrap" config.version;
|
||||
|
||||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "The GNU C Library.";
|
||||
|
|
@ -20,10 +40,68 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
settings = {
|
||||
derivation = foundation.stage2-glibc;
|
||||
builder = builders.basic;
|
||||
|
||||
src = builtins.fetchurl {
|
||||
url = "${mirrors.gnu}/libc/glibc-${version}.tar.xz";
|
||||
sha256 = "+4KZiZiyspllRnvBtp0VLpwwfSzzAcnq+0VVt3DvP9I=";
|
||||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build = {
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-bootstrap";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-bootstrap";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-bootstrap";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-bootstrap";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
python = packages.foundation.python.versions."3.12.0-bootstrap";
|
||||
bison = packages.foundation.bison.versions."3.8.2-bootstrap";
|
||||
};
|
||||
host = {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
linux-headers = packages.foundation.linux-headers.versions."6.5.6-stage1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dynamicLinker = "${config.package.outPath}/lib/ld-linux.so.2";
|
||||
|
||||
phases = {
|
||||
unpack = ''
|
||||
tar xf ${config.src}
|
||||
cd glibc-${version}
|
||||
'';
|
||||
|
||||
configure = ''
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
bash ../configure \
|
||||
--prefix=$out \
|
||||
--build=${platform.build.triple} \
|
||||
--host=${platform.host.triple} \
|
||||
--with-headers=${config.deps.build.host.linux-headers.package}/include \
|
||||
--with-binutils=${config.deps.build.host.binutils.package}/${platform.target.triple}/bin
|
||||
'';
|
||||
|
||||
build = ''
|
||||
# Build
|
||||
make -j $NIX_BUILD_CORES
|
||||
'';
|
||||
|
||||
install = ''
|
||||
# Install
|
||||
make -j $NIX_BUILD_CORES install
|
||||
ln -sv $(ls -d ${config.deps.build.host.linux-headers.package}/include/* | grep -v scsi\$) $out/include/
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@ in
|
|||
};
|
||||
|
||||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue