Merge pull request #146961 from alyssais/qemu-debug
qemu: enable debug info
This commit is contained in:
commit
8f3eb58a96
2 changed files with 13 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
{ lib, stdenv, fetchurl, fetchpatch, python, zlib, pkg-config, glib
|
{ lib, stdenv, fetchurl, fetchpatch, python, zlib, pkg-config, glib
|
||||||
, perl, pixman, vde2, alsa-lib, texinfo, flex
|
, perl, pixman, vde2, alsa-lib, texinfo, flex
|
||||||
, bison, lzo, snappy, libaio, libtasn1, gnutls, nettle, curl, ninja, meson, sigtool
|
, bison, lzo, snappy, libaio, libtasn1, gnutls, nettle, curl, ninja, meson, sigtool
|
||||||
, makeWrapper, autoPatchelfHook
|
, makeWrapper
|
||||||
, attr, libcap, libcap_ng
|
, attr, libcap, libcap_ng
|
||||||
, CoreServices, Cocoa, Hypervisor, rez, setfile
|
, CoreServices, Cocoa, Hypervisor, rez, setfile
|
||||||
, numaSupport ? stdenv.isLinux && !stdenv.isAarch32, numactl
|
, numaSupport ? stdenv.isLinux && !stdenv.isAarch32, numactl
|
||||||
|
@ -53,7 +53,6 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper python python.pkgs.sphinx python.pkgs.sphinx_rtd_theme pkg-config flex bison meson ninja ]
|
nativeBuildInputs = [ makeWrapper python python.pkgs.sphinx python.pkgs.sphinx_rtd_theme pkg-config flex bison meson ninja ]
|
||||||
++ lib.optionals gtkSupport [ wrapGAppsHook ]
|
++ lib.optionals gtkSupport [ wrapGAppsHook ]
|
||||||
++ lib.optionals stdenv.isLinux [ autoPatchelfHook ]
|
|
||||||
++ lib.optionals stdenv.isDarwin [ sigtool ];
|
++ lib.optionals stdenv.isDarwin [ sigtool ];
|
||||||
|
|
||||||
buildInputs = [ zlib glib perl pixman
|
buildInputs = [ zlib glib perl pixman
|
||||||
|
@ -85,6 +84,7 @@ stdenv.mkDerivation rec {
|
||||||
dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build
|
dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build
|
||||||
|
|
||||||
outputs = [ "out" "ga" ];
|
outputs = [ "out" "ga" ];
|
||||||
|
separateDebugInfo = true;
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
./fix-qemu-ga.patch
|
./fix-qemu-ga.patch
|
||||||
|
@ -174,6 +174,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--audio-drv-list=${audio}"
|
"--audio-drv-list=${audio}"
|
||||||
|
"--disable-strip" # We'll strip ourselves after separating debug info.
|
||||||
"--enable-docs"
|
"--enable-docs"
|
||||||
"--enable-tools"
|
"--enable-tools"
|
||||||
"--enable-guest-agent"
|
"--enable-guest-agent"
|
||||||
|
|
|
@ -28,10 +28,16 @@ _separateDebugInfo() {
|
||||||
# Extract the debug info.
|
# Extract the debug info.
|
||||||
header "separating debug info from $i (build ID $id)"
|
header "separating debug info from $i (build ID $id)"
|
||||||
mkdir -p "$dst/${id:0:2}"
|
mkdir -p "$dst/${id:0:2}"
|
||||||
|
|
||||||
|
# This may fail, e.g. if the binary is for a different
|
||||||
|
# architecture than we're building for. (This happens with
|
||||||
|
# firmware blobs in QEMU.)
|
||||||
|
(
|
||||||
$OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
|
$OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
|
||||||
$STRIP --strip-debug "$i"
|
$STRIP --strip-debug "$i"
|
||||||
|
|
||||||
# Also a create a symlink <original-name>.debug.
|
# Also a create a symlink <original-name>.debug.
|
||||||
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
|
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
|
||||||
|
) || rmdir -p "$dst/${id:0:2}"
|
||||||
done < <(find "$prefix" -type f -print0)
|
done < <(find "$prefix" -type f -print0)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue