me
/
guix
Archived
1
0
Fork 0

gnu: american-fuzzy-lop: Update to 2.56b.

* gnu/packages/debug.scm (american-fuzzy-lop): Update to 2.56b.
[source]: Use GIT-FETCH from the new upstream, and GIT-FILE-NAME.
[inputs]: Adjust custom-qemu's ‘apply-afl-patches’ phase to this new
reality.  Don't apply upstreamed Qemu patches.
[arguments]: Make the git check-out writable.
Tobias Geerinckx-Rice 2020-03-17 23:02:56 +01:00
parent 317b13f30e
commit 3ba980b188
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 32 additions and 18 deletions

View File

@ -171,15 +171,16 @@ tools that process C/C++ code.")
(_ "UNSUPPORTED")))) (_ "UNSUPPORTED"))))
(package (package
(name "american-fuzzy-lop") (name "american-fuzzy-lop")
(version "2.52b") ;It seems all releases have the 'b' suffix (version "2.56b") ;It seems all releases have the 'b' suffix
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (string-append "http://lcamtuf.coredump.cx/afl/releases/" (uri (git-reference
"afl-" version ".tgz")) (url "https://github.com/google/AFL")
(commit (string-append "v" version))))
(sha256 (sha256
(base32 (base32 "1q1g59gkm48aa4cg9h70jx4i2gapmypgp5rzs156b2avd95vwkn1"))
"0ig0ij4n1pwry5dw1hk4q88801jzzy2cric6y2gd6560j55lnqa3")))) (file-name (git-file-name name version))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs (inputs
`(("custom-qemu" `(("custom-qemu"
@ -204,24 +205,33 @@ tools that process C/C++ code.")
(add-after (add-after
'unpack 'apply-afl-patches 'unpack 'apply-afl-patches
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((afl-dir (string-append "afl-" ,version)) (let* ((afl-src (assoc-ref inputs "afl-src"))
(patch-dir (patch-dir "qemu_mode/patches"))
(string-append afl-dir (copy-recursively (string-append afl-src "/"
"/qemu_mode/patches"))) patch-dir)
(invoke "tar" "xf" patch-dir)
(assoc-ref inputs "afl-src")) (install-file
(install-file (string-append patch-dir (string-append patch-dir
"/afl-qemu-cpu-inl.h") "/afl-qemu-cpu-inl.h")
".") ".")
(copy-file (string-append afl-dir "/config.h") (copy-file (string-append afl-src "/config.h")
"./afl-config.h") "./afl-config.h")
(install-file (string-append afl-dir "/types.h") (install-file (string-append afl-src "/types.h")
".") ".")
(substitute* "afl-qemu-cpu-inl.h" (substitute* "afl-qemu-cpu-inl.h"
(("\\.\\./\\.\\./config.h") "afl-config.h")) (("\\.\\./\\.\\./config.h") "afl-config.h"))
(substitute* (string-append patch-dir (substitute* (string-append patch-dir
"/cpu-exec.diff") "/cpu-exec.diff")
(("\\.\\./patches/") "")) (("\\.\\./patches/") ""))
;; These were already applied to qemu-minimal-2.10.
(for-each (lambda (obsolete-patch)
(delete-file (string-append
patch-dir "/"
obsolete-patch)))
(list "configure.diff"
"memfd.diff"))
(for-each (lambda (patch-file) (for-each (lambda (patch-file)
(invoke "patch" "--force" "-p1" (invoke "patch" "--force" "-p1"
"--input" patch-file)) "--input" patch-file))
@ -234,6 +244,10 @@ tools that process C/C++ code.")
,name "-" ,version) ,name "-" ,version)
"CC=gcc") "CC=gcc")
#:phases (modify-phases %standard-phases #:phases (modify-phases %standard-phases
(add-after 'unpack 'make-git-checkout-writable
(lambda _
(for-each make-file-writable (find-files "."))
#t))
(delete 'configure) (delete 'configure)
,@(if (string=? (%current-system) (or "x86_64-linux" ,@(if (string=? (%current-system) (or "x86_64-linux"
"i686-linux")) "i686-linux"))
@ -258,7 +272,7 @@ tools that process C/C++ code.")
(symlink (string-append qemu "/bin/qemu-" ,machine) (symlink (string-append qemu "/bin/qemu-" ,machine)
(string-append out "/bin/afl-qemu-trace")) (string-append out "/bin/afl-qemu-trace"))
#t))) #t)))
(delete 'check)))) ; Tests are run during 'install phase. (delete 'check)))) ; tests are run during 'install phase
(home-page "http://lcamtuf.coredump.cx/afl") (home-page "http://lcamtuf.coredump.cx/afl")
(synopsis "Security-oriented fuzzer") (synopsis "Security-oriented fuzzer")
(description (description