Merge remote-tracking branch 'upstream/master' into staging

This commit is contained in:
Tuomas Tynkkynen 2017-01-27 02:18:44 +02:00
commit be0e48e48f
35 changed files with 330 additions and 45 deletions

View File

@ -15,7 +15,7 @@ rec {
freebsd = ["i686-freebsd" "x86_64-freebsd"]; freebsd = ["i686-freebsd" "x86_64-freebsd"];
gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */ gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */
illumos = ["x86_64-solaris"]; illumos = ["x86_64-solaris"];
linux = ["i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "mips64el-linux"]; linux = ["i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mips64el-linux"];
netbsd = ["i686-netbsd" "x86_64-netbsd"]; netbsd = ["i686-netbsd" "x86_64-netbsd"];
openbsd = ["i686-openbsd" "x86_64-openbsd"]; openbsd = ["i686-openbsd" "x86_64-openbsd"];
unix = linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos; unix = linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos;

View File

@ -108,7 +108,7 @@ in {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
Whether to include the 32-bit pulseaudio libraries in the systemn or not. Whether to include the 32-bit pulseaudio libraries in the system or not.
This is only useful on 64-bit systems and currently limited to x86_64-linux. This is only useful on 64-bit systems and currently limited to x86_64-linux.
''; '';
}; };

View File

@ -0,0 +1,63 @@
# To build, use:
# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-aarch64.nix -A config.system.build.sdImage
{ config, lib, pkgs, ... }:
let
extlinux-conf-builder =
import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
inherit pkgs;
};
in
{
imports = [
../../profiles/minimal.nix
../../profiles/installation-device.nix
./sd-image.nix
];
assertions = lib.singleton {
assertion = pkgs.stdenv.system == "aarch64-linux";
message = "sd-image-aarch64.nix can be only built natively on Aarch64 / ARM64; " +
"it cannot be cross compiled";
};
# Needed by RPi firmware
nixpkgs.config.allowUnfree = true;
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = ["console=ttyS0,115200n8" "console=tty0"];
boot.consoleLogLevel = 7;
# FIXME: this probably should be in installation-device.nix
users.extraUsers.root.initialHashedPassword = "";
sdImage = {
populateBootCommands = let
# Contains a couple of fixes for booting a Linux kernel, will hopefully appear upstream soon.
patchedUboot = pkgs.ubootRaspberryPi3_64bit.overrideAttrs (oldAttrs: {
src = pkgs.fetchFromGitHub {
owner = "dezgeg";
repo = "u-boot";
rev = "baab53ec244fe44def01948a0f10e67342d401e6";
sha256 = "0r5j2pc42ws3w3im0a9c6bh01czz5kapqrqp0ik9ra823cw73lxr";
};
});
configTxt = pkgs.writeText "config.txt" ''
kernel=u-boot-rpi3.bin
arm_control=0x200
enable_uart=1
'';
in ''
for f in bootcode.bin fixup.dat start.elf; do
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/$f boot/
done
cp ${patchedUboot}/u-boot.bin boot/u-boot-rpi3.bin
cp ${configTxt} boot/config.txt
${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
'';
};
}

View File

@ -1,3 +1,5 @@
# To build, use:
# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix -A config.system.build.sdImage
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
@ -46,7 +48,7 @@ in
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/$f boot/ cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/$f boot/
done done
cp ${pkgs.ubootRaspberryPi2}/u-boot.bin boot/u-boot-rpi2.bin cp ${pkgs.ubootRaspberryPi2}/u-boot.bin boot/u-boot-rpi2.bin
cp ${pkgs.ubootRaspberryPi3}/u-boot.bin boot/u-boot-rpi3.bin cp ${pkgs.ubootRaspberryPi3_32bit}/u-boot.bin boot/u-boot-rpi3.bin
cp ${configTxt} boot/config.txt cp ${configTxt} boot/config.txt
${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
''; '';

View File

@ -1,3 +1,5 @@
# To build, use:
# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix -A config.system.build.sdImage
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let

View File

@ -7,12 +7,12 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "discord"; pname = "discord";
version = "0.0.13"; version = "0.0.1";
name = "${pname}-${version}"; name = "${pname}-${version}";
src = fetchurl { src = fetchurl {
url = "https://cdn-canary.discordapp.com/apps/linux/${version}/${pname}-canary-${version}.tar.gz"; url = "https://cdn.discordapp.com/apps/linux/${version}/${pname}-${version}.tar.gz";
sha256 = "1pwb8y80z1bmfln5wd1vrhras0xygd1j15sib0g9vaig4mc55cs6"; sha256 = "10m3ixvhmxdw55awd84gx13m222qjykj7gcigbjabcvsgp2z63xs";
}; };
libPath = stdenv.lib.makeLibraryPath [ libPath = stdenv.lib.makeLibraryPath [
@ -30,11 +30,11 @@ stdenv.mkDerivation rec {
# see pkgs/applications/misc/adobe-reader/builder.sh # see pkgs/applications/misc/adobe-reader/builder.sh
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "$out:$libPath" \ --set-rpath "$out:$libPath" \
$out/DiscordCanary $out/Discord
paxmark m $out/DiscordCanary paxmark m $out/Discord
ln -s $out/DiscordCanary $out/bin/ ln -s $out/Discord $out/bin/
ln -s $out/discord.png $out/share/pixmaps ln -s $out/discord.png $out/share/pixmaps
# Putting udev in the path won't work :( # Putting udev in the path won't work :(
@ -44,9 +44,9 @@ stdenv.mkDerivation rec {
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
name = pname; name = pname;
exec = "DiscordCanary"; exec = "Discord";
icon = pname; icon = pname;
desktopName = "Discord Canary"; desktopName = "Discord";
genericName = meta.description; genericName = meta.description;
categories = "Network;InstantMessaging;"; categories = "Network;InstantMessaging;";
}; };

View File

@ -272,6 +272,7 @@ stdenv.mkDerivation {
if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
# ARM with a wildcard, which can be "" or "-armhf". # ARM with a wildcard, which can be "" or "-armhf".
if stdenv.isArm then "ld-linux*.so.3" else if stdenv.isArm then "ld-linux*.so.3" else
if stdenv.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else
if stdenv.system == "powerpc-linux" then "ld.so.1" else if stdenv.system == "powerpc-linux" then "ld.so.1" else
if stdenv.system == "mips64el-linux" then "ld.so.1" else if stdenv.system == "mips64el-linux" then "ld.so.1" else
if stdenv.system == "x86_64-darwin" then "/usr/lib/dyld" else if stdenv.system == "x86_64-darwin" then "/usr/lib/dyld" else

View File

@ -0,0 +1,12 @@
preConfigurePhases+=" updateAutotoolsGnuConfigScriptsPhase"
updateAutotoolsGnuConfigScriptsPhase() {
if [ -n "$dontUpdateAutotoolsGnuConfigScripts" ]; then return; fi
for script in config.sub config.guess; do
for f in $(find . -name "$script"); do
echo "Updating Autotools / GNU config script to a newer upstream version: $f"
cp -f "@gnu_config@/$script" "$f"
done
done
}

View File

@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
# Fixes an issue with version detection under perl 5.22.x # Fixes an issue with version detection under perl 5.22.x
sed -i 's/(defined\((@TEMPLATE_FILE)\))/\1/' config/milestone.pl sed -i 's/(defined\((@TEMPLATE_FILE)\))/\1/' config/milestone.pl
'' + stdenv.lib.optionalString stdenv.isAarch64 ''
patch -p1 -d ../.. < ${./aarch64-double-conversion.patch}
''; '';
preConfigure = '' preConfigure = ''

View File

@ -0,0 +1,13 @@
diff -ru mozjs17.0.0-orig/mfbt/double-conversion/utils.h mozjs17.0.0/mfbt/double-conversion/utils.h
--- mozjs17.0.0-orig/mfbt/double-conversion/utils.h 2013-02-11 17:33:28.000000000 -0500
+++ mozjs17.0.0/mfbt/double-conversion/utils.h 2016-12-03 20:39:07.915042988 -0500
@@ -58,7 +58,8 @@
defined(__mips__) || defined(__powerpc__) || \
defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
defined(__SH4__) || defined(__alpha__) || \
- defined(_MIPS_ARCH_MIPS32R2)
+ defined(_MIPS_ARCH_MIPS32R2) || \
+ defined(__AARCH64EL__)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
#if defined(_WIN32)

View File

@ -93,7 +93,7 @@ stdenv.mkDerivation ({
"--enable-kernel=2.6.32" "--enable-kernel=2.6.32"
] ++ lib.optionals (cross != null) [ ] ++ lib.optionals (cross != null) [
(if cross.withTLS then "--with-tls" else "--without-tls") (if cross.withTLS then "--with-tls" else "--without-tls")
(if cross.float == "soft" then "--without-fp" else "--with-fp") (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
] ++ lib.optionals (cross != null ] ++ lib.optionals (cross != null
&& cross.platform ? kernelMajor && cross.platform ? kernelMajor
&& cross.platform.kernelMajor == "2.6") [ && cross.platform.kernelMajor == "2.6") [

View File

@ -0,0 +1,39 @@
{ stdenv, fetchurl }:
let
rev = "6a82322dd05cdc57b4cd9f7effdf1e2fd6f7482b";
# Don't use fetchgit as this is needed during Aarch64 bootstrapping
configGuess = fetchurl {
url = "http://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=${rev}";
sha256 = "1yj9yi94h7z4z6jzickddv64ksz1aq5kj0c7krgzjn8xf8p3avmh";
};
configSub = fetchurl {
url = "http://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=${rev}";
sha256 = "1qsqdpla6icbzskkk7v3zxrpzlpqlc94ny9hyy5wh5lm5rwwfvb7";
};
in
stdenv.mkDerivation rec {
name = "gnu-config-${version}";
version = "2016-12-31";
buildCommand = ''
mkdir -p $out
cp ${configGuess} $out/config.guess
cp ${configSub} $out/config.sub
'';
meta = with stdenv.lib; {
description = "Attempt to guess a canonical system name";
homepage = http://savannah.gnu.org/projects/config;
license = licenses.gpl3;
# In addition to GPLv3:
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program.
maintainers = [ maintainers.dezgeg ];
platforms = platforms.all;
};
}

View File

@ -0,0 +1,13 @@
diff -ru gnu-efi-3.0.4-orig/lib/aarch64/initplat.c gnu-efi-3.0.4/lib/aarch64/initplat.c
--- gnu-efi-3.0.4-orig/lib/aarch64/initplat.c 2016-03-17 09:53:14.000000000 -0400
+++ gnu-efi-3.0.4/lib/aarch64/initplat.c 2016-12-03 17:53:57.166575974 -0500
@@ -41,7 +41,8 @@
void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n)
{
- unsigned char *p = dest, *q = src;
+ unsigned char *p = dest;
+ const unsigned char *q = src;
while (n--)
*p++ = *q++;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pciutils }: { stdenv, fetchurl, pciutils }: with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gnu-efi-${version}"; name = "gnu-efi-${version}";
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "1bzq5czw5dxlvpgs9ij2iz7q6krwhja87vc982r6vffcqcl0982i"; sha256 = "1bzq5czw5dxlvpgs9ij2iz7q6krwhja87vc982r6vffcqcl0982i";
}; };
patches = optional stdenv.isAarch64 ./aarch64-fix-discarded-qualifier.patch;
buildInputs = [ pciutils ]; buildInputs = [ pciutils ];
hardeningDisable = [ "stackprotector" ]; hardeningDisable = [ "stackprotector" ];

View File

@ -0,0 +1,12 @@
diff --git a/configure b/configure
index 6c4e868..0298e19 100755
--- a/configure
+++ b/configure
@@ -14501,6 +14501,7 @@ else
case "$host_cpu" in
a29k | \
+ aarch64* | \
alpha* | \
arc | \
arm* | strongarm* | xscale* | \

View File

@ -8,6 +8,12 @@ stdenv.mkDerivation rec {
sha256 = "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44"; sha256 = "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44";
}; };
# Based on https://github.com/davidgfnet/buildroot-Os/blob/69fe6065b9dd1cb4dcc0a4b554e42cc2e5bd0d60/package/libsigsegv/libsigsegv-0002-fix-aarch64-build.patch
# but applied directly to configure since we can't use autoreconf while bootstrapping.
patches = if stdenv.isAarch64 || stdenv.cross.arch or "" == "aarch64"
then [ ./aarch64.patch ]
else null; # TODO: change to lib.optional on next mass rebuild
# https://github.com/NixOS/nixpkgs/issues/6028 # https://github.com/NixOS/nixpkgs/issues/6028
doCheck = false; doCheck = false;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, xz }: { stdenv, fetchurl, fetchpatch, autoreconfHook, xz }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libunwind-1.1"; name = "libunwind-1.1";
@ -8,13 +8,18 @@ stdenv.mkDerivation rec {
sha256 = "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx"; sha256 = "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx";
}; };
buildInputs = stdenv.lib.optional stdenv.isAarch64 autoreconfHook;
patches = [ ./libunwind-1.1-lzma.patch ./cve-2015-3239.patch patches = [ ./libunwind-1.1-lzma.patch ./cve-2015-3239.patch
# https://lists.nongnu.org/archive/html/libunwind-devel/2014-04/msg00000.html # https://lists.nongnu.org/archive/html/libunwind-devel/2014-04/msg00000.html
(fetchpatch { (fetchpatch {
url = "https://raw.githubusercontent.com/dropbox/pyston/1b2e676417b0f5f17526ece0ed840aa88c744145/libunwind_patches/0001-Change-the-RBP-validation-heuristic-to-allow-size-0-.patch"; url = "https://raw.githubusercontent.com/dropbox/pyston/1b2e676417b0f5f17526ece0ed840aa88c744145/libunwind_patches/0001-Change-the-RBP-validation-heuristic-to-allow-size-0-.patch";
sha256 = "1a0fsgfxmgd218nscswx7pgyb7rcn2gh6566252xhfvzhgn5i4ha"; sha256 = "1a0fsgfxmgd218nscswx7pgyb7rcn2gh6566252xhfvzhgn5i4ha";
}) })
]; ] ++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
url = "https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/77709d1c6d5c39e23c1535b1bd584be1455f2551/extra/libunwind/libunwind-aarch64.patch";
sha256 = "1mpjs8izq9wxiaf5rl4gzaxrkz0s51f9qz5qc5dj72pr84mw50w8";
});
postPatch = '' postPatch = ''
sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure

View File

@ -1,14 +1,19 @@
{ stdenv, fetchurl }: { stdenv, fetchurl, perl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.8.6"; version = "0.9.3";
name = "liburcu-${version}"; name = "liburcu-${version}";
src = fetchurl { src = fetchurl {
url = "http://lttng.org/files/urcu/userspace-rcu-${version}.tar.bz2"; url = "http://lttng.org/files/urcu/userspace-rcu-${version}.tar.bz2";
sha256 = "08dbfkdj4pm9s3q56nwa1vzldkf1jav61g2r4xq7mfhlw2yd79di"; sha256 = "01j0xp3f0w147yfyzybkjvb7i67i7prsvnkssgvgwry9lvk35khv";
}; };
nativeBuildInputs = stdenv.lib.optional doCheck perl;
preCheck = "patchShebangs tests/unit";
doCheck = true;
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Userspace RCU (read-copy-update) library"; description = "Userspace RCU (read-copy-update) library";
homepage = http://lttng.org/urcu; homepage = http://lttng.org/urcu;

View File

@ -100,12 +100,18 @@ in rec {
filesToInstall = ["u-boot.bin"]; filesToInstall = ["u-boot.bin"];
}; };
ubootRaspberryPi3 = buildUBoot rec { ubootRaspberryPi3_32bit = buildUBoot rec {
defconfig = "rpi_3_32b_defconfig"; defconfig = "rpi_3_32b_defconfig";
targetPlatforms = ["armv7l-linux"]; targetPlatforms = ["armv7l-linux"];
filesToInstall = ["u-boot.bin"]; filesToInstall = ["u-boot.bin"];
}; };
ubootRaspberryPi3_64bit = buildUBoot rec {
defconfig = "rpi_3_defconfig";
targetPlatforms = ["aarch64-linux"];
filesToInstall = ["u-boot.bin"];
};
ubootWandboard = buildUBoot rec { ubootWandboard = buildUBoot rec {
defconfig = "wandboard_defconfig"; defconfig = "wandboard_defconfig";
targetPlatforms = ["armv7l-linux"]; targetPlatforms = ["armv7l-linux"];

View File

@ -12,3 +12,12 @@ stdenv bootstrap.
exit(busybox_main(argv)); exit(busybox_main(argv));
# endif # endif
# if NUM_APPLETS > 0 # if NUM_APPLETS > 0
@@ -981,7 +981,7 @@ int main(int argc UNUSED_PARAM, char **argv)
lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
# if !ENABLE_BUSYBOX
- if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
+ if (argv[1] && strstr(bb_basename(argv[0]), "busybox") != 0)
argv++;
# endif
applet_name = argv[0];

View File

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
description = "Firmware for the Raspberry Pi board"; description = "Firmware for the Raspberry Pi board";
homepage = https://github.com/raspberrypi; homepage = https://github.com/raspberrypi;
license = licenses.unfree; license = licenses.unfree;
platforms = [ "armv6l-linux" "armv7l-linux" ]; platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
maintainers = with maintainers; [ viric tavyc ]; maintainers = with maintainers; [ viric tavyc ];
}; };
} }

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, utillinux { stdenv, fetchFromGitHub, fetchpatch, utillinux
, autoconf, automake, libtool, gettext }: , autoconf, automake, libtool, gettext }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -14,6 +14,11 @@ stdenv.mkDerivation rec {
buildInputs = [ utillinux autoconf automake libtool gettext ]; buildInputs = [ utillinux autoconf automake libtool gettext ];
patches = stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
url = "https://github.com/libfuse/libfuse/commit/914871b20a901e3e1e981c92bc42b1c93b7ab81b.patch";
sha256 = "1w4j6f1awjrycycpvmlv0x5v9gprllh4dnbjxl4dyl2jgbkaw6pa";
});
preConfigure = preConfigure =
'' ''
export MOUNT_FUSE_PATH=$out/sbin export MOUNT_FUSE_PATH=$out/sbin

View File

@ -45,7 +45,7 @@ with stdenv.lib;
# Bump the maximum number of CPUs to support systems like EC2 x1.* # Bump the maximum number of CPUs to support systems like EC2 x1.*
# instances and Xeon Phi. # instances and Xeon Phi.
${optionalString (stdenv.system == "x86_64-linux") '' ${optionalString (stdenv.system == "x86_64-linux" || stdenv.system == "aarch64-linux") ''
NR_CPUS 384 NR_CPUS 384
''} ''}

View File

@ -120,7 +120,7 @@ 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 = [ (if platform.kernelTarget == "uImage" then "uinstall" else installTargets = [ (if platform.kernelTarget == "uImage" then "uinstall" else
if platform.kernelTarget == "zImage" then "zinstall" else if platform.kernelTarget == "zImage" || platform.kernelTarget == "Image.gz" then "zinstall" else
"install") ]; "install") ];
postInstall = '' postInstall = ''

View File

@ -92,6 +92,7 @@ rec {
# without proper `file` command, libtool sometimes fails # without proper `file` command, libtool sometimes fails
# to recognize 64-bit DLLs # to recognize 64-bit DLLs
++ stdenv.lib.optional (cross.config == "x86_64-w64-mingw32") pkgs.file ++ stdenv.lib.optional (cross.config == "x86_64-w64-mingw32") pkgs.file
++ stdenv.lib.optional (cross.config == "aarch64-linux-gnu") pkgs.updateAutotoolsGnuConfigScriptsHook
; ;
# Cross-linking dynamic libraries, every buildInput should # Cross-linking dynamic libraries, every buildInput should

View File

@ -44,6 +44,7 @@ in
"armv5tel-linux" = stagesLinux; "armv5tel-linux" = stagesLinux;
"armv6l-linux" = stagesLinux; "armv6l-linux" = stagesLinux;
"armv7l-linux" = stagesLinux; "armv7l-linux" = stagesLinux;
"aarch64-linux" = stagesLinux;
"mips64el-linux" = stagesLinux; "mips64el-linux" = stagesLinux;
"powerpc-linux" = /* stagesLinux */ stagesNative; "powerpc-linux" = /* stagesLinux */ stagesNative;
"x86_64-darwin" = stagesDarwin; "x86_64-darwin" = stagesDarwin;

View File

@ -311,6 +311,7 @@ let
|| system == "armv5tel-linux" || system == "armv5tel-linux"
|| system == "armv6l-linux" || system == "armv6l-linux"
|| system == "armv7l-linux" || system == "armv7l-linux"
|| system == "aarch64-linux"
|| system == "mips64el-linux"; || system == "mips64el-linux";
isGNU = system == "i686-gnu"; # GNU/Hurd isGNU = system == "i686-gnu"; # GNU/Hurd
isGlibc = isGNU # useful for `stdenvNative' isGlibc = isGNU # useful for `stdenvNative'
@ -348,6 +349,7 @@ let
isArm = system == "armv5tel-linux" isArm = system == "armv5tel-linux"
|| system == "armv6l-linux" || system == "armv6l-linux"
|| system == "armv7l-linux"; || system == "armv7l-linux";
isAarch64 = system == "aarch64-linux";
isBigEndian = system == "powerpc-linux"; isBigEndian = system == "powerpc-linux";
# Whether we should run paxctl to pax-mark binaries. # Whether we should run paxctl to pax-mark binaries.

View File

@ -0,0 +1,11 @@
{
busybox = import <nix/fetchurl.nix> {
url = http://nixos-arm.dezgeg.me/bootstrap-aarch64-for-merge/busybox;
sha256 = "12qcml1l67skpjhfjwy7gr10nc86gqcwjmz9ggp7knss8gq8pv7f";
executable = true;
};
bootstrapTools = import <nix/fetchurl.nix> {
url = http://nixos-arm.dezgeg.me/bootstrap-aarch64-for-merge/bootstrap-tools.tar.xz;
sha256 = "10sqgh0dchp1906h06jznxh8gfflnzbpfy27hng2mmc1l0c7irjr";
};
}

View File

@ -12,6 +12,7 @@
"armv5tel-linux" = import ./bootstrap-files/armv5tel.nix; "armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
"armv6l-linux" = import ./bootstrap-files/armv6l.nix; "armv6l-linux" = import ./bootstrap-files/armv6l.nix;
"armv7l-linux" = import ./bootstrap-files/armv7l.nix; "armv7l-linux" = import ./bootstrap-files/armv7l.nix;
"aarch64-linux" = import ./bootstrap-files/aarch64.nix;
"mips64el-linux" = import ./bootstrap-files/loongson2f.nix; "mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
}.${localSystem.system} }.${localSystem.system}
or (abort "unsupported platform for the pure Linux stdenv") or (abort "unsupported platform for the pure Linux stdenv")
@ -213,7 +214,9 @@ in
isl = isl_0_14; isl = isl_0_14;
}; };
}; };
extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ]; extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
}) })
@ -240,7 +243,9 @@ in
shell = self.bash + "/bin/bash"; shell = self.bash + "/bin/bash";
}; };
}; };
extraBuildInputs = [ prevStage.patchelf prevStage.xz ]; extraBuildInputs = [ prevStage.patchelf prevStage.xz ] ++
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
}) })
# Construct the final stdenv. It uses the Glibc and GCC, and adds # Construct the final stdenv. It uses the Glibc and GCC, and adds
@ -268,7 +273,9 @@ in
initialPath = initialPath =
((import ../common-path.nix) {pkgs = prevStage;}); ((import ../common-path.nix) {pkgs = prevStage;});
extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ]; extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
cc = prevStage.gcc; cc = prevStage.gcc;
@ -287,7 +294,7 @@ in
[ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk [ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk
glibc gnumake gnused gnutar gnugrep gnupatch patchelf attr acl glibc gnumake gnused gnutar gnugrep gnupatch patchelf attr acl
paxctl zlib pcre linuxHeaders ed gcc gcc.cc libsigsegv paxctl zlib pcre linuxHeaders ed gcc gcc.cc libsigsegv
]; ] ++ lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
*/ */
overrides = self: super: { overrides = self: super: {

View File

@ -50,10 +50,23 @@ let
}; };
}; };
aarch64-multiplatform-crossSystem = {
crossSystem = rec {
config = "aarch64-linux-gnu";
bigEndian = false;
arch = "aarch64";
withTLS = true;
libc = "glibc";
platform = pkgsNoParams.platforms.aarch64-multiplatform;
inherit (platform) gcc;
};
};
selectedCrossSystem = selectedCrossSystem =
if toolsArch == "armv5tel" then sheevaplugCrossSystem else if toolsArch == "armv5tel" then sheevaplugCrossSystem else
if toolsArch == "armv6l" then raspberrypiCrossSystem else if toolsArch == "armv6l" then raspberrypiCrossSystem else
if toolsArch == "armv7l" then armv7l-hf-multiplatform-crossSystem else null; if toolsArch == "armv7l" then armv7l-hf-multiplatform-crossSystem else
if toolsArch == "aarch64" then aarch64-multiplatform-crossSystem else null;
pkgs = pkgsFun ({inherit system;} // selectedCrossSystem); pkgs = pkgsFun ({inherit system;} // selectedCrossSystem);
@ -264,4 +277,5 @@ rec {
armv5tel = buildFor "armv5tel"; armv5tel = buildFor "armv5tel";
armv6l = buildFor "armv6l"; armv6l = buildFor "armv6l";
armv7l = buildFor "armv7l"; armv7l = buildFor "armv7l";
aarch64 = buildFor "aarch64";
} }

View File

@ -170,8 +170,9 @@ rec {
}; };
bootstrapFiles = { bootstrapFiles = {
busybox = "${build}/on-server/busybox"; # Make them their own store paths to test that busybox still works when the binary is named /nix/store/HASH-busybox
bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz"; busybox = runCommand "busybox" {} "cp ${build}/on-server/busybox $out";
bootstrapTools = runCommand "bootstrap-tools.tar.xz" {} "cp ${build}/on-server/bootstrap-tools.tar.xz $out";
}; };
bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; }; bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };

View File

@ -1,13 +1,15 @@
{ stdenv, pkgs, fetchurl, openssl, zlib }: { stdenv, pkgs, fetchurl, openssl, zlib }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
majorVersion = "1.6"; pname = "haproxy";
version = "${majorVersion}.6"; majorVersion = "1.7";
name = "haproxy-${version}"; minorVersion = "2";
version = "${majorVersion}.${minorVersion}";
name = "${pname}-${version}";
src = fetchurl { src = fetchurl {
url = "http://haproxy.1wt.eu/download/${majorVersion}/src/${name}.tar.gz"; url = "http://www.haproxy.org/download/${majorVersion}/src/${name}.tar.gz";
sha256 = "1xamzzfvwgh3b72f3j74ar9xcn61viszqfbdpf4cdhwc0xikvc7x"; sha256 = "0bsb5q3s1k5gqybv5p8zyvl6zh8iyidv3jb3wfmgwqad5bsl0nzr";
}; };
buildInputs = [ openssl zlib ]; buildInputs = [ openssl zlib ];

View File

@ -79,6 +79,10 @@ with pkgs;
} }
''); '');
updateAutotoolsGnuConfigScriptsHook = makeSetupHook
{ substitutions = { gnu_config = gnu-config;}; }
../build-support/setup-hooks/update-autotools-gnu-config-scripts.sh;
buildEnv = callPackage ../build-support/buildenv { }; # not actually a package buildEnv = callPackage ../build-support/buildenv { }; # not actually a package
buildFHSUserEnv = callPackage ../build-support/build-fhs-userenv { }; buildFHSUserEnv = callPackage ../build-support/build-fhs-userenv { };
@ -7460,6 +7464,8 @@ with pkgs;
gnet = callPackage ../development/libraries/gnet { }; gnet = callPackage ../development/libraries/gnet { };
gnu-config = callPackage ../development/libraries/gnu-config { };
gnu-efi = callPackage ../development/libraries/gnu-efi { }; gnu-efi = callPackage ../development/libraries/gnu-efi { };
gnutls = gnutls34; gnutls = gnutls34;
@ -11800,7 +11806,8 @@ with pkgs;
ubootPcduino3Nano ubootPcduino3Nano
ubootRaspberryPi ubootRaspberryPi
ubootRaspberryPi2 ubootRaspberryPi2
ubootRaspberryPi3 ubootRaspberryPi3_32bit
ubootRaspberryPi3_64bit
ubootWandboard ubootWandboard
; ;

View File

@ -167,7 +167,7 @@ let
preBuild = '' preBuild = ''
makeFlagsArray=( makeFlagsArray=(
linux ${stdenv.lib.optionalString stdenv.isLinux "linux"}
LUAPATH="$out/lib/lua/${lua.luaversion}" LUAPATH="$out/lib/lua/${lua.luaversion}"
LUACPATH="$out/lib/lua/${lua.luaversion}" LUACPATH="$out/lib/lua/${lua.luaversion}"
INC_PATH="-I${lua}/include" INC_PATH="-I${lua}/include"

View File

@ -443,12 +443,54 @@ rec {
}; };
}; };
selectPlatformBySystem = system: aarch64-multiplatform = {
if system == "armv6l-linux" then raspberrypi name = "aarch64-multiplatform";
else if system == "armv7l-linux" then armv7l-hf-multiplatform kernelMajor = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
else if system == "armv5tel-linux" then sheevaplug kernelHeadersBaseConfig = "defconfig";
else if system == "mips64el-linux" then fuloong2f_n32 kernelBaseConfig = "defconfig";
else if system == "x86_64-linux" then pc64 kernelArch = "arm64";
else if system == "i686-linux" then pc32 kernelDTB = true;
else pcBase; kernelAutoModules = false;
kernelExtraConfig = ''
# Raspberry Pi 3 stuff. Not needed for kernels >= 4.10.
ARCH_BCM2835 y
BCM2835_MBOX y
BCM2835_WDT y
BRCMFMAC m
DMA_BCM2835 m
DRM_VC4 m
I2C_BCM2835 m
PWM_BCM2835 m
RASPBERRYPI_FIRMWARE y
RASPBERRYPI_POWER y
SERIAL_8250_BCM2835AUX y
SERIAL_8250_EXTENDED y
SERIAL_8250_SHARE_IRQ y
SND_BCM2835_SOC_I2S m
SPI_BCM2835AUX m
SPI_BCM2835 m
# Cavium ThunderX stuff.
PCI_HOST_THUNDER_ECAM y
THUNDER_NIC_RGX y
THUNDER_NIC_BGX y
THUNDER_NIC_PF y
THUNDER_NIC_VF y
'';
uboot = null;
kernelTarget = "Image";
gcc = {
arch = "armv8-a";
};
};
selectPlatformBySystem = system: {
"i686-linux" = pc32;
"x86_64-linux" = pc64;
"armv5tel-linux" = sheevaplug;
"armv6l-linux" = raspberrypi;
"armv7l-linux" = armv7l-hf-multiplatform;
"aarch64-linux" = aarch64-multiplatform;
"mips64el-linux" = fuloong2f_n32;
}.${system} or pcBase;
} }