lib: Clean up how linux and gcc config is specified
The `platform` field is pointless nesting: it's just stuff that happens to be defined together, and that should be an implementation detail. This instead makes `linux-kernel` and `gcc` top level fields in platform configs. They join `rustc` there [all are optional], which was put there and not in `platform` in anticipation of a change like this. `linux-kernel.arch` in particular also becomes `linuxArch`, to match the other `*Arch`es. The next step after is this to combine the *specific* machines from `lib.systems.platforms` with `lib.systems.examples`, keeping just the "multiplatform" ones for defaulting.
This commit is contained in:
parent
77403c1c19
commit
8929989614
@ -24,8 +24,6 @@ rec {
|
|||||||
# Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
|
# Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
|
||||||
system = parse.doubleFromSystem final.parsed;
|
system = parse.doubleFromSystem final.parsed;
|
||||||
config = parse.tripleFromSystem final.parsed;
|
config = parse.tripleFromSystem final.parsed;
|
||||||
# Just a guess, based on `system`
|
|
||||||
platform = platforms.select final;
|
|
||||||
# Determine whether we are compatible with the provided CPU
|
# Determine whether we are compatible with the provided CPU
|
||||||
isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu;
|
isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu;
|
||||||
# Derived meta-data
|
# Derived meta-data
|
||||||
@ -79,7 +77,16 @@ rec {
|
|||||||
};
|
};
|
||||||
isStatic = final.isWasm || final.isRedox;
|
isStatic = final.isWasm || final.isRedox;
|
||||||
|
|
||||||
kernelArch =
|
# Just a guess, based on `system`
|
||||||
|
inherit
|
||||||
|
({
|
||||||
|
linux-kernel = args.linux-kernel or {};
|
||||||
|
gcc = args.gcc or {};
|
||||||
|
rustc = args.rust or {};
|
||||||
|
} // platforms.select final)
|
||||||
|
linux-kernel gcc rustc;
|
||||||
|
|
||||||
|
linuxArch =
|
||||||
if final.isAarch32 then "arm"
|
if final.isAarch32 then "arm"
|
||||||
else if final.isAarch64 then "arm64"
|
else if final.isAarch64 then "arm64"
|
||||||
else if final.isx86_32 then "x86"
|
else if final.isx86_32 then "x86"
|
||||||
|
@ -7,7 +7,6 @@ let
|
|||||||
|
|
||||||
riscv = bits: {
|
riscv = bits: {
|
||||||
config = "riscv${bits}-unknown-linux-gnu";
|
config = "riscv${bits}-unknown-linux-gnu";
|
||||||
platform = platforms.riscv-multiplatform;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -17,84 +16,68 @@ rec {
|
|||||||
#
|
#
|
||||||
powernv = {
|
powernv = {
|
||||||
config = "powerpc64le-unknown-linux-gnu";
|
config = "powerpc64le-unknown-linux-gnu";
|
||||||
platform = platforms.powernv;
|
|
||||||
};
|
};
|
||||||
musl-power = {
|
musl-power = {
|
||||||
config = "powerpc64le-unknown-linux-musl";
|
config = "powerpc64le-unknown-linux-musl";
|
||||||
platform = platforms.powernv;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sheevaplug = {
|
sheevaplug = {
|
||||||
config = "armv5tel-unknown-linux-gnueabi";
|
config = "armv5tel-unknown-linux-gnueabi";
|
||||||
platform = platforms.sheevaplug;
|
} // platforms.sheevaplug;
|
||||||
};
|
|
||||||
|
|
||||||
raspberryPi = {
|
raspberryPi = {
|
||||||
config = "armv6l-unknown-linux-gnueabihf";
|
config = "armv6l-unknown-linux-gnueabihf";
|
||||||
platform = platforms.raspberrypi;
|
} // platforms.raspberrypi;
|
||||||
};
|
|
||||||
|
|
||||||
remarkable1 = {
|
remarkable1 = {
|
||||||
config = "armv7l-unknown-linux-gnueabihf";
|
config = "armv7l-unknown-linux-gnueabihf";
|
||||||
platform = platforms.zero-gravitas;
|
} // platforms.zero-gravitas;
|
||||||
};
|
|
||||||
|
|
||||||
remarkable2 = {
|
remarkable2 = {
|
||||||
config = "armv7l-unknown-linux-gnueabihf";
|
config = "armv7l-unknown-linux-gnueabihf";
|
||||||
platform = platforms.zero-sugar;
|
} // platforms.zero-sugar;
|
||||||
};
|
|
||||||
|
|
||||||
armv7l-hf-multiplatform = {
|
armv7l-hf-multiplatform = {
|
||||||
config = "armv7l-unknown-linux-gnueabihf";
|
config = "armv7l-unknown-linux-gnueabihf";
|
||||||
platform = platforms.armv7l-hf-multiplatform;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
aarch64-multiplatform = {
|
aarch64-multiplatform = {
|
||||||
config = "aarch64-unknown-linux-gnu";
|
config = "aarch64-unknown-linux-gnu";
|
||||||
platform = platforms.aarch64-multiplatform;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
armv7a-android-prebuilt = {
|
armv7a-android-prebuilt = {
|
||||||
config = "armv7a-unknown-linux-androideabi";
|
config = "armv7a-unknown-linux-androideabi";
|
||||||
sdkVer = "29";
|
sdkVer = "29";
|
||||||
ndkVer = "21";
|
ndkVer = "21";
|
||||||
platform = platforms.armv7a-android;
|
|
||||||
useAndroidPrebuilt = true;
|
useAndroidPrebuilt = true;
|
||||||
};
|
} // platforms.armv7a-android;
|
||||||
|
|
||||||
aarch64-android-prebuilt = {
|
aarch64-android-prebuilt = {
|
||||||
config = "aarch64-unknown-linux-android";
|
config = "aarch64-unknown-linux-android";
|
||||||
sdkVer = "29";
|
sdkVer = "29";
|
||||||
ndkVer = "21";
|
ndkVer = "21";
|
||||||
platform = platforms.aarch64-multiplatform;
|
|
||||||
useAndroidPrebuilt = true;
|
useAndroidPrebuilt = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
scaleway-c1 = armv7l-hf-multiplatform // rec {
|
scaleway-c1 = armv7l-hf-multiplatform // platforms.scaleway-c1;
|
||||||
platform = platforms.scaleway-c1;
|
|
||||||
inherit (platform.gcc) fpu;
|
|
||||||
};
|
|
||||||
|
|
||||||
pogoplug4 = {
|
pogoplug4 = {
|
||||||
config = "armv5tel-unknown-linux-gnueabi";
|
config = "armv5tel-unknown-linux-gnueabi";
|
||||||
platform = platforms.pogoplug4;
|
} // platforms.pogoplug4;
|
||||||
};
|
|
||||||
|
|
||||||
ben-nanonote = {
|
ben-nanonote = {
|
||||||
config = "mipsel-unknown-linux-uclibc";
|
config = "mipsel-unknown-linux-uclibc";
|
||||||
platform = platforms.ben_nanonote;
|
} // platforms.ben_nanonote;
|
||||||
};
|
|
||||||
|
|
||||||
fuloongminipc = {
|
fuloongminipc = {
|
||||||
config = "mipsel-unknown-linux-gnu";
|
config = "mipsel-unknown-linux-gnu";
|
||||||
platform = platforms.fuloong2f_n32;
|
} // platforms.fuloong2f_n32;
|
||||||
};
|
|
||||||
|
|
||||||
muslpi = raspberryPi // {
|
muslpi = raspberryPi // {
|
||||||
config = "armv6l-unknown-linux-musleabihf";
|
config = "armv6l-unknown-linux-musleabihf";
|
||||||
};
|
};
|
||||||
|
|
||||||
aarch64-multiplatform-musl = aarch64-multiplatform // {
|
aarch64-multiplatform-musl = {
|
||||||
config = "aarch64-unknown-linux-musl";
|
config = "aarch64-unknown-linux-musl";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -110,13 +93,11 @@ rec {
|
|||||||
riscv64-embedded = {
|
riscv64-embedded = {
|
||||||
config = "riscv64-none-elf";
|
config = "riscv64-none-elf";
|
||||||
libc = "newlib";
|
libc = "newlib";
|
||||||
platform = platforms.riscv-multiplatform;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
riscv32-embedded = {
|
riscv32-embedded = {
|
||||||
config = "riscv32-none-elf";
|
config = "riscv32-none-elf";
|
||||||
libc = "newlib";
|
libc = "newlib";
|
||||||
platform = platforms.riscv-multiplatform;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mmix = {
|
mmix = {
|
||||||
@ -136,13 +117,11 @@ rec {
|
|||||||
vc4 = {
|
vc4 = {
|
||||||
config = "vc4-elf";
|
config = "vc4-elf";
|
||||||
libc = "newlib";
|
libc = "newlib";
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
or1k = {
|
or1k = {
|
||||||
config = "or1k-elf";
|
config = "or1k-elf";
|
||||||
libc = "newlib";
|
libc = "newlib";
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
arm-embedded = {
|
arm-embedded = {
|
||||||
@ -204,7 +183,6 @@ rec {
|
|||||||
xcodeVer = "11.3.1";
|
xcodeVer = "11.3.1";
|
||||||
xcodePlatform = "iPhoneOS";
|
xcodePlatform = "iPhoneOS";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
iphone32 = {
|
iphone32 = {
|
||||||
@ -214,7 +192,6 @@ rec {
|
|||||||
xcodeVer = "11.3.1";
|
xcodeVer = "11.3.1";
|
||||||
xcodePlatform = "iPhoneOS";
|
xcodePlatform = "iPhoneOS";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
iphone64-simulator = {
|
iphone64-simulator = {
|
||||||
@ -224,7 +201,6 @@ rec {
|
|||||||
xcodeVer = "11.3.1";
|
xcodeVer = "11.3.1";
|
||||||
xcodePlatform = "iPhoneSimulator";
|
xcodePlatform = "iPhoneSimulator";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
iphone32-simulator = {
|
iphone32-simulator = {
|
||||||
@ -234,7 +210,6 @@ rec {
|
|||||||
xcodeVer = "11.3.1";
|
xcodeVer = "11.3.1";
|
||||||
xcodePlatform = "iPhoneSimulator";
|
xcodePlatform = "iPhoneSimulator";
|
||||||
useiOSPrebuilt = true;
|
useiOSPrebuilt = true;
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -245,7 +220,6 @@ rec {
|
|||||||
mingw32 = {
|
mingw32 = {
|
||||||
config = "i686-w64-mingw32";
|
config = "i686-w64-mingw32";
|
||||||
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# 64 bit mingw-w64
|
# 64 bit mingw-w64
|
||||||
@ -253,7 +227,6 @@ rec {
|
|||||||
# That's the triplet they use in the mingw-w64 docs.
|
# That's the triplet they use in the mingw-w64 docs.
|
||||||
config = "x86_64-w64-mingw32";
|
config = "x86_64-w64-mingw32";
|
||||||
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# BSDs
|
# BSDs
|
||||||
@ -275,6 +248,5 @@ rec {
|
|||||||
# Ghcjs
|
# Ghcjs
|
||||||
ghcjs = {
|
ghcjs = {
|
||||||
config = "js-unknown-ghcjs";
|
config = "js-unknown-ghcjs";
|
||||||
platform = {};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,49 @@
|
|||||||
{ lib }:
|
{ lib }:
|
||||||
rec {
|
rec {
|
||||||
pcBase = {
|
pc = {
|
||||||
|
linux-kernel = {
|
||||||
name = "pc";
|
name = "pc";
|
||||||
kernelBaseConfig = "defconfig";
|
|
||||||
|
baseConfig = "defconfig";
|
||||||
# Build whatever possible as a module, if not stated in the extra config.
|
# Build whatever possible as a module, if not stated in the extra config.
|
||||||
kernelAutoModules = true;
|
autoModules = true;
|
||||||
kernelTarget = "bzImage";
|
target = "bzImage";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
pc64 = pcBase // { kernelArch = "x86_64"; };
|
pc_simplekernel = lib.recursiveUpdate pc {
|
||||||
|
linux-kernel.autoModules = false;
|
||||||
pc32 = pcBase // { kernelArch = "i386"; };
|
|
||||||
|
|
||||||
pc32_simplekernel = pc32 // {
|
|
||||||
kernelAutoModules = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
pc64_simplekernel = pc64 // {
|
|
||||||
kernelAutoModules = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
powernv = {
|
powernv = {
|
||||||
|
linux-kernel = {
|
||||||
name = "PowerNV";
|
name = "PowerNV";
|
||||||
kernelArch = "powerpc";
|
|
||||||
kernelBaseConfig = "powernv_defconfig";
|
baseConfig = "powernv_defconfig";
|
||||||
kernelTarget = "zImage";
|
target = "zImage";
|
||||||
kernelInstallTarget = "install";
|
installTarget = "install";
|
||||||
kernelFile = "vmlinux";
|
file = "vmlinux";
|
||||||
kernelAutoModules = true;
|
autoModules = true;
|
||||||
# avoid driver/FS trouble arising from unusual page size
|
# avoid driver/FS trouble arising from unusual page size
|
||||||
kernelExtraConfig = ''
|
extraConfig = ''
|
||||||
PPC_64K_PAGES n
|
PPC_64K_PAGES n
|
||||||
PPC_4K_PAGES y
|
PPC_4K_PAGES y
|
||||||
IPV6 y
|
IPV6 y
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
##
|
##
|
||||||
## ARM
|
## ARM
|
||||||
##
|
##
|
||||||
|
|
||||||
pogoplug4 = {
|
pogoplug4 = {
|
||||||
|
linux-kernel = {
|
||||||
name = "pogoplug4";
|
name = "pogoplug4";
|
||||||
|
|
||||||
gcc = {
|
baseConfig = "multi_v5_defconfig";
|
||||||
arch = "armv5te";
|
autoModules = false;
|
||||||
};
|
extraConfig = ''
|
||||||
|
|
||||||
kernelBaseConfig = "multi_v5_defconfig";
|
|
||||||
kernelArch = "arm";
|
|
||||||
kernelAutoModules = false;
|
|
||||||
kernelExtraConfig =
|
|
||||||
''
|
|
||||||
# Ubi for the mtd
|
# Ubi for the mtd
|
||||||
MTD_UBI y
|
MTD_UBI y
|
||||||
UBIFS_FS y
|
UBIFS_FS y
|
||||||
@ -61,18 +53,23 @@ rec {
|
|||||||
UBIFS_FS_ZLIB y
|
UBIFS_FS_ZLIB y
|
||||||
UBIFS_FS_DEBUG n
|
UBIFS_FS_DEBUG n
|
||||||
'';
|
'';
|
||||||
kernelMakeFlags = [ "LOADADDR=0x8000" ];
|
makeFlags = [ "LOADADDR=0x8000" ];
|
||||||
kernelTarget = "uImage";
|
target = "uImage";
|
||||||
# TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
|
# TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
|
||||||
#kernelDTB = true;
|
#DTB = true;
|
||||||
|
};
|
||||||
|
gcc = {
|
||||||
|
arch = "armv5te";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
sheevaplug = {
|
sheevaplug = {
|
||||||
|
linux-kernel = {
|
||||||
name = "sheevaplug";
|
name = "sheevaplug";
|
||||||
kernelBaseConfig = "multi_v5_defconfig";
|
|
||||||
kernelArch = "arm";
|
baseConfig = "multi_v5_defconfig";
|
||||||
kernelAutoModules = false;
|
autoModules = false;
|
||||||
kernelExtraConfig = ''
|
extraConfig = ''
|
||||||
BLK_DEV_RAM y
|
BLK_DEV_RAM y
|
||||||
BLK_DEV_INITRD y
|
BLK_DEV_INITRD y
|
||||||
BLK_DEV_CRYPTOLOOP m
|
BLK_DEV_CRYPTOLOOP m
|
||||||
@ -170,27 +167,30 @@ rec {
|
|||||||
KGDB_SERIAL_CONSOLE y
|
KGDB_SERIAL_CONSOLE y
|
||||||
KGDB_KDB y
|
KGDB_KDB y
|
||||||
'';
|
'';
|
||||||
kernelMakeFlags = [ "LOADADDR=0x0200000" ];
|
makeFlags = [ "LOADADDR=0x0200000" ];
|
||||||
kernelTarget = "uImage";
|
target = "uImage";
|
||||||
kernelDTB = true; # Beyond 3.10
|
DTB = true; # Beyond 3.10
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "armv5te";
|
arch = "armv5te";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
raspberrypi = {
|
raspberrypi = {
|
||||||
|
linux-kernel = {
|
||||||
name = "raspberrypi";
|
name = "raspberrypi";
|
||||||
kernelBaseConfig = "bcm2835_defconfig";
|
|
||||||
kernelDTB = true;
|
baseConfig = "bcm2835_defconfig";
|
||||||
kernelArch = "arm";
|
DTB = true;
|
||||||
kernelAutoModules = true;
|
autoModules = true;
|
||||||
kernelPreferBuiltin = true;
|
preferBuiltin = true;
|
||||||
kernelExtraConfig = ''
|
extraConfig = ''
|
||||||
# Disable OABI to have seccomp_filter (required for systemd)
|
# Disable OABI to have seccomp_filter (required for systemd)
|
||||||
# https://github.com/raspberrypi/firmware/issues/651
|
# https://github.com/raspberrypi/firmware/issues/651
|
||||||
OABI_COMPAT n
|
OABI_COMPAT n
|
||||||
'';
|
'';
|
||||||
kernelTarget = "zImage";
|
target = "zImage";
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "armv6";
|
arch = "armv6";
|
||||||
fpu = "vfp";
|
fpu = "vfp";
|
||||||
@ -201,13 +201,15 @@ rec {
|
|||||||
raspberrypi2 = armv7l-hf-multiplatform;
|
raspberrypi2 = armv7l-hf-multiplatform;
|
||||||
|
|
||||||
zero-gravitas = {
|
zero-gravitas = {
|
||||||
|
linux-kernel = {
|
||||||
name = "zero-gravitas";
|
name = "zero-gravitas";
|
||||||
kernelBaseConfig = "zero-gravitas_defconfig";
|
|
||||||
kernelArch = "arm";
|
baseConfig = "zero-gravitas_defconfig";
|
||||||
# kernelTarget verified by checking /boot on reMarkable 1 device
|
# Target verified by checking /boot on reMarkable 1 device
|
||||||
kernelTarget = "zImage";
|
target = "zImage";
|
||||||
kernelAutoModules = false;
|
autoModules = false;
|
||||||
kernelDTB = true;
|
DTB = true;
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
fpu = "neon";
|
fpu = "neon";
|
||||||
cpu = "cortex-a9";
|
cpu = "cortex-a9";
|
||||||
@ -215,13 +217,15 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
zero-sugar = {
|
zero-sugar = {
|
||||||
|
linux-kernel = {
|
||||||
name = "zero-sugar";
|
name = "zero-sugar";
|
||||||
kernelBaseConfig = "zero-sugar_defconfig";
|
|
||||||
kernelArch = "arm";
|
baseConfig = "zero-sugar_defconfig";
|
||||||
kernelDTB = true;
|
DTB = true;
|
||||||
kernelAutoModules = false;
|
autoModules = false;
|
||||||
kernelPreferBuiltin = true;
|
preferBuiltin = true;
|
||||||
kernelTarget = "zImage";
|
target = "zImage";
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
cpu = "cortex-a7";
|
cpu = "cortex-a7";
|
||||||
fpu = "neon-vfpv4";
|
fpu = "neon-vfpv4";
|
||||||
@ -229,7 +233,7 @@ rec {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
scaleway-c1 = armv7l-hf-multiplatform // {
|
scaleway-c1 = lib.recursiveUpdate armv7l-hf-multiplatform {
|
||||||
gcc = {
|
gcc = {
|
||||||
cpu = "cortex-a9";
|
cpu = "cortex-a9";
|
||||||
fpu = "vfpv3";
|
fpu = "vfpv3";
|
||||||
@ -237,12 +241,11 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
utilite = {
|
utilite = {
|
||||||
|
linux-kernel = {
|
||||||
name = "utilite";
|
name = "utilite";
|
||||||
kernelBaseConfig = "multi_v7_defconfig";
|
maseConfig = "multi_v7_defconfig";
|
||||||
kernelArch = "arm";
|
autoModules = false;
|
||||||
kernelAutoModules = false;
|
extraConfig = ''
|
||||||
kernelExtraConfig =
|
|
||||||
''
|
|
||||||
# Ubi for the mtd
|
# Ubi for the mtd
|
||||||
MTD_UBI y
|
MTD_UBI y
|
||||||
UBIFS_FS y
|
UBIFS_FS y
|
||||||
@ -252,35 +255,37 @@ rec {
|
|||||||
UBIFS_FS_ZLIB y
|
UBIFS_FS_ZLIB y
|
||||||
UBIFS_FS_DEBUG n
|
UBIFS_FS_DEBUG n
|
||||||
'';
|
'';
|
||||||
kernelMakeFlags = [ "LOADADDR=0x10800000" ];
|
makeFlags = [ "LOADADDR=0x10800000" ];
|
||||||
kernelTarget = "uImage";
|
target = "uImage";
|
||||||
kernelDTB = true;
|
DTB = true;
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
cpu = "cortex-a9";
|
cpu = "cortex-a9";
|
||||||
fpu = "neon";
|
fpu = "neon";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
guruplug = sheevaplug // {
|
guruplug = lib.recursiveUpdate sheevaplug {
|
||||||
# Define `CONFIG_MACH_GURUPLUG' (see
|
# Define `CONFIG_MACH_GURUPLUG' (see
|
||||||
# <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
|
# <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
|
||||||
# and other GuruPlug-specific things. Requires the `guruplug-defconfig'
|
# and other GuruPlug-specific things. Requires the `guruplug-defconfig'
|
||||||
# patch.
|
# patch.
|
||||||
|
linux-kernel.baseConfig = "guruplug_defconfig";
|
||||||
kernelBaseConfig = "guruplug_defconfig";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
beaglebone = armv7l-hf-multiplatform // {
|
beaglebone = lib.recursiveUpdate armv7l-hf-multiplatform {
|
||||||
|
linux-kernel = {
|
||||||
name = "beaglebone";
|
name = "beaglebone";
|
||||||
kernelBaseConfig = "bb.org_defconfig";
|
baseConfig = "bb.org_defconfig";
|
||||||
kernelAutoModules = false;
|
autoModules = false;
|
||||||
kernelExtraConfig = ""; # TBD kernel config
|
extraConfig = ""; # TBD kernel config
|
||||||
kernelTarget = "zImage";
|
target = "zImage";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://developer.android.com/ndk/guides/abis#v7a
|
# https://developer.android.com/ndk/guides/abis#v7a
|
||||||
armv7a-android = {
|
armv7a-android = {
|
||||||
name = "armeabi-v7a";
|
linux-kernel.name = "armeabi-v7a";
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "armv7-a";
|
arch = "armv7-a";
|
||||||
float-abi = "softfp";
|
float-abi = "softfp";
|
||||||
@ -289,14 +294,15 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
armv7l-hf-multiplatform = {
|
armv7l-hf-multiplatform = {
|
||||||
|
linux-kernel = {
|
||||||
name = "armv7l-hf-multiplatform";
|
name = "armv7l-hf-multiplatform";
|
||||||
kernelBaseConfig = "multi_v7_defconfig";
|
Major = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
|
||||||
kernelArch = "arm";
|
baseConfig = "multi_v7_defconfig";
|
||||||
kernelDTB = true;
|
DTB = true;
|
||||||
kernelAutoModules = true;
|
autoModules = true;
|
||||||
kernelPreferBuiltin = true;
|
PreferBuiltin = true;
|
||||||
kernelTarget = "zImage";
|
target = "zImage";
|
||||||
kernelExtraConfig = ''
|
extraConfig = ''
|
||||||
# Serial port for Raspberry Pi 3. Upstream forgot to add it to the ARMv7 defconfig.
|
# Serial port for Raspberry Pi 3. Upstream forgot to add it to the ARMv7 defconfig.
|
||||||
SERIAL_8250_BCM2835AUX y
|
SERIAL_8250_BCM2835AUX y
|
||||||
SERIAL_8250_EXTENDED y
|
SERIAL_8250_EXTENDED y
|
||||||
@ -312,6 +318,7 @@ rec {
|
|||||||
# https://github.com/raspberrypi/firmware/issues/651
|
# https://github.com/raspberrypi/firmware/issues/651
|
||||||
OABI_COMPAT n
|
OABI_COMPAT n
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
# Some table about fpu flags:
|
# Some table about fpu flags:
|
||||||
# http://community.arm.com/servlet/JiveServlet/showImage/38-1981-3827/blogentry-103749-004812900+1365712953_thumb.png
|
# http://community.arm.com/servlet/JiveServlet/showImage/38-1981-3827/blogentry-103749-004812900+1365712953_thumb.png
|
||||||
@ -336,14 +343,14 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
aarch64-multiplatform = {
|
aarch64-multiplatform = {
|
||||||
|
linux-kernel = {
|
||||||
name = "aarch64-multiplatform";
|
name = "aarch64-multiplatform";
|
||||||
kernelBaseConfig = "defconfig";
|
baseConfig = "defconfig";
|
||||||
kernelArch = "arm64";
|
DTB = true;
|
||||||
kernelDTB = true;
|
autoModules = true;
|
||||||
kernelAutoModules = true;
|
preferBuiltin = true;
|
||||||
kernelPreferBuiltin = true;
|
extraConfig = ''
|
||||||
kernelExtraConfig = ''
|
# Raspberry Pi 3 stuff. Not needed for s >= 4.10.
|
||||||
# Raspberry Pi 3 stuff. Not needed for kernels >= 4.10.
|
|
||||||
ARCH_BCM2835 y
|
ARCH_BCM2835 y
|
||||||
BCM2835_MBOX y
|
BCM2835_MBOX y
|
||||||
BCM2835_WDT y
|
BCM2835_WDT y
|
||||||
@ -363,7 +370,8 @@ rec {
|
|||||||
# which our initrd builder can't currently do easily.
|
# which our initrd builder can't currently do easily.
|
||||||
USB_XHCI_TEGRA m
|
USB_XHCI_TEGRA m
|
||||||
'';
|
'';
|
||||||
kernelTarget = "Image";
|
target = "Image";
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "armv8-a";
|
arch = "armv8-a";
|
||||||
};
|
};
|
||||||
@ -374,8 +382,9 @@ rec {
|
|||||||
##
|
##
|
||||||
|
|
||||||
ben_nanonote = {
|
ben_nanonote = {
|
||||||
|
linux-kernel = {
|
||||||
name = "ben_nanonote";
|
name = "ben_nanonote";
|
||||||
kernelArch = "mips";
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "mips32";
|
arch = "mips32";
|
||||||
float = "soft";
|
float = "soft";
|
||||||
@ -383,11 +392,11 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fuloong2f_n32 = {
|
fuloong2f_n32 = {
|
||||||
|
linux-kernel = {
|
||||||
name = "fuloong2f_n32";
|
name = "fuloong2f_n32";
|
||||||
kernelBaseConfig = "lemote2f_defconfig";
|
baseConfig = "lemote2f_defconfig";
|
||||||
kernelArch = "mips";
|
autoModules = false;
|
||||||
kernelAutoModules = false;
|
extraConfig = ''
|
||||||
kernelExtraConfig = ''
|
|
||||||
MIGRATION n
|
MIGRATION n
|
||||||
COMPACTION n
|
COMPACTION n
|
||||||
|
|
||||||
@ -451,7 +460,8 @@ rec {
|
|||||||
# The kernel doesn't boot at all, with FTRACE
|
# The kernel doesn't boot at all, with FTRACE
|
||||||
FTRACE n
|
FTRACE n
|
||||||
'';
|
'';
|
||||||
kernelTarget = "vmlinux";
|
target = "vmlinux";
|
||||||
|
};
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "loongson2f";
|
arch = "loongson2f";
|
||||||
float = "hard";
|
float = "hard";
|
||||||
@ -464,34 +474,36 @@ rec {
|
|||||||
##
|
##
|
||||||
|
|
||||||
riscv-multiplatform = {
|
riscv-multiplatform = {
|
||||||
|
linux-kernel = {
|
||||||
name = "riscv-multiplatform";
|
name = "riscv-multiplatform";
|
||||||
kernelArch = "riscv";
|
target = "vmlinux";
|
||||||
kernelTarget = "vmlinux";
|
autoModules = true;
|
||||||
kernelAutoModules = true;
|
baseConfig = "defconfig";
|
||||||
kernelBaseConfig = "defconfig";
|
extraConfig = ''
|
||||||
kernelExtraConfig = ''
|
|
||||||
FTRACE n
|
FTRACE n
|
||||||
SERIAL_OF_PLATFORM y
|
SERIAL_OF_PLATFORM y
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
select = platform:
|
select = platform:
|
||||||
# x86
|
# x86
|
||||||
/**/ if platform.isx86_32 then pc32
|
/**/ if platform.isx86 then pc
|
||||||
else if platform.isx86_64 then pc64
|
|
||||||
|
|
||||||
# ARM
|
# ARM
|
||||||
else if platform.isAarch32 then let
|
else if platform.isAarch32 then let
|
||||||
version = platform.parsed.cpu.version or null;
|
version = platform.parsed.cpu.version or null;
|
||||||
in if version == null then pcBase
|
in if version == null then pc
|
||||||
else if lib.versionOlder version "6" then sheevaplug
|
else if lib.versionOlder version "6" then sheevaplug
|
||||||
else if lib.versionOlder version "7" then raspberrypi
|
else if lib.versionOlder version "7" then raspberrypi
|
||||||
else armv7l-hf-multiplatform
|
else armv7l-hf-multiplatform
|
||||||
else if platform.isAarch64 then aarch64-multiplatform
|
else if platform.isAarch64 then aarch64-multiplatform
|
||||||
|
|
||||||
|
else if platform.isRiscV then riscv-multiplatform
|
||||||
|
|
||||||
else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then fuloong2f_n32
|
else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then fuloong2f_n32
|
||||||
|
|
||||||
else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv
|
else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv
|
||||||
|
|
||||||
else pcBase;
|
else pc;
|
||||||
}
|
}
|
||||||
|
@ -592,6 +592,22 @@ http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/e
|
|||||||
<literal>/etc/netgroup</literal> defines network-wide groups and may affect to setups using NIS.
|
<literal>/etc/netgroup</literal> defines network-wide groups and may affect to setups using NIS.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Platforms, like <varname>stdenv.hostPlatform</varname>, no longer have a <varname>platform</varname> attribute.
|
||||||
|
It has been (mostly) flattoned away:
|
||||||
|
</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para><varname>platform.gcc</varname> is now <varname>gcc</varname></para></listitem>
|
||||||
|
<listitem><para><literal>platform.kernel*</literal> is now <literal>linux-kernel.*</literal></para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
<para>
|
||||||
|
Additionally, <varname>platform.kernelArch</varname> moved to the top level as <varname>linuxArch</varname> to match the other <literal>*Arch</literal> variables.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The <varname>platform</varname> grouping of these things never meant anything, and was just a historial/implementation artifact that was overdue removal.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
@ -68,11 +68,11 @@ let
|
|||||||
patchShebangs scripts/*
|
patchShebangs scripts/*
|
||||||
substituteInPlace scripts/Makefile.lib \
|
substituteInPlace scripts/Makefile.lib \
|
||||||
--replace 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget))' 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) -@'
|
--replace 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget))' 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) -@'
|
||||||
make ${pkgs.stdenv.hostPlatform.platform.kernelBaseConfig} ARCH="${pkgs.stdenv.hostPlatform.platform.kernelArch}"
|
make ${pkgs.stdenv.hostPlatform.linux-kernel.baseConfig} ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
|
||||||
make dtbs ARCH="${pkgs.stdenv.hostPlatform.platform.kernelArch}"
|
make dtbs ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
make dtbs_install INSTALL_DTBS_PATH=$out/dtbs ARCH="${pkgs.stdenv.hostPlatform.platform.kernelArch}"
|
make dtbs_install INSTALL_DTBS_PATH=$out/dtbs ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ in
|
|||||||
options = {
|
options = {
|
||||||
hardware.deviceTree = {
|
hardware.deviceTree = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = pkgs.stdenv.hostPlatform.platform.kernelDTB or false;
|
default = pkgs.stdenv.hostPlatform.linux-kernel.DTB or false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = ''
|
description = ''
|
||||||
Build device tree files. These are used to describe the
|
Build device tree files. These are used to describe the
|
||||||
|
@ -88,7 +88,7 @@ with lib;
|
|||||||
|
|
||||||
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
|
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
|
||||||
#!ipxe
|
#!ipxe
|
||||||
kernel ${pkgs.stdenv.hostPlatform.platform.kernelTarget} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams}
|
kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams}
|
||||||
initrd initrd
|
initrd initrd
|
||||||
boot
|
boot
|
||||||
'';
|
'';
|
||||||
|
@ -587,10 +587,10 @@ in
|
|||||||
|
|
||||||
nix.systemFeatures = mkDefault (
|
nix.systemFeatures = mkDefault (
|
||||||
[ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++
|
[ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++
|
||||||
optionals (pkgs.hostPlatform.platform ? gcc.arch) (
|
optionals (pkgs.hostPlatform ? gcc.arch) (
|
||||||
# a builder can run code for `platform.gcc.arch` and inferior architectures
|
# a builder can run code for `gcc.arch` and inferior architectures
|
||||||
[ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++
|
[ "gccarch-${pkgs.hostPlatform.gcc.arch}" ] ++
|
||||||
map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${pkgs.hostPlatform.platform.gcc.arch}
|
map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${pkgs.hostPlatform.gcc.arch}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ in
|
|||||||
|
|
||||||
system.boot.loader.kernelFile = mkOption {
|
system.boot.loader.kernelFile = mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
default = pkgs.stdenv.hostPlatform.platform.kernelTarget;
|
default = pkgs.stdenv.hostPlatform.linux-kernel.target;
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = ''
|
description = ''
|
||||||
Name of the kernel file to be passed to the bootloader.
|
Name of the kernel file to be passed to the bootloader.
|
||||||
|
@ -59,7 +59,7 @@ in
|
|||||||
|
|
||||||
system.build.installBootLoader = generationsDirBuilder;
|
system.build.installBootLoader = generationsDirBuilder;
|
||||||
system.boot.loader.id = "generationsDir";
|
system.boot.loader.id = "generationsDir";
|
||||||
system.boot.loader.kernelFile = platform.kernelTarget;
|
system.boot.loader.kernelFile = linux-kernel.target;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,6 @@ in
|
|||||||
|
|
||||||
system.build.installBootLoader = builder;
|
system.build.installBootLoader = builder;
|
||||||
system.boot.loader.id = "raspberrypi";
|
system.boot.loader.id = "raspberrypi";
|
||||||
system.boot.loader.kernelFile = platform.kernelTarget;
|
system.boot.loader.kernelFile = linux-kernel.target;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ let
|
|||||||
in
|
in
|
||||||
tarball //
|
tarball //
|
||||||
{ meta = {
|
{ meta = {
|
||||||
description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.platform.name}";
|
description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.linux-kernel.name}";
|
||||||
maintainers = map (x: lib.maintainers.${x}) maintainers;
|
maintainers = map (x: lib.maintainers.${x}) maintainers;
|
||||||
};
|
};
|
||||||
inherit config;
|
inherit config;
|
||||||
@ -105,7 +105,7 @@ let
|
|||||||
modules = makeModules module {};
|
modules = makeModules module {};
|
||||||
};
|
};
|
||||||
build = configEvaled.config.system.build;
|
build = configEvaled.config.system.build;
|
||||||
kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.platform.kernelTarget;
|
kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.linux-kernel.target;
|
||||||
in
|
in
|
||||||
pkgs.symlinkJoin {
|
pkgs.symlinkJoin {
|
||||||
name = "netboot";
|
name = "netboot";
|
||||||
|
@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
|
|||||||
startScript = if stdenv.isx86_32 then "START_LINUX_X86"
|
startScript = if stdenv.isx86_32 then "START_LINUX_X86"
|
||||||
else if stdenv.isx86_64 then "START_LINUX_X86_64"
|
else if stdenv.isx86_64 then "START_LINUX_X86_64"
|
||||||
#else if stdenv.isDarwin then "START_MACOS.app" # disabled because I cannot test on Darwin
|
#else if stdenv.isDarwin then "START_MACOS.app" # disabled because I cannot test on Darwin
|
||||||
else abort "Unsupported platform: ${stdenv.platform.kernelArch}.";
|
else abort "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
|
||||||
|
|
||||||
linuxExecutable = if stdenv.isx86_32 then "pixilang_linux_x86"
|
linuxExecutable = if stdenv.isx86_32 then "pixilang_linux_x86"
|
||||||
else if stdenv.isx86_64 then "pixilang_linux_x86_64"
|
else if stdenv.isx86_64 then "pixilang_linux_x86_64"
|
||||||
|
@ -75,7 +75,7 @@ in
|
|||||||
|
|
||||||
CROSVM_CARGO_TEST_KERNEL_BINARY =
|
CROSVM_CARGO_TEST_KERNEL_BINARY =
|
||||||
lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform)
|
lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform)
|
||||||
"${linux}/${stdenv.hostPlatform.platform.kernelTarget}";
|
"${linux}/${stdenv.hostPlatform.linux-kernel.target}";
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit adhdSrc;
|
inherit adhdSrc;
|
||||||
|
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildPhase = ''(
|
buildPhase = ''(
|
||||||
cd src
|
cd src
|
||||||
./mk.sh ${stdenv.buildPlatform.platform.kernelArch}
|
./mk.sh ${stdenv.buildPlatform.linuxArch}
|
||||||
)'';
|
)'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
@ -190,7 +190,7 @@ stdenv.mkDerivation {
|
|||||||
else if targetPlatform.isRiscV then "lriscv"
|
else if targetPlatform.isRiscV then "lriscv"
|
||||||
else throw "unknown emulation for platform: ${targetPlatform.config}";
|
else throw "unknown emulation for platform: ${targetPlatform.config}";
|
||||||
in if targetPlatform.useLLVM or false then ""
|
in if targetPlatform.useLLVM or false then ""
|
||||||
else targetPlatform.platform.bfdEmulation or (fmt + sep + arch);
|
else targetPlatform.bfdEmulation or (fmt + sep + arch);
|
||||||
|
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
depsTargetTargetPropagated = extraPackages;
|
depsTargetTargetPropagated = extraPackages;
|
||||||
|
@ -403,31 +403,31 @@ stdenv.mkDerivation {
|
|||||||
# discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in
|
# discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in
|
||||||
# that case.
|
# that case.
|
||||||
+ optionalString ((targetPlatform ? platform.gcc.arch) &&
|
+ optionalString ((targetPlatform ? platform.gcc.arch) &&
|
||||||
isGccArchSupported targetPlatform.platform.gcc.arch) ''
|
isGccArchSupported targetPlatform.gcc.arch) ''
|
||||||
echo "-march=${targetPlatform.platform.gcc.arch}" >> $out/nix-support/cc-cflags-before
|
echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
|
||||||
''
|
''
|
||||||
|
|
||||||
# -mcpu is not very useful. You should use mtune and march
|
# -mcpu is not very useful. You should use mtune and march
|
||||||
# instead. It’s provided here for backwards compatibility.
|
# instead. It’s provided here for backwards compatibility.
|
||||||
+ optionalString (targetPlatform ? platform.gcc.cpu) ''
|
+ optionalString (targetPlatform ? platform.gcc.cpu) ''
|
||||||
echo "-mcpu=${targetPlatform.platform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
|
echo "-mcpu=${targetPlatform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
|
||||||
''
|
''
|
||||||
|
|
||||||
# -mfloat-abi only matters on arm32 but we set it here
|
# -mfloat-abi only matters on arm32 but we set it here
|
||||||
# unconditionally just in case. If the abi specifically sets hard
|
# unconditionally just in case. If the abi specifically sets hard
|
||||||
# vs. soft floats we use it here.
|
# vs. soft floats we use it here.
|
||||||
+ optionalString (targetPlatform ? platform.gcc.float-abi) ''
|
+ optionalString (targetPlatform ? platform.gcc.float-abi) ''
|
||||||
echo "-mfloat-abi=${targetPlatform.platform.gcc.float-abi}" >> $out/nix-support/cc-cflags-before
|
echo "-mfloat-abi=${targetPlatform.gcc.float-abi}" >> $out/nix-support/cc-cflags-before
|
||||||
''
|
''
|
||||||
+ optionalString (targetPlatform ? platform.gcc.fpu) ''
|
+ optionalString (targetPlatform ? platform.gcc.fpu) ''
|
||||||
echo "-mfpu=${targetPlatform.platform.gcc.fpu}" >> $out/nix-support/cc-cflags-before
|
echo "-mfpu=${targetPlatform.gcc.fpu}" >> $out/nix-support/cc-cflags-before
|
||||||
''
|
''
|
||||||
+ optionalString (targetPlatform ? platform.gcc.mode) ''
|
+ optionalString (targetPlatform ? platform.gcc.mode) ''
|
||||||
echo "-mmode=${targetPlatform.platform.gcc.mode}" >> $out/nix-support/cc-cflags-before
|
echo "-mmode=${targetPlatform.gcc.mode}" >> $out/nix-support/cc-cflags-before
|
||||||
''
|
''
|
||||||
+ optionalString (targetPlatform ? platform.gcc.tune &&
|
+ optionalString (targetPlatform ? platform.gcc.tune &&
|
||||||
isGccArchSupported targetPlatform.platform.gcc.tune) ''
|
isGccArchSupported targetPlatform.gcc.tune) ''
|
||||||
echo "-mtune=${targetPlatform.platform.gcc.tune}" >> $out/nix-support/cc-cflags-before
|
echo "-mtune=${targetPlatform.gcc.tune}" >> $out/nix-support/cc-cflags-before
|
||||||
''
|
''
|
||||||
|
|
||||||
# TODO: categorize these and figure out a better place for them
|
# TODO: categorize these and figure out a better place for them
|
||||||
|
@ -56,13 +56,13 @@ in
|
|||||||
, prepend ? []
|
, prepend ? []
|
||||||
|
|
||||||
# Whether to wrap the initramfs in a u-boot image.
|
# Whether to wrap the initramfs in a u-boot image.
|
||||||
, makeUInitrd ? stdenvNoCC.hostPlatform.platform.kernelTarget == "uImage"
|
, makeUInitrd ? stdenvNoCC.hostPlatform.linux-kernel.target == "uImage"
|
||||||
|
|
||||||
# If generating a u-boot image, the architecture to use. The default
|
# If generating a u-boot image, the architecture to use. The default
|
||||||
# guess may not align with u-boot's nomenclature correctly, so it can
|
# guess may not align with u-boot's nomenclature correctly, so it can
|
||||||
# be overridden.
|
# be overridden.
|
||||||
# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 for a list.
|
# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 for a list.
|
||||||
, uInitrdArch ? stdenvNoCC.hostPlatform.kernelArch
|
, uInitrdArch ? stdenvNoCC.hostPlatform.linuxArch
|
||||||
|
|
||||||
# The name of the compression, as recognised by u-boot.
|
# The name of the compression, as recognised by u-boot.
|
||||||
# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L195-204 for a list.
|
# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L195-204 for a list.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ pkgs
|
{ pkgs
|
||||||
, kernel ? pkgs.linux
|
, kernel ? pkgs.linux
|
||||||
, img ? pkgs.stdenv.hostPlatform.platform.kernelTarget
|
, img ? pkgs.stdenv.hostPlatform.linux-kernel.target
|
||||||
, storeDir ? builtins.storeDir
|
, storeDir ? builtins.storeDir
|
||||||
, rootModules ?
|
, rootModules ?
|
||||||
[ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
|
[ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ lib, targetPlatform }:
|
{ lib, targetPlatform }:
|
||||||
|
|
||||||
let
|
let
|
||||||
p = targetPlatform.platform.gcc or {}
|
p = targetPlatform.gcc or {}
|
||||||
// targetPlatform.parsed.abi;
|
// targetPlatform.parsed.abi;
|
||||||
in lib.concatLists [
|
in lib.concatLists [
|
||||||
(lib.optional (!targetPlatform.isx86_64 && p ? arch) "--with-arch=${p.arch}") # --with-arch= is unknown flag on x86_64
|
(lib.optional (!targetPlatform.isx86_64 && p ? arch) "--with-arch=${p.arch}") # --with-arch= is unknown flag on x86_64
|
||||||
|
@ -123,7 +123,7 @@ stdenv.mkDerivation rec {
|
|||||||
let
|
let
|
||||||
arch = stdenv.lib.head (stdenv.lib.splitString "-" stdenv.system);
|
arch = stdenv.lib.head (stdenv.lib.splitString "-" stdenv.system);
|
||||||
march = {
|
march = {
|
||||||
x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64";
|
x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64";
|
||||||
i686 = "pentium4";
|
i686 = "pentium4";
|
||||||
aarch64 = "armv8-a";
|
aarch64 = "armv8-a";
|
||||||
}.${arch}
|
}.${arch}
|
||||||
|
@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
|
|||||||
let
|
let
|
||||||
arch = head (splitString "-" stdenv.system);
|
arch = head (splitString "-" stdenv.system);
|
||||||
march = {
|
march = {
|
||||||
x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64";
|
x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64";
|
||||||
i686 = "pentium4";
|
i686 = "pentium4";
|
||||||
aarch64 = "armv8-a";
|
aarch64 = "armv8-a";
|
||||||
}.${arch}
|
}.${arch}
|
||||||
|
@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
|
|||||||
let
|
let
|
||||||
arch = head (splitString "-" stdenv.system);
|
arch = head (splitString "-" stdenv.system);
|
||||||
march = {
|
march = {
|
||||||
x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64";
|
x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64";
|
||||||
i686 = "pentium4";
|
i686 = "pentium4";
|
||||||
aarch64 = "armv8-a";
|
aarch64 = "armv8-a";
|
||||||
}.${arch}
|
}.${arch}
|
||||||
|
@ -158,7 +158,7 @@ stdenv.mkDerivation ({
|
|||||||
"--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
|
"--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
|
||||||
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||||
(lib.flip lib.withFeature "fp"
|
(lib.flip lib.withFeature "fp"
|
||||||
(stdenv.hostPlatform.platform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))
|
(stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))
|
||||||
"--with-__thread"
|
"--with-__thread"
|
||||||
] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.isAarch32) [
|
] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.isAarch32) [
|
||||||
"--host=arm-linux-gnueabi"
|
"--host=arm-linux-gnueabi"
|
||||||
|
@ -88,7 +88,7 @@ qtModule {
|
|||||||
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
|
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
|
||||||
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
|
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
|
||||||
"-Wno-class-memaccess"
|
"-Wno-class-memaccess"
|
||||||
] ++ lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [
|
] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [
|
||||||
# it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
|
# it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
|
||||||
# TODO: investigate and fix properly
|
# TODO: investigate and fix properly
|
||||||
"-march=westmere"
|
"-march=westmere"
|
||||||
|
@ -73,9 +73,9 @@ let
|
|||||||
if isLinux
|
if isLinux
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
x: x.platform == "manylinux1_${stdenv.platform.kernelArch}"
|
x: x.platform == "manylinux1_${stdenv.hostPlatform.linuxArch}"
|
||||||
|| x.platform == "manylinux2010_${stdenv.platform.kernelArch}"
|
|| x.platform == "manylinux2010_${stdenv.hostPlatform.linuxArch}"
|
||||||
|| x.platform == "manylinux2014_${stdenv.platform.kernelArch}"
|
|| x.platform == "manylinux2014_${stdenv.hostPlatform.linuxArch}"
|
||||||
|| x.platform == "any"
|
|| x.platform == "any"
|
||||||
)
|
)
|
||||||
else (x: hasInfix "macosx" x.platform || x.platform == "any");
|
else (x: hasInfix "macosx" x.platform || x.platform == "any");
|
||||||
|
@ -95,7 +95,7 @@ let
|
|||||||
else if stdenv.isDarwin then "darwin"
|
else if stdenv.isDarwin then "darwin"
|
||||||
else throw "Unsupported platform"
|
else throw "Unsupported platform"
|
||||||
);
|
);
|
||||||
platform_machine = stdenv.platform.kernelArch;
|
platform_machine = stdenv.hostPlatform.linuxArch;
|
||||||
platform_python_implementation =
|
platform_python_implementation =
|
||||||
let
|
let
|
||||||
impl = python.passthru.implementation;
|
impl = python.passthru.implementation;
|
||||||
|
@ -60,18 +60,17 @@ in
|
|||||||
|
|
||||||
configureFlags = let
|
configureFlags = let
|
||||||
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
||||||
host = stdenv.hostPlatform.platform;
|
inherit (stdenv.hostPlatform) gcc isArch32;
|
||||||
isAarch32 = stdenv.hostPlatform.isAarch32;
|
|
||||||
in sharedConfigureFlags ++ [
|
in sharedConfigureFlags ++ [
|
||||||
"--without-dtrace"
|
"--without-dtrace"
|
||||||
] ++ (optionals isCross [
|
] ++ (optionals isCross [
|
||||||
"--cross-compiling"
|
"--cross-compiling"
|
||||||
"--without-intl"
|
"--without-intl"
|
||||||
"--without-snapshot"
|
"--without-snapshot"
|
||||||
]) ++ (optionals (isCross && isAarch32 && hasAttr "fpu" host.gcc) [
|
]) ++ (optionals (isCross && isAarch32 && hasAttr "fpu" gcc) [
|
||||||
"--with-arm-fpu=${host.gcc.fpu}"
|
"--with-arm-fpu=${gcc.fpu}"
|
||||||
]) ++ (optionals (isCross && isAarch32 && hasAttr "float-abi" host.gcc) [
|
]) ++ (optionals (isCross && isAarch32 && hasAttr "float-abi" gcc) [
|
||||||
"--with-arm-float-abi=${host.gcc.float-abi}"
|
"--with-arm-float-abi=${gcc.float-abi}"
|
||||||
]) ++ (optionals (isCross && isAarch32) [
|
]) ++ (optionals (isCross && isAarch32) [
|
||||||
"--dest-cpu=arm"
|
"--dest-cpu=arm"
|
||||||
]) ++ extraConfigFlags;
|
]) ++ extraConfigFlags;
|
||||||
|
@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
"ARCH=${stdenv.hostPlatform.platform.kernelArch}"
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
||||||
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
];
|
];
|
||||||
|
@ -7,7 +7,7 @@ let
|
|||||||
pname = "linux-headers";
|
pname = "linux-headers";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or stdenvNoCC.hostPlatform.kernelArch;
|
ARCH = stdenvNoCC.hostPlatform.linuxArch;
|
||||||
|
|
||||||
# It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
|
# It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
|
||||||
# We do this so we have a build->build, not build->host, C compiler.
|
# We do this so we have a build->build, not build->host, C compiler.
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
# symbolic name and `patch' is the actual patch. The patch may
|
# symbolic name and `patch' is the actual patch. The patch may
|
||||||
# optionally be compressed with gzip or bzip2.
|
# optionally be compressed with gzip or bzip2.
|
||||||
kernelPatches ? []
|
kernelPatches ? []
|
||||||
, ignoreConfigErrors ? stdenv.hostPlatform.platform.name != "pc" ||
|
, ignoreConfigErrors ? stdenv.hostPlatform.linux-kernel.name != "pc" ||
|
||||||
stdenv.hostPlatform != stdenv.buildPlatform
|
stdenv.hostPlatform != stdenv.buildPlatform
|
||||||
, extraMeta ? {}
|
, extraMeta ? {}
|
||||||
|
|
||||||
@ -51,10 +51,10 @@
|
|||||||
, isLibre ? false
|
, isLibre ? false
|
||||||
, isHardened ? false
|
, isHardened ? false
|
||||||
|
|
||||||
# easy overrides to stdenv.hostPlatform.platform members
|
# easy overrides to stdenv.hostPlatform.linux-kernel members
|
||||||
, autoModules ? stdenv.hostPlatform.platform.kernelAutoModules
|
, autoModules ? stdenv.hostPlatform.linux-kernel.autoModules
|
||||||
, preferBuiltin ? stdenv.hostPlatform.platform.kernelPreferBuiltin or false
|
, preferBuiltin ? stdenv.hostPlatform.linux-kernel.preferBuiltin or false
|
||||||
, kernelArch ? stdenv.hostPlatform.platform.kernelArch
|
, kernelArch ? stdenv.hostPlatform.linuxArch
|
||||||
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
@ -87,7 +87,7 @@ let
|
|||||||
intermediateNixConfig = configfile.moduleStructuredConfig.intermediateNixConfig
|
intermediateNixConfig = configfile.moduleStructuredConfig.intermediateNixConfig
|
||||||
# extra config in legacy string format
|
# extra config in legacy string format
|
||||||
+ extraConfig
|
+ extraConfig
|
||||||
+ lib.optionalString (stdenv.hostPlatform.platform ? kernelExtraConfig) stdenv.hostPlatform.platform.kernelExtraConfig;
|
+ stdenv.hostPlatform.linux-kernel.extraConfig or "";
|
||||||
|
|
||||||
structuredConfigFromPatches =
|
structuredConfigFromPatches =
|
||||||
map ({extraStructuredConfig ? {}, ...}: {settings=extraStructuredConfig;}) kernelPatches;
|
map ({extraStructuredConfig ? {}, ...}: {settings=extraStructuredConfig;}) kernelPatches;
|
||||||
@ -113,11 +113,11 @@ let
|
|||||||
nativeBuildInputs = [ perl gmp libmpc mpfr ]
|
nativeBuildInputs = [ perl gmp libmpc mpfr ]
|
||||||
++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ];
|
++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ];
|
||||||
|
|
||||||
platformName = stdenv.hostPlatform.platform.name;
|
platformName = stdenv.hostPlatform.linux-kernel.name;
|
||||||
# e.g. "defconfig"
|
# e.g. "defconfig"
|
||||||
kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.platform.kernelBaseConfig;
|
kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.linux-kernel.baseConfig;
|
||||||
# e.g. "bzImage"
|
# e.g. "bzImage"
|
||||||
kernelTarget = stdenv.hostPlatform.platform.kernelTarget;
|
kernelTarget = stdenv.hostPlatform.linux-kernel.target;
|
||||||
|
|
||||||
prePatch = kernel.prePatch + ''
|
prePatch = kernel.prePatch + ''
|
||||||
# Patch kconfig to print "###" after every question so that
|
# Patch kconfig to print "###" after every question so that
|
||||||
|
@ -64,10 +64,10 @@ let
|
|||||||
|
|
||||||
commonMakeFlags = [
|
commonMakeFlags = [
|
||||||
"O=$(buildRoot)"
|
"O=$(buildRoot)"
|
||||||
] ++ lib.optionals (stdenv.hostPlatform.platform ? kernelMakeFlags)
|
] ++ lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags)
|
||||||
stdenv.hostPlatform.platform.kernelMakeFlags;
|
stdenv.hostPlatform.linux-kernel.makeFlags;
|
||||||
|
|
||||||
drvAttrs = config_: platform: kernelPatches: configfile:
|
drvAttrs = config_: kernelConf: kernelPatches: configfile:
|
||||||
let
|
let
|
||||||
config = let attrName = attr: "CONFIG_" + attr; in {
|
config = let attrName = attr: "CONFIG_" + attr; in {
|
||||||
isSet = attr: hasAttr (attrName attr) config;
|
isSet = attr: hasAttr (attrName attr) config;
|
||||||
@ -171,7 +171,7 @@ let
|
|||||||
|
|
||||||
buildFlags = [
|
buildFlags = [
|
||||||
"KBUILD_BUILD_VERSION=1-NixOS"
|
"KBUILD_BUILD_VERSION=1-NixOS"
|
||||||
platform.kernelTarget
|
kernelConf.target
|
||||||
"vmlinux" # for "perf" and things like that
|
"vmlinux" # for "perf" and things like that
|
||||||
] ++ optional isModular "modules";
|
] ++ optional isModular "modules";
|
||||||
|
|
||||||
@ -186,16 +186,16 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# Some image types need special install targets (e.g. uImage is installed with make uinstall)
|
# Some image types need special install targets (e.g. uImage is installed with make uinstall)
|
||||||
installTargets = [ (
|
installTargets = [
|
||||||
if platform ? kernelInstallTarget then platform.kernelInstallTarget
|
(kernelConf.installTarget or (
|
||||||
else if platform.kernelTarget == "uImage" then "uinstall"
|
/**/ if kernelConf.target == "uImage" then "uinstall"
|
||||||
else if platform.kernelTarget == "zImage" || platform.kernelTarget == "Image.gz" then "zinstall"
|
else if kernelConf.target == "zImage" || kernelConf.target == "Image.gz" then "zinstall"
|
||||||
else "install"
|
else "install"))
|
||||||
) ];
|
];
|
||||||
|
|
||||||
postInstall = (optionalString installsFirmware ''
|
postInstall = (optionalString installsFirmware ''
|
||||||
mkdir -p $out/lib/firmware
|
mkdir -p $out/lib/firmware
|
||||||
'') + (if (platform ? kernelDTB && platform.kernelDTB) then ''
|
'') + (if (kernelConf.DTB or false) then ''
|
||||||
make $makeFlags "''${makeFlagsArray[@]}" dtbs dtbs_install INSTALL_DTBS_PATH=$out/dtbs
|
make $makeFlags "''${makeFlagsArray[@]}" dtbs dtbs_install INSTALL_DTBS_PATH=$out/dtbs
|
||||||
'' else "") + (if isModular then ''
|
'' else "") + (if isModular then ''
|
||||||
mkdir -p $dev
|
mkdir -p $dev
|
||||||
@ -300,7 +300,7 @@ in
|
|||||||
assert (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") -> libelf != null;
|
assert (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") -> libelf != null;
|
||||||
assert lib.versionAtLeast version "5.8" -> elfutils != null;
|
assert lib.versionAtLeast version "5.8" -> elfutils != null;
|
||||||
|
|
||||||
stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches configfile) // {
|
stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile) // {
|
||||||
pname = "linux";
|
pname = "linux";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
|
|||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd ]
|
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd ]
|
||||||
++ optional (stdenv.hostPlatform.platform.kernelTarget == "uImage") buildPackages.ubootTools
|
++ optional (stdenv.hostPlatform.linux-kernel.target == "uImage") buildPackages.ubootTools
|
||||||
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
|
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
|
||||||
# Removed util-linuxMinimal since it should not be a dependency.
|
# Removed util-linuxMinimal since it should not be a dependency.
|
||||||
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
|
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
|
||||||
@ -322,10 +322,10 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
|
|||||||
makeFlags = commonMakeFlags ++ [
|
makeFlags = commonMakeFlags ++ [
|
||||||
"CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
"CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
||||||
"HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
|
"HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
|
||||||
"ARCH=${stdenv.hostPlatform.platform.kernelArch}"
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
||||||
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
];
|
];
|
||||||
|
|
||||||
karch = stdenv.hostPlatform.platform.kernelArch;
|
karch = stdenv.hostPlatform.linuxArch;
|
||||||
})
|
})
|
||||||
|
@ -25,11 +25,11 @@ stdenv.mkDerivation rec {
|
|||||||
hardeningDisable = [ "format" "stackprotector" ];
|
hardeningDisable = [ "format" "stackprotector" ];
|
||||||
|
|
||||||
makeFlags = commonMakeFlags ++ [
|
makeFlags = commonMakeFlags ++ [
|
||||||
"KLIBCARCH=${stdenv.hostPlatform.platform.kernelArch}"
|
"KLIBCARCH=${stdenv.hostPlatform.linuxArch}"
|
||||||
"KLIBCKERNELSRC=${linuxHeaders}"
|
"KLIBCKERNELSRC=${linuxHeaders}"
|
||||||
] # TODO(@Ericson2314): We now can get the ABI from
|
] # TODO(@Ericson2314): We now can get the ABI from
|
||||||
# `stdenv.hostPlatform.parsed.abi`, is this still a good idea?
|
# `stdenv.hostPlatform.parsed.abi`, is this still a good idea?
|
||||||
++ lib.optional (stdenv.hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y"
|
++ lib.optional (stdenv.hostPlatform.linuxArch == "arm") "CONFIG_AEABI=y"
|
||||||
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILE=${stdenv.cc.targetPrefix}";
|
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILE=${stdenv.cc.targetPrefix}";
|
||||||
|
|
||||||
# Install static binaries as well.
|
# Install static binaries as well.
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
|||||||
buildInputs = [ nukeReferences ];
|
buildInputs = [ nukeReferences ];
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"ARCH=${stdenv.hostPlatform.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
|
"ARCH=${stdenv.hostPlatform.linuxArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
|
||||||
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us.
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us.
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"ARCH=${stdenv.hostPlatform.platform.kernelArch}"
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
||||||
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n"))
|
("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n"))
|
||||||
("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
|
("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
|
||||||
|
@ -68,7 +68,7 @@ stdenv.mkDerivation {
|
|||||||
cat << EOF | parseconfig
|
cat << EOF | parseconfig
|
||||||
${nixConfig}
|
${nixConfig}
|
||||||
${extraConfig}
|
${extraConfig}
|
||||||
${stdenv.hostPlatform.platform.uclibc.extraConfig or ""}
|
${stdenv.hostPlatform.uclibc.extraConfig or ""}
|
||||||
EOF
|
EOF
|
||||||
( set +o pipefail; yes "" | make oldconfig )
|
( set +o pipefail; yes "" | make oldconfig )
|
||||||
'';
|
'';
|
||||||
|
@ -279,7 +279,7 @@ in rec {
|
|||||||
} // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
|
} // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
|
||||||
NIX_HARDENING_ENABLE = enabledHardeningOptions;
|
NIX_HARDENING_ENABLE = enabledHardeningOptions;
|
||||||
} // lib.optionalAttrs (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform ? platform.gcc.arch) {
|
} // lib.optionalAttrs (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform ? platform.gcc.arch) {
|
||||||
requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.platform.gcc.arch}" ];
|
requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.gcc.arch}" ];
|
||||||
} // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
|
} // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
|
||||||
inherit __darwinAllowLocalNetworking;
|
inherit __darwinAllowLocalNetworking;
|
||||||
# TODO: remove lib.unique once nix has a list canonicalization primitive
|
# TODO: remove lib.unique once nix has a list canonicalization primitive
|
||||||
|
@ -19284,7 +19284,7 @@ in
|
|||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
set -x
|
set -x
|
||||||
make \
|
make \
|
||||||
ARCH=${stdenv.hostPlatform.kernelArch} \
|
ARCH=${stdenv.hostPlatform.linuxArch} \
|
||||||
HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
|
HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
|
||||||
${makeTarget}
|
${makeTarget}
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user