diff mbox series

[bug#47182,15/18] syscalls: Fix RNDADDTOENTCNT on powerpc64le-linux.

Message ID 20210316064511.2891553-15-cmmarusich@gmail.com
State Accepted
Headers show
Series Add support for powerpc64le-linux (wip-ppc64le-for-master) | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Christopher Marusich March 16, 2021, 6:45 a.m. UTC
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 mbox series

Patch

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index a2c1d80fb1a..8886fc0fb94 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -6,6 +6,7 @@ 
 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -942,7 +943,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