syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.
This is a re-implementation of 3c8b6fd94c
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.
			
			
This commit is contained in:
		
							parent
							
								
									c9984bfc50
								
							
						
					
					
						commit
						3f6c32a88f
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -445,9 +445,14 @@ If an error occurs while creating the binding, defer the error report until
 | 
				
			||||||
the returned procedure is called."
 | 
					the returned procedure is called."
 | 
				
			||||||
  (catch #t
 | 
					  (catch #t
 | 
				
			||||||
    (lambda ()
 | 
					    (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
 | 
					      (let ((ptr (dynamic-func name
 | 
				
			||||||
                               (if library
 | 
					                               (if library
 | 
				
			||||||
                                   (dynamic-link library)
 | 
					                                   (or (false-if-exception
 | 
				
			||||||
 | 
					                                        (dynamic-link library))
 | 
				
			||||||
 | 
					                                       (dynamic-link))
 | 
				
			||||||
                                   (dynamic-link)))))
 | 
					                                   (dynamic-link)))))
 | 
				
			||||||
        ;; The #:return-errno? facility was introduced in Guile 2.0.12.
 | 
					        ;; The #:return-errno? facility was introduced in Guile 2.0.12.
 | 
				
			||||||
        (pointer->procedure return-type ptr argument-types
 | 
					        (pointer->procedure return-type ptr argument-types
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue