refactor: only support i686-linux for foundation gcc
This commit is contained in:
parent
bd51f4a088
commit
7385b21950
|
@ -83,7 +83,6 @@ in {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
(builtins.trace "${package.name}: ${system}")
|
|
||||||
built
|
built
|
||||||
// {
|
// {
|
||||||
inherit (package) meta;
|
inherit (package) meta;
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
lib',
|
|
||||||
config,
|
config,
|
||||||
options,
|
options,
|
||||||
}:
|
}: let
|
||||||
let
|
inherit
|
||||||
inherit (config)
|
(config)
|
||||||
|
lib
|
||||||
mirrors
|
mirrors
|
||||||
builders
|
builders
|
||||||
# These are the upstream foundational packages exported from the Aux Foundation project.
|
# These are the upstream foundational packages exported from the Aux Foundation project.
|
||||||
|
|
||||||
foundation
|
foundation
|
||||||
|
packages
|
||||||
;
|
;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
config.packages.foundation.gcc = {
|
config.packages.foundation.gcc = {
|
||||||
versions = {
|
versions = {
|
||||||
"latest" =
|
"latest" = {
|
||||||
{ config, meta }:
|
config,
|
||||||
{
|
meta,
|
||||||
|
}: {
|
||||||
options = {
|
options = {
|
||||||
src = lib.options.create {
|
src = lib.options.create {
|
||||||
type = lib.types.derivation;
|
type = lib.types.derivation;
|
||||||
|
@ -82,7 +82,7 @@ in
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
meta = {
|
meta = {
|
||||||
platforms = [ "i686-linux" ];
|
platforms = ["i686-linux"];
|
||||||
};
|
};
|
||||||
|
|
||||||
pname = "gcc";
|
pname = "gcc";
|
||||||
|
@ -91,28 +91,7 @@ in
|
||||||
builder = builders.basic;
|
builder = builders.basic;
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
PATH =
|
PATH = lib.paths.bin [
|
||||||
let
|
|
||||||
gcc =
|
|
||||||
if
|
|
||||||
config.platform.build.triple == config.platform.host.triple
|
|
||||||
# If we're on the same system then we can use the existing GCC instance.
|
|
||||||
then
|
|
||||||
foundation.stage2-gcc
|
|
||||||
# Otherwise we are going to need a cross-compiler.
|
|
||||||
else
|
|
||||||
# TODO: Create a gcc-cross package.
|
|
||||||
(meta.extend (args: {
|
|
||||||
config = {
|
|
||||||
platform = {
|
|
||||||
build = config.platform.build.triple;
|
|
||||||
host = config.platform.build.triple;
|
|
||||||
target = lib.modules.override.force config.platform.host.triple;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})).config.package;
|
|
||||||
in
|
|
||||||
lib.paths.bin [
|
|
||||||
foundation.stage2-gcc
|
foundation.stage2-gcc
|
||||||
foundation.stage2-binutils
|
foundation.stage2-binutils
|
||||||
foundation.stage2-gnumake
|
foundation.stage2-gnumake
|
||||||
|
@ -128,14 +107,18 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
phases =
|
phases = let
|
||||||
let
|
host = lib.systems.withBuildInfo config.platform.host;
|
||||||
host = lib'.systems.withBuildInfo config.platform.host;
|
|
||||||
|
|
||||||
mbits = if host.system.cpu.family == "x86" then if host.is64bit then "-m64" else "-m32" else "";
|
mbits =
|
||||||
in
|
if host.system.cpu.family == "x86"
|
||||||
{
|
then
|
||||||
unpack = lib.dag.entry.before [ "patch" ] ''
|
if host.is64bit
|
||||||
|
then "-m64"
|
||||||
|
else "-m32"
|
||||||
|
else "";
|
||||||
|
in {
|
||||||
|
unpack = lib.dag.entry.before ["patch"] ''
|
||||||
# Unpack
|
# Unpack
|
||||||
tar xf ${config.src}
|
tar xf ${config.src}
|
||||||
tar xf ${config.gmp.src}
|
tar xf ${config.gmp.src}
|
||||||
|
@ -150,13 +133,13 @@ in
|
||||||
ln -s ../isl-${config.isl.version} isl
|
ln -s ../isl-${config.isl.version} isl
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patch = lib.dag.entry.between [ "configure" ] [ "unpack" ] ''
|
patch = lib.dag.entry.between ["configure"] ["unpack"] ''
|
||||||
# Patch
|
# Patch
|
||||||
# force musl even if host triple is gnu
|
# force musl even if host triple is gnu
|
||||||
sed -i 's|"os/gnu-linux"|"os/generic"|' libstdc++-v3/configure.host
|
sed -i 's|"os/gnu-linux"|"os/generic"|' libstdc++-v3/configure.host
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configure = lib.dag.entry.between [ "build" ] [ "patch" ] ''
|
configure = lib.dag.entry.between ["build"] ["patch"] ''
|
||||||
# Configure
|
# Configure
|
||||||
export CC="gcc -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so"
|
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 CXX="g++ -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so"
|
||||||
|
@ -180,12 +163,12 @@ in
|
||||||
CXXFLAGS=-static
|
CXXFLAGS=-static
|
||||||
'';
|
'';
|
||||||
|
|
||||||
build = lib.dag.entry.between [ "install" ] [ "configure" ] ''
|
build = lib.dag.entry.between ["install"] ["configure"] ''
|
||||||
# Build
|
# Build
|
||||||
make -j $NIX_BUILD_CORES
|
make -j $NIX_BUILD_CORES
|
||||||
'';
|
'';
|
||||||
|
|
||||||
install = lib.dag.entry.after [ "build" ] ''
|
install = lib.dag.entry.after ["build"] ''
|
||||||
# Install
|
# Install
|
||||||
make -j $NIX_BUILD_CORES install-strip
|
make -j $NIX_BUILD_CORES install-strip
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue