summaryrefslogtreecommitdiff
path: root/tests/gremlin.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2025-10-30 16:19:50 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2025-10-30 16:19:50 +0900
commit0f39db9c1942969bcbc603b306d8e47f8feb8566 (patch)
tree4c277554d2167559e9325afc191c53e262733918 /tests/gremlin.scm
parent9d60fdf6a2e482e7d52184521191c14449619aec (diff)
Revert "Use mmap for the elf parser, reducing memory usage."
This reverts commit 2c1fe0df11ae0f66392b8abb6f62430d79305538.
Diffstat (limited to 'tests/gremlin.scm')
-rw-r--r--tests/gremlin.scm18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/gremlin.scm b/tests/gremlin.scm
index 44237e2ad37..280b1d88192 100644
--- a/tests/gremlin.scm
+++ b/tests/gremlin.scm
@@ -23,7 +23,6 @@
23 #:use-module (guix tests) 23 #:use-module (guix tests)
24 #:use-module ((guix utils) #:select (call-with-temporary-directory 24 #:use-module ((guix utils) #:select (call-with-temporary-directory
25 target-aarch64?)) 25 target-aarch64?))
26 #:use-module (guix build io)
27 #:use-module (guix build utils) 26 #:use-module (guix build utils)
28 #:use-module (guix build gremlin) 27 #:use-module (guix build gremlin)
29 #:use-module (gnu packages bootstrap) 28 #:use-module (gnu packages bootstrap)
@@ -45,6 +44,9 @@
45 (_ 44 (_
46 #f))) 45 #f)))
47 46
47(define read-elf
48 (compose parse-elf get-bytevector-all))
49
48(define c-compiler 50(define c-compiler
49 (or (which "gcc") (which "cc") (which "g++"))) 51 (or (which "gcc") (which "cc") (which "g++")))
50 52
@@ -53,7 +55,8 @@
53 55
54(unless %guile-executable (test-skip 1)) 56(unless %guile-executable (test-skip 1))
55(test-assert "elf-dynamic-info-needed, executable" 57(test-assert "elf-dynamic-info-needed, executable"
56 (let ((dyninfo (file-dynamic-info %guile-executable))) 58 (let* ((elf (call-with-input-file %guile-executable read-elf))
59 (dyninfo (elf-dynamic-info elf)))
57 (or (not dyninfo) ;static executable 60 (or (not dyninfo) ;static executable
58 (lset<= string=? 61 (lset<= string=?
59 (list (string-append "libguile-" (effective-version)) 62 (list (string-append "libguile-" (effective-version))
@@ -137,7 +140,9 @@
137 (display "int main () { puts(\"hello\"); }" port))) 140 (display "int main () { puts(\"hello\"); }" port)))
138 (invoke c-compiler "t.c" 141 (invoke c-compiler "t.c"
139 "-Wl,--enable-new-dtags" "-Wl,-rpath=/foo" "-Wl,-rpath=/bar") 142 "-Wl,--enable-new-dtags" "-Wl,-rpath=/foo" "-Wl,-rpath=/bar")
140 (let* ((dyninfo (file-dynamic-info "a.out")) 143 (let* ((dyninfo (elf-dynamic-info
144 (parse-elf (call-with-input-file "a.out"
145 get-bytevector-all))))
141 (old (elf-dynamic-info-runpath dyninfo)) 146 (old (elf-dynamic-info-runpath dyninfo))
142 (new (strip-runpath "a.out")) 147 (new (strip-runpath "a.out"))
143 (new* (strip-runpath "a.out"))) 148 (new* (strip-runpath "a.out")))
@@ -191,7 +196,10 @@
191 (display "// empty file" port))) 196 (display "// empty file" port)))
192 (invoke c-compiler "t.c" 197 (invoke c-compiler "t.c"
193 "-shared" "-Wl,-soname,libfoo.so.2") 198 "-shared" "-Wl,-soname,libfoo.so.2")
194 (let ((dyninfo (file-dynamic-info "a.out"))) 199 (let* ((dyninfo (elf-dynamic-info
195 (elf-dynamic-info-soname dyninfo)))))) 200 (parse-elf (call-with-input-file "a.out"
201 get-bytevector-all))))
202 (soname (elf-dynamic-info-soname dyninfo)))
203 soname)))))
196 204
197(test-end "gremlin") 205(test-end "gremlin")