marusich pushed a commit to branch wip-ppc64le
in repository guix.

commit 01ce33d9f37fcdd54d34fa340d31954e9d05e807
Author: Chris Marusich <[email protected]>
AuthorDate: Sun Feb 21 16:05:58 2021 -0800

    syscalls: Fix RNDADDTOENTCNT on powerpc64le-linux.
    
    This fixes the failing test add-to-entropy-count in tests/syscalls.scm on
    powerpc64le-linux.
    
    * guix/build/syscalls.scm (RNDADDTOENTCNT): When %host-type starts with
    "powerpc64le", set this to #x80045201.  Otherwise, set it to #x40045201 as
    before.
---
 guix/build/syscalls.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 74d7a33..f39730f 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2019 Guillaume Le Vaillant <[email protected]>
 ;;; Copyright © 2020 Julien Lepiller <[email protected]>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <[email protected]>
+;;; Copyright © 2021 Chris Marusich <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -876,7 +877,11 @@ backend device."
 ;;;
 
 ;; From <uapi/linux/random.h>.
-(define RNDADDTOENTCNT #x40045201)
+(define RNDADDTOENTCNT
+  ;; Avoid using %current-system here to avoid depending on host-side code.
+  (if (string-prefix? "powerpc64le" %host-type)
+      #x80045201
+      #x40045201))
 
 (define (add-to-entropy-count port-or-fd n)
   "Add N to the kernel's entropy count (the value that can be read from

Reply via email to