From 96929c818b1e99acc03415dfd5590b315c900295 Mon Sep 17 00:00:00 2001 From: Samuel Pocino <43758828+spocino@users.noreply.github.com> Date: Sat, 29 Jun 2024 19:36:54 -0400 Subject: [PATCH] Support for non-glibc versions of linux (musl, android) --- src/Compiler/Scheme/Chez.idr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Scheme/Chez.idr b/src/Compiler/Scheme/Chez.idr index 22418c87d4..727c7961d4 100644 --- a/src/Compiler/Scheme/Chez.idr +++ b/src/Compiler/Scheme/Chez.idr @@ -94,7 +94,13 @@ schHeader chez libs whole (import (chezscheme)) (case (machine-type) [(i3fb ti3fb a6fb ta6fb) #f] - [(i3le ti3le a6le ta6le tarm64le) (load-shared-object "libc.so.6")] + [(i3le ti3le a6le ta6le tarm64le) + (let ((os-str + (let-values (((in out err pid) (open-process-ports "uname -o" 'block (make-transcoder (utf-8-codec))))) + (get-string-all out)))) + (if (string=? os-str "GNU/Linux\n") + (load-shared-object "libc.so.6") + (load-shared-object "libc.so")))] [(i3osx ti3osx a6osx ta6osx tarm64osx tppc32osx tppc64osx) (load-shared-object "libc.dylib")] [(i3nt ti3nt a6nt ta6nt) (load-shared-object "msvcrt.dll")] [else (load-shared-object "libc.so")])