guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.


From: guix-commits
Subject: 02/02: syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.
Date: Mon, 7 Nov 2022 16:29:46 -0500 (EST)

civodul pushed a commit to branch core-updates
in repository guix.

commit 3f6c32a88fc7a4d707ae1ed8ef3f7bd995461aff
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Nov 7 22:26:54 2022 +0100

    syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.
    
    This is a re-implementation of 3c8b6fd94ceb1e898216929e8768fb518dbf1de9
    done in a way that works for both glibc >= 2.34 and earlier versions.
    
    * guix/build/syscalls.scm (syscall->procedure): When LIBRARY is true,
    fall back to global symbols if (dynamic-link library) fails.
---
 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 7842b0a9fc..e081aaca44 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -445,9 +445,14 @@ If an error occurs while creating the binding, defer the 
error report until
 the returned procedure is called."
   (catch #t
     (lambda ()
+      ;; Note: When #:library is set, try it first and fall back to libc
+      ;; proper.  This is because libraries like libutil.so have been subsumed
+      ;; by libc.so with glibc >= 2.34.
       (let ((ptr (dynamic-func name
                                (if library
-                                   (dynamic-link library)
+                                   (or (false-if-exception
+                                        (dynamic-link library))
+                                       (dynamic-link))
                                    (dynamic-link)))))
         ;; The #:return-errno? facility was introduced in Guile 2.0.12.
         (pointer->procedure return-type ptr argument-types



reply via email to

[Prev in Thread] Current Thread [Next in Thread]