diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-02-27 12:42:22 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-02-27 12:42:22 +0100 |
commit | 8779987bba029535d3dc00f1aacf59281fdd34f0 (patch) | |
tree | 7a6d616d45367d508f94c3593b1ce5c7053c33f5 /nix | |
parent | 1885bb0c08e943a2e0e37c5c0a83473c8af904d0 (diff) | |
parent | a6d9f8837b118e2126e4b8a19bf48b524229a15c (diff) | |
download | patches-8779987bba029535d3dc00f1aacf59281fdd34f0.tar patches-8779987bba029535d3dc00f1aacf59281fdd34f0.tar.gz |
Merge branch 'master' into python-tests
Diffstat (limited to 'nix')
-rw-r--r-- | nix/libstore/build.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index cebc404d1c..9b7bb5391c 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -26,6 +26,7 @@ #include <errno.h> #include <stdio.h> #include <cstring> +#include <stdint.h> #include <pwd.h> #include <grp.h> @@ -2008,7 +2009,11 @@ void DerivationGoal::startBuilder() char stack[32 * 1024]; int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS | SIGCHLD; if (!fixedOutput) flags |= CLONE_NEWNET; - pid = clone(childEntry, stack + sizeof(stack) - 8, flags, this); + + /* Ensure proper alignment on the stack. On aarch64, it has to be 16 + bytes. */ + pid = clone(childEntry, (char *)(((uintptr_t)stack + 16) & ~0xf), + flags, this); if (pid == -1) throw SysError("cloning builder process"); } else |