diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2025-11-24 14:03:28 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-11-24 14:03:28 +0900 |
| commit | 70f4ed216df846ffb8538ea62083fdbc641baf22 (patch) | |
| tree | 5e46521459e469e43fb5ef1aa142c1d421e9a272 | |
| parent | 1b4878380f448176250123f453631680892c24c0 (diff) | |
| download | loftix-70f4ed216df846ffb8538ea62083fdbc641baf22.tar.gz | |
Update AFL++
| -rw-r--r-- | loftix/emulation.scm | 52 | ||||
| -rw-r--r-- | loftix/fuzzing.scm | 29 |
2 files changed, 10 insertions, 71 deletions
diff --git a/loftix/emulation.scm b/loftix/emulation.scm index df369a2..4956680 100644 --- a/loftix/emulation.scm +++ b/loftix/emulation.scm @@ -8,6 +8,7 @@ (define-module (loftix emulation) #:use-module (gnu packages) #:use-module (gnu packages commencement) + #:use-module (gnu packages debug) #:use-module (gnu packages virtualization) #:use-module (guix download) #:use-module (guix gexp) @@ -16,8 +17,8 @@ #:use-module (guix utils)) (define-public qemu-for-afl++ - (let ((base qemu-minimal) - (commit "2f316cc9b82cb347d4fbe1c6558518d504861172") + (let ((base qemu-for-aflplusplus) + (commit "60ebd5624c60589e276cf287516b925a9ee35b87") (revision "0")) (hidden-package (package @@ -32,51 +33,8 @@ (recursive? #t))) (file-name (git-file-name name version)) (sha256 - (base32 "1w5nn24hs7dnrq03ljdlqcbvl5z0xz1nspnjvj19lj6av540q54n")))) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:configure-flags _ #~'()) - #~(list (string-append - "--target-list=" - ;; AFL++ only supports using a single afl-qemu-trace, - ;; so we only build qemu for the native target. - (match #$(let-system system system) - ("aarch64-linux" "aarch64-linux-user") - ("armhf-linux" "arm-linux-user") - ("i686-linux" "i386-linux-user") - ("mips64el-linux" "mips64el-linux-user") - ("powerpc-linux" "ppc-linux-user") - ("riscv64-linux" "riscv64-linux-user") - ("x86_64-linux" "x86_64-linux-user"))))) - ((#:phases phases) - #~(modify-phases #$phases - (delete 'replace-firmwares) - (delete 'patch-embedded-shebangs) - (delete 'fix-optionrom-makefile) - (delete 'disable-unusable-tests) - (replace 'configure - (lambda* (#:key configure-flags #:allow-other-keys) - ;; The `configure' script doesn't understand some of the - ;; GNU options. Thus, add a new phase that's compatible. - (setenv "SHELL" (which "bash")) - ;; The binaries need to be linked against -lrt. - (setenv "LDFLAGS" "-lrt") - (apply invoke - "./configure" - (string-append "--cc=" #$(cc-for-target)) - ;; Some architectures insist on using HOST_CC - (string-append "--host-cc=" #$(cc-for-target)) - "--disable-debug-info" ; save build space - (string-append "--prefix=" #$output) - (string-append "--sysconfdir=/etc") - configure-flags))) - (add-after 'install 'install-qasan-header - (lambda _ - (install-file "qemuafl/qasan.h" - (string-append #$output "/include")))) - (delete 'delete-firmwares))))) - (home-page "https://github.com/AFLplusplus/qemuafl") - (synopsis "QEMU for AFL++"))))) + (base32 + "1vz7k1ssfnlimkpc01fqin27r2k4a23cwpxj2bbmsp7d3175bjbz")))))))) (define-public qemu-for-fuzzolic (let ((base qemu-minimal) diff --git a/loftix/fuzzing.scm b/loftix/fuzzing.scm index d66905d..ccbe247 100644 --- a/loftix/fuzzing.scm +++ b/loftix/fuzzing.scm @@ -26,15 +26,15 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (loftix deduction) - #:use-module (loftix emulation) - #:export (for-evocatio)) + #:use-module (loftix emulation)) (define-public afl++ - (let ((commit "93a6e1dbd19da92702dd7393d1cd1b405a6c29ee")) + (let ((commit "c8f0533581d7badb4903ba11d6259fd1a2b1da3b") + (revision "0")) (package (inherit aflplusplus) (name "afl++") - (version (git-version "4.35a" "0" commit)) + (version (git-version "4.35a" revision commit)) (source (origin (method git-fetch) @@ -43,26 +43,7 @@ (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "16b516f9xwxv61wzwbgw4wazx3jnhai3zlb0wpw3q0gdxcb7y61q")))) - (arguments - (substitute-keyword-arguments (package-arguments aflplusplus) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'build 'build-qasan - (lambda* (#:key parallel-build? make-flags #:allow-other-keys) - (apply invoke "make" "-C" "qemu_mode/libqasan" - "-j" (number->string (if parallel-build? - (parallel-job-count) - "1")) - make-flags))) - ;; afl-qemu-trace is a symbolic link to QEMU's binary. - ;; Substituting its source code with AFL++'s output path - ;; would result in a dependency cycle. - (add-after 'install-qemu 'wrap-qemu - (lambda _ - (wrap-program (string-append #$output "/bin/afl-qemu-trace") - `("AFL_PATH" = - (,(string-append #$output "/lib/afl")))))))))) + (base32 "13iyd3zn013n1dgfaawyqjbv6sln2ds4jwkd6xjy74qyd047r5xm")))) (inputs (modify-inputs (package-inputs aflplusplus) (replace "qemu" qemu-for-afl++)))))) |
