summaryrefslogtreecommitdiff
path: root/gnu/packages/debug.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/debug.scm')
-rw-r--r--gnu/packages/debug.scm152
1 files changed, 0 insertions, 152 deletions
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 773da375596..9ccbf9bb9a3 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -303,158 +303,6 @@ and uses the same efficient LLVM-based C/C++ @code{clang_delta} reduction
303tool.") 303tool.")
304 (license license:ncsa))) 304 (license license:ncsa)))
305 305
306(define-public qemu-for-american-fuzzy-lop
307 ;; afl only supports using a single afl-qemu-trace executable, so
308 ;; we only build qemu for the native target.
309 (let ((machine (match (or (%current-target-system)
310 (%current-system))
311 ("x86_64-linux" "x86_64")
312 ("i686-linux" "i386")
313 ("aarch64-linux" "aarch64")
314 ("armhf-linux" "arm")
315 ("mips64el-linux" "mips64el")
316 ("powerpc-linux" "ppc")
317 ;; Prevent errors when querying this package on unsupported
318 ;; platforms, e.g. when running "guix package --search="
319 (_ "UNSUPPORTED"))))
320 (hidden-package
321 (package
322 (name "qemu")
323 (version "2.10.2")
324 (source (origin
325 (method url-fetch)
326 (uri (string-append "https://download.qemu.org/qemu-"
327 version ".tar.xz"))
328 (sha256
329 (base32
330 "17w21spvaxaidi2am5lpsln8yjpyp2zi3s3gc6nsxj5arlgamzgw"))
331 (patches
332 (search-patches "qemu-glibc-2.27.patch"
333 "qemu-glibc-2.30.patch"))))
334 (build-system gnu-build-system)
335 (arguments
336 `(;; Running tests in parallel can occasionally lead to failures, like:
337 ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
338 #:parallel-tests? #f
339 #:configure-flags
340 (list (string-append "--target-list=" ,machine "-linux-user"))
341 #:make-flags '("V=1")
342 #:phases
343 (modify-phases %standard-phases
344 (replace 'configure
345 (lambda* (#:key inputs outputs (configure-flags '())
346 #:allow-other-keys)
347 ;; The `configure' script doesn't understand some of the
348 ;; GNU options. Thus, add a new phase that's compatible.
349 (let ((out (assoc-ref outputs "out")))
350 (setenv "SHELL" (which "bash"))
351
352 ;; While we're at it, patch for tests.
353 (substitute* "tests/libqtest.c"
354 (("/bin/sh") (which "sh")))
355
356 ;; The binaries need to be linked against -lrt.
357 (setenv "LDFLAGS" "-lrt")
358 (apply invoke
359 `("./configure"
360 ,(string-append "--cc=" (which "gcc"))
361 ;; Some architectures insist on using HOST_CC
362 ,(string-append "--host-cc=" (which "gcc"))
363 "--disable-debug-info" ; save build space
364 "--enable-virtfs" ; just to be sure
365 ,(string-append "--prefix=" out)
366 ,(string-append "--sysconfdir=/etc")
367 ,@configure-flags)))))
368 (add-after
369 'unpack 'apply-afl-patches
370 (lambda* (#:key inputs #:allow-other-keys)
371 (let* ((afl-src (assoc-ref inputs "afl-source"))
372 (patch-dir "qemu_mode/patches"))
373 (copy-recursively (string-append afl-src "/"
374 patch-dir)
375 patch-dir)
376 (install-file
377 (string-append patch-dir
378 "/afl-qemu-cpu-inl.h")
379 ".")
380 (copy-file (string-append afl-src "/config.h")
381 "./afl-config.h")
382 (install-file (string-append afl-src "/types.h")
383 ".")
384 (substitute* "afl-qemu-cpu-inl.h"
385 (("\\.\\./\\.\\./config.h") "afl-config.h"))
386 (substitute* (string-append patch-dir
387 "/cpu-exec.diff")
388 (("\\.\\./patches/") ""))
389
390 ;; These were already applied to qemu-minimal-2.10.
391 (for-each (lambda (obsolete-patch)
392 (delete-file (string-append
393 patch-dir "/"
394 obsolete-patch)))
395 (list "configure.diff"
396 "memfd.diff"))
397
398 (for-each (lambda (patch-file)
399 (invoke "patch" "--force" "-p1"
400 "--input" patch-file))
401 (find-files patch-dir
402 "\\.diff$"))
403 #t)))
404 (add-before 'check 'disable-unusable-tests
405 (lambda* (#:key inputs outputs #:allow-other-keys)
406 (substitute* "tests/Makefile.include"
407 ;; Comment out the test-qga test, which needs /sys and
408 ;; fails within the build environment.
409 (("check-unit-.* tests/test-qga" all)
410 (string-append "# " all)))
411 (substitute* "tests/Makefile.include"
412 ;; Comment out the test-char test, which needs networking and
413 ;; fails within the build environment.
414 (("check-unit-.* tests/test-char" all)
415 (string-append "# " all)))
416 #t)))))
417 (native-inputs
418 `(("python-2" ,python-2) ; QEMU 2 needs Python 2
419 ("glib:bin" ,glib "bin")
420 ("perl" ,perl)
421 ("flex" ,flex)
422 ("bison" ,bison)
423 ("pkg-config" ,pkg-config)))
424 (inputs
425 `(("afl-source" ,(package-source american-fuzzy-lop))
426 ("alsa-lib" ,alsa-lib)
427 ("attr" ,attr)
428 ("glib" ,glib)
429 ("libaio" ,libaio)
430 ("libattr" ,attr)
431 ("libcap" ,libcap)
432 ("libjpeg" ,libjpeg-turbo)
433 ("libpng" ,libpng)
434 ("ncurses" ,ncurses)
435 ("pixman" ,pixman)
436 ("util-linux" ,util-linux)
437 ("zlib" ,zlib)))
438 (home-page "https://www.qemu.org")
439 (synopsis "Machine emulator and virtualizer (without GUI) for american fuzzy lop")
440 (description
441 "QEMU is a generic machine emulator and virtualizer. This package
442of QEMU is used only by the american fuzzy lop package.
443
444When used as a machine emulator, QEMU can run OSes and programs made for one
445machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
446using dynamic translation, it achieves very good performance.
447
448When used as a virtualizer, QEMU achieves near native performances by
449executing the guest code directly on the host CPU. QEMU supports
450virtualization when executing under the Xen hypervisor or using
451the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
452server and embedded PowerPC, and S390 guests.")
453 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
454 (license license:gpl2)
455 ;; Several tests fail on MIPS.
456 (supported-systems (delete "mips64el-linux" %supported-systems))))))
457
458(define-public qemu-for-aflplusplus 306(define-public qemu-for-aflplusplus
459 (let ((base qemu-minimal) 307 (let ((base qemu-minimal)
460 (commit "60ebd5624c60589e276cf287516b925a9ee35b87") 308 (commit "60ebd5624c60589e276cf287516b925a9ee35b87")