diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2018-05-16 15:05:49 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2018-05-17 20:37:27 +0300 |
commit | 162825f9653f1ba050e40f0ca96d1eb3491a9207 (patch) | |
tree | 6ce31d553d562e0eacf32edeed68e6354f9279e7 /nix/libstore | |
parent | 17aca5c4d273c1f514f8623e555660b99ed90fee (diff) | |
download | guix-162825f9653f1ba050e40f0ca96d1eb3491a9207.tar.gz guix-162825f9653f1ba050e40f0ca96d1eb3491a9207.zip |
daemon: Allow building for armhf-linux on aarch64-linux.
* nix/libstore/build.cc (canBuildLocally): Allow building armhf-linux
builds on aarch64-linux.
(DerivationGoal::runChild) Throw error if attempting to build for
armhf-linux on an unsupported platform.
* doc/guix.texi (Invoking guix build): Document how to build natively
for armhf-linux on aarch64-linux. Add note that on some aarch64
machines this is unsupported.
Diffstat (limited to 'nix/libstore')
-rw-r--r-- | nix/libstore/build.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 34647e6774..c7f32494d0 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1244,6 +1244,7 @@ static bool canBuildLocally(const string & platform) return platform == settings.thisSystem #if __linux__ || (platform == "i686-linux" && settings.thisSystem == "x86_64-linux") + || (platform == "armhf-linux" && settings.thisSystem == "aarch64-linux") #endif ; } @@ -2220,6 +2221,13 @@ void DerivationGoal::runChild() throw SysError("cannot set i686-linux personality"); } + if (drv.platform == "armhf-linux" && + (settings.thisSystem == "aarch64-linux" || + (!strcmp(utsbuf.sysname, "Linux") && !strcmp(utsbuf.machine, "aarch64")))) { + if (personality(PER_LINUX32) == -1) + throw SysError("cannot set armhf-linux personality"); + } + /* Impersonate a Linux 2.6 machine to get some determinism in builds that depend on the kernel version. */ if ((drv.platform == "i686-linux" || drv.platform == "x86_64-linux") && settings.impersonateLinux26) { |