diff options
| author | Maxim Cournoyer <maxim@guixotic.coop> | 2025-10-24 16:06:12 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2025-10-30 16:13:03 +0900 |
| commit | 2c1fe0df11ae0f66392b8abb6f62430d79305538 (patch) | |
| tree | 44117a2d06d583f7378ddec5d475baeceddc7564 /gnu/packages/librewolf.scm | |
| parent | e1994a021437b3fd73089c08d7e8db876fad698d (diff) | |
Use mmap for the elf parser, reducing memory usage.
The `file->bytevector' new procedure uses a memory mapped bytevector, so
parsing the ELF file reads only the sections needed, not the whole file.
* guix/scripts/pack.scm (wrapped-package): Use file->bytevector.
* guix/build/gremlin.scm (file-dynamic-info): Likewise.
(validate-needed-in-runpath): Likewise.
(strip-runpath): Likewise, and write to bytevector directly, avoiding a port.
(set-file-runpath): Likewise.
* tests/gremlin.scm (read-elf): Delete procedure.
("elf-dynamic-info-needed, executable"): Use file-dynamic-info.
("strip-runpath"): Likewise.
("elf-dynamic-info-soname"): Likewise.
guix/build/debug-link.scm (set-debuglink-crc): Use file->bytevector.
* tests/debug-link.scm (read-elf): Delete procedure.
("elf-debuglink"): Rename to...
("elf-debuglink, no .gnu_debuglink section"): ... this.
("elf-debuglink", "set-debuglink-crc"): Use external store, and adjust to use
file->bytevector.
* gnu/packages/gnuzilla.scm (icecat-minimal) [#:phases]
{build-sandbox-whitelist}: Use `file-runpath'.
* gnu/packages/librewolf.scm (librewolf): Likewise.
Fixes: <https://issues.guix.gnu.org/59365>
Fixes: #1262
Change-Id: I43b77ed0cdc38994ea89d3d401e0d136aa6b187a
Diffstat (limited to 'gnu/packages/librewolf.scm')
| -rw-r--r-- | gnu/packages/librewolf.scm | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gnu/packages/librewolf.scm b/gnu/packages/librewolf.scm index f8800b19252..6c852d7f1c2 100644 --- a/gnu/packages/librewolf.scm +++ b/gnu/packages/librewolf.scm @@ -530,15 +530,11 @@ ;; The following two functions are from Guix's icecat package in ;; (gnu packages gnuzilla). See commit ;; b7a0935420ee630a29b7e5ac73a32ba1eb24f00b. - (define (runpath-of lib) - (call-with-input-file lib - (compose elf-dynamic-info-runpath elf-dynamic-info - parse-elf get-bytevector-all))) (define (runpaths-of-input label) (let* ((dir (string-append (assoc-ref inputs label) "/lib")) (libs (find-files dir "\\.so$"))) - (append-map runpath-of libs))) + (append-map file-runpath libs))) (let* ((out (assoc-ref outputs "out")) (lib (string-append out "/lib")) (libs (map |
