diff options
| author | Maxim Cournoyer <maxim@guixotic.coop> | 2025-10-30 16:19:50 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2025-10-30 16:19:50 +0900 |
| commit | 0f39db9c1942969bcbc603b306d8e47f8feb8566 (patch) | |
| tree | 4c277554d2167559e9325afc191c53e262733918 /tests/gremlin.scm | |
| parent | 9d60fdf6a2e482e7d52184521191c14449619aec (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.scm | 18 |
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 @@ #:use-module (guix tests) #:use-module ((guix utils) #:select (call-with-temporary-directory target-aarch64?)) - #:use-module (guix build io) #:use-module (guix build utils) #:use-module (guix build gremlin) #:use-module (gnu packages bootstrap) @@ -45,6 +44,9 @@ (_ #f))) +(define read-elf + (compose parse-elf get-bytevector-all)) + (define c-compiler (or (which "gcc") (which "cc") (which "g++"))) @@ -53,7 +55,8 @@ (unless %guile-executable (test-skip 1)) (test-assert "elf-dynamic-info-needed, executable" - (let ((dyninfo (file-dynamic-info %guile-executable))) + (let* ((elf (call-with-input-file %guile-executable read-elf)) + (dyninfo (elf-dynamic-info elf))) (or (not dyninfo) ;static executable (lset<= string=? (list (string-append "libguile-" (effective-version)) @@ -137,7 +140,9 @@ (display "int main () { puts(\"hello\"); }" port))) (invoke c-compiler "t.c" "-Wl,--enable-new-dtags" "-Wl,-rpath=/foo" "-Wl,-rpath=/bar") - (let* ((dyninfo (file-dynamic-info "a.out")) + (let* ((dyninfo (elf-dynamic-info + (parse-elf (call-with-input-file "a.out" + get-bytevector-all)))) (old (elf-dynamic-info-runpath dyninfo)) (new (strip-runpath "a.out")) (new* (strip-runpath "a.out"))) @@ -191,7 +196,10 @@ (display "// empty file" port))) (invoke c-compiler "t.c" "-shared" "-Wl,-soname,libfoo.so.2") - (let ((dyninfo (file-dynamic-info "a.out"))) - (elf-dynamic-info-soname dyninfo)))))) + (let* ((dyninfo (elf-dynamic-info + (parse-elf (call-with-input-file "a.out" + get-bytevector-all)))) + (soname (elf-dynamic-info-soname dyninfo))) + soname))))) (test-end "gremlin") |
