gcc: Remove target junk
This commit is contained in:
parent
586d02fcb3
commit
005e477a1c
7 changed files with 74 additions and 58 deletions
|
|
@ -14,7 +14,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
@ -23,22 +22,22 @@ let
|
|||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.target.target.glibc.dynamicLinker}"
|
||||
"-B${config.deps.target.target.glibc.package}/lib"
|
||||
"-Wl,${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--target=${config.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"
|
||||
"--with-native-system-header-dir=${config.deps.host.host.glibc.package}/include"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
|
@ -62,6 +61,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target of GCC";
|
||||
}
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -75,6 +79,7 @@ in
|
|||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = config.platforms.host;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
@ -129,16 +134,16 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
target = {
|
||||
target = {
|
||||
host = {
|
||||
host = {
|
||||
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";
|
||||
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)/${config.target.triple}/libgcc -L${config.deps.host.host.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.target.target.glibc.package}/lib";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,12 +14,11 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
platform.build.triple != platform.target.triple
|
||||
) "${platform.target.triple}-";
|
||||
platform.build.triple != config.target.triple
|
||||
) "${config.target.triple}-";
|
||||
|
||||
patches = [
|
||||
../patches/libstdc++-target.patch
|
||||
|
|
@ -30,9 +29,9 @@ let
|
|||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--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"
|
||||
"--target=${config.target.triple}"
|
||||
"--with-as=${config.deps.build.host.binutils.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.host.binutils.package}/bin/${prefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-bootstrap"
|
||||
"--disable-libsanitizer"
|
||||
|
|
@ -74,6 +73,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target of the compiler"
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -86,16 +90,15 @@ in
|
|||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
target = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
host = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = platforms.host.triple;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
@ -163,7 +166,7 @@ in
|
|||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
target = {
|
||||
host = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,12 +14,11 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
platform.build.triple != platform.target.triple
|
||||
) "${platform.target.triple}-";
|
||||
platform.build.triple != config.target.triple
|
||||
) "${config.target.triple}-";
|
||||
|
||||
patches = [
|
||||
../patches/libstdc++-target.patch
|
||||
|
|
@ -27,25 +26,25 @@ let
|
|||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.target.target.glibc.dynamicLinker}"
|
||||
"-B${config.deps.target.target.glibc.package}/lib"
|
||||
"-Wl,${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--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"
|
||||
"--target=${config.target.triple}"
|
||||
"--with-as=${config.deps.build.host.binutils.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.host.binutils.package}/bin/${prefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-lto"
|
||||
"--disable-multilib"
|
||||
"--with-headers=${config.deps.target.target.glibc.package}/include"
|
||||
"--with-headers=${config.deps.host.host.glibc.package}/include"
|
||||
"--with-build-sysroot=/"
|
||||
"--with-native-system-header-dir=${config.deps.target.target.glibc.package}/include"
|
||||
"--with-build-time-tools=${config.deps.build.target.binutils.package}/bin"
|
||||
"--with-native-system-header-dir=${config.deps.host.host.glibc.package}/include"
|
||||
"--with-build-time-tools=${config.deps.build.host.binutils.package}/bin"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
|
@ -69,6 +68,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target of GCC";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -81,16 +85,15 @@ in
|
|||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = config.platforms.host;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
@ -159,22 +162,22 @@ in
|
|||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
|
||||
target = {
|
||||
host = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
};
|
||||
};
|
||||
|
||||
target = {
|
||||
target = {
|
||||
host = {
|
||||
host = {
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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";
|
||||
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)/${config.target.triple}/libgcc -L${config.deps.host.host.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
@ -217,9 +220,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.target.target.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
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
|
||||
ln -sv ${config.deps.host.host.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
mkdir -p ${platform.host.host}/libstdc++-v3/src
|
||||
ln -sv ${config.deps.host.host.glibc.package}/lib/{crti.o,crtn.o} ${platform.host.host}/libstdc++-v3/src
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " configureFlags}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ let
|
|||
package = packages.foundation.gcc.versions."13.2.0-stage3".extend {
|
||||
platform = {
|
||||
build = lib.modules.overrides.force (
|
||||
if config.platform.target == "x86_64-linux" then "i686-linux" else "x86_64-linux"
|
||||
if config.target.triple == "x86_64-linux" then "i686-linux" else "x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -14,12 +14,11 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
platform.build.triple != platform.target.triple
|
||||
) "${platform.target.triple}-";
|
||||
platform.build.triple != config.target.triple
|
||||
) "${config.target.triple}-";
|
||||
|
||||
patches = [
|
||||
../patches/libstdc++-target.patch
|
||||
|
|
@ -30,7 +29,7 @@ let
|
|||
"-Wl,${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
]
|
||||
++ lib.lists.when (config.platform.target == "riscv64-linux") [
|
||||
++ lib.lists.when (config.target.triple == "riscv64-linux") [
|
||||
"-L${config.package.outPath}/lib"
|
||||
];
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ let
|
|||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--target=${config.target.triple}"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-lto"
|
||||
"--disable-bootstrap"
|
||||
|
|
@ -70,6 +69,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target of GCC";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -92,6 +96,7 @@ in
|
|||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = config.platform.host.triple;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
@ -166,7 +171,7 @@ in
|
|||
gcc = packages.foundation.gcc.versions."13.2.0-stage2";
|
||||
};
|
||||
|
||||
target = {
|
||||
host = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
};
|
||||
};
|
||||
|
|
@ -187,7 +192,7 @@ in
|
|||
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";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${config.target.triple}/libgcc -L${config.deps.host.host.glibc.package}/lib";
|
||||
CC = CC_FOR_TARGET;
|
||||
CXX = CXX_FOR_TARGET;
|
||||
CFLAGS = CFLAGS_FOR_TARGET;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
@ -26,7 +25,7 @@ let
|
|||
"-Wl,${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
]
|
||||
++ lib.lists.when (config.platform.target == "riscv64-linux") [
|
||||
++ lib.lists.when (config.target.triple == "riscv64-linux") [
|
||||
"-L${config.package.outPath}/lib"
|
||||
];
|
||||
|
||||
|
|
@ -34,7 +33,7 @@ let
|
|||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--target=${config.target.triple}"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-lto"
|
||||
"--disable-bootstrap"
|
||||
|
|
@ -65,6 +64,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target platform of GCC";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -78,6 +82,7 @@ in
|
|||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = config.platform.host;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
@ -129,9 +134,6 @@ in
|
|||
|
||||
host = {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage3-passthrough";
|
||||
};
|
||||
|
||||
target = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ in
|
|||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue