From 19c1ac8d88b0925863623530ee65ac40861c2d8d Mon Sep 17 00:00:00 2001
From: Ludovic Courtès <ludo@gnu.org>
Date: Wed, 8 Mar 2017 14:45:55 +0100
Subject: build: Unset 'NIX_BUILD_HOOK' when offloading support is missing.

* build-aux/pre-inst-env.in: Export 'NIX_BUILD_HOOK' only when
nix/scripts/offload is executable; unset it otherwise.
---
 build-aux/pre-inst-env.in | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

(limited to 'build-aux')

diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in
index fe56da6944..dca2699687 100644
--- a/build-aux/pre-inst-env.in
+++ b/build-aux/pre-inst-env.in
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
 #
 # This file is part of GNU Guix.
 #
@@ -45,11 +45,18 @@ export PATH
 
 NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
 NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute"
-NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
 NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'
 
-export NIX_ROOT_FINDER NIX_SUBSTITUTERS	\
-    NIX_BUILD_HOOK NIX_LIBEXEC_DIR
+export NIX_ROOT_FINDER NIX_SUBSTITUTERS NIX_LIBEXEC_DIR
+
+NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
+if [ -x "$NIX_BUILD_HOOK" ]
+then
+    export NIX_BUILD_HOOK
+else
+    # No offloading support.
+    unset NIX_BUILD_HOOK
+fi
 
 # The 'guix-register' program.
 GUIX_REGISTER="$abs_top_builddir/guix-register"
-- 
cgit v1.2.3


From 9ec2a4d3fec44f08a55df9f5f3d1a04b83e7fcf6 Mon Sep 17 00:00:00 2001
From: Ludovic Courtès <ludo@gnu.org>
Date: Thu, 9 Mar 2017 16:26:14 +0100
Subject: hydra: Really disable 32-to-64-bit cross-builds.

Fixes <http://bugs.gnu.org/26022>.
Reported by Efraim Flashner <efraim@flashner.co.il>.

* build-aux/hydra/gnu-system.scm (hydra-jobs)[cross-jobs](from-32-to-64?):
Check whether TARGET contains "64" rather than checking whether TARGET
ends in "64", which is rarely the case.
(same?): Add special case for armhf-linux.
---
 build-aux/hydra/gnu-system.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'build-aux')

diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm
index a9df44a64d..04a9d0508a 100644
--- a/build-aux/hydra/gnu-system.scm
+++ b/build-aux/hydra/gnu-system.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -257,14 +257,17 @@ valid."
       ;; prevents known-to-fail cross-builds from i686-linux or armhf-linux to
       ;; mips64el-linux-gnuabi64.
       (and (or (string-prefix? "i686-" system)
+               (string-prefix? "i586-" system)
                (string-prefix? "armhf-" system))
-           (string-suffix? "64" target)))
+           (string-contains target "64")))    ;x86_64, mips64el, aarch64, etc.
 
     (define (same? target)
       ;; Return true if SYSTEM and TARGET are the same thing.  This is so we
       ;; don't try to cross-compile to 'mips64el-linux-gnu' from
       ;; 'mips64el-linux'.
-      (string-contains target system))
+      (or (string-contains target system)
+          (and (string-prefix? "armhf" system)    ;armhf-linux
+               (string-prefix? "arm" target))))   ;arm-linux-gnueabihf
 
     (define (pointless? target)
       ;; Return #t if it makes no sense to cross-build to TARGET from SYSTEM.
-- 
cgit v1.2.3