qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
@ 2014-09-25  8:06 Olaf Hering
  2014-09-25 10:36 ` Peter Maydell
  2014-09-25 10:49 ` Stefan Hajnoczi
  0 siblings, 2 replies; 9+ messages in thread
From: Olaf Hering @ 2014-09-25  8:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Olaf Hering, Stefan Weil, Michael Tokarev,
	Stefan Hajnoczi, Paolo Bonzini

During code review for xen I noticed that --enable-debug-info would
still strip the binaries because strip_opt= defaults to yes.
If --enable-debug-info is passed to configure it has to be assumed
that not only the compiled binaries have debugsymbols, also the
installed binaries should keep the symbols. The requirement to pass
also --disable-strip looks odd.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Stefan Weil <sw@weilnetz.de>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 862f6d2..1fd5c6b 100755
--- a/configure
+++ b/configure
@@ -357,6 +357,7 @@ for opt do
                      EXTRA_LDFLAGS="$optarg"
   ;;
   --enable-debug-info) debug_info="yes"
+                       strip_opt="no"
   ;;
   --disable-debug-info) debug_info="no"
   ;;

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25  8:06 [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info Olaf Hering
@ 2014-09-25 10:36 ` Peter Maydell
  2014-09-25 10:47   ` Olaf Hering
  2014-09-25 10:49 ` Stefan Hajnoczi
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2014-09-25 10:36 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Paolo Bonzini, Michael Tokarev, QEMU Developers, Stefan Hajnoczi,
	Stefan Weil

On 25 September 2014 09:06, Olaf Hering <olaf@aepfle.de> wrote:
> During code review for xen I noticed that --enable-debug-info would
> still strip the binaries because strip_opt= defaults to yes.
> If --enable-debug-info is passed to configure it has to be assumed
> that not only the compiled binaries have debugsymbols, also the
> installed binaries should keep the symbols. The requirement to pass
> also --disable-strip looks odd.

I think defaulting to build with debug but strip on install
makes sense. It follows for example how Debian recommend
building things:
 https://www.debian.org/doc/debian-policy/ch-files.html
and means that your installed binaries don't have the
extraneous debug info but you can keep the build tree
to make sense of backtraces etc later.

I also prefer configure's options to be orthogonal:
--enable-debug-info should only change how we deal
with debug info, and not also have an effect on whether
we strip it on install. (Plus your patch as it stands
means that the behaviour you get by default now differs
from the behaviour if you explicitly say
--enable-debug-info.)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25 10:36 ` Peter Maydell
@ 2014-09-25 10:47   ` Olaf Hering
  2014-09-25 10:51     ` Peter Maydell
  0 siblings, 1 reply; 9+ messages in thread
From: Olaf Hering @ 2014-09-25 10:47 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Paolo Bonzini, Michael Tokarev, QEMU Developers, Stefan Hajnoczi,
	Stefan Weil

On Thu, Sep 25, Peter Maydell wrote:

> On 25 September 2014 09:06, Olaf Hering <olaf@aepfle.de> wrote:
> > During code review for xen I noticed that --enable-debug-info would
> > still strip the binaries because strip_opt= defaults to yes.
> > If --enable-debug-info is passed to configure it has to be assumed
> > that not only the compiled binaries have debugsymbols, also the
> > installed binaries should keep the symbols. The requirement to pass
> > also --disable-strip looks odd.
> 
> I think defaulting to build with debug but strip on install
> makes sense. It follows for example how Debian recommend
> building things:
>  https://www.debian.org/doc/debian-policy/ch-files.html
> and means that your installed binaries don't have the
> extraneous debug info but you can keep the build tree
> to make sense of backtraces etc later.

make install DESTIDIR=$RPM_BUILD_ROOT will also remove debug symbols,
even if the rpmbuild helper scripts would be able to extract them into a
separate -debuginfo package.

So will --disable-strip remain for ever? Can I depend on that?

Olaf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25  8:06 [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info Olaf Hering
  2014-09-25 10:36 ` Peter Maydell
@ 2014-09-25 10:49 ` Stefan Hajnoczi
  2014-09-25 10:55   ` Olaf Hering
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2014-09-25 10:49 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Peter Maydell, Stefan Weil, Michael Tokarev, qemu-devel,
	Cole Robinson, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

On Thu, Sep 25, 2014 at 10:06:35AM +0200, Olaf Hering wrote:
> During code review for xen I noticed that --enable-debug-info would
> still strip the binaries because strip_opt= defaults to yes.
> If --enable-debug-info is passed to configure it has to be assumed
> that not only the compiled binaries have debugsymbols, also the
> installed binaries should keep the symbols. The requirement to pass
> also --disable-strip looks odd.

Perhaps package maintainers rely on installed binaries not having debug
symbols?

It's common to split the debug symbols into separate ELF files that are
shipped in a different package (qemu-debuginfo or similar).

If you make this change and packagers are unaware, they could
accidentally ship qemu packages that contain the full debug symbols in
the binaries.

That said, I don't really know...  The package maintainers can give you
a definitive answer whether or not this is a good thing to do.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25 10:47   ` Olaf Hering
@ 2014-09-25 10:51     ` Peter Maydell
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2014-09-25 10:51 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Paolo Bonzini, Michael Tokarev, QEMU Developers, Stefan Hajnoczi,
	Stefan Weil

On 25 September 2014 11:47, Olaf Hering <olaf@aepfle.de> wrote:
> On Thu, Sep 25, Peter Maydell wrote:
> So will --disable-strip remain for ever? Can I depend on that?

We're not planning to remove it, certainly. We don't
make strong guarantees about configure commandlines
remaining stable across QEMU versions but we aren't going
to gratuitously break them either. (If you're a distro
packager it's probably good practice to scan the configure
help output for new option flags you might want to explicitly
enable/disable for new versions anyway, though.)

-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25 10:49 ` Stefan Hajnoczi
@ 2014-09-25 10:55   ` Olaf Hering
  2014-09-25 11:05   ` Michael Tokarev
  2014-09-25 13:51   ` Paolo Bonzini
  2 siblings, 0 replies; 9+ messages in thread
From: Olaf Hering @ 2014-09-25 10:55 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Peter Maydell, Stefan Weil, Michael Tokarev, qemu-devel,
	Cole Robinson, Paolo Bonzini

On Thu, Sep 25, Stefan Hajnoczi wrote:

> If you make this change and packagers are unaware, they could
> accidentally ship qemu packages that contain the full debug symbols in
> the binaries.

rpm will take care of that all by itself.

Olaf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25 10:49 ` Stefan Hajnoczi
  2014-09-25 10:55   ` Olaf Hering
@ 2014-09-25 11:05   ` Michael Tokarev
  2014-09-25 13:51   ` Paolo Bonzini
  2 siblings, 0 replies; 9+ messages in thread
From: Michael Tokarev @ 2014-09-25 11:05 UTC (permalink / raw)
  To: Stefan Hajnoczi, Olaf Hering
  Cc: Paolo Bonzini, Stefan Weil, Cole Robinson, qemu-devel,
	Peter Maydell

25.09.2014 14:49, Stefan Hajnoczi wrote:
[]
> Perhaps package maintainers rely on installed binaries not having debug
> symbols?

Package maintainer can and _should_ watch for changes in new releases
and update their packages to accomodate changes made upstream.

> It's common to split the debug symbols into separate ELF files that are
> shipped in a different package (qemu-debuginfo or similar).

We was thinking about shipping these in debian (currently we don't
build with debug info enabled), but it turned out to be rather problematic
due to amount of binaries and size of the symbols.  I still consider
enabling debug info for at least x86 system targets (as most widely
used).  Either way, in debian we strip executables outside of upstream
build system usually.

> If you make this change and packagers are unaware, they could
> accidentally ship qemu packages that contain the full debug symbols in
> the binaries.

And it will be their problem entirely, especially if they wont notice
the size difference :)  No, really, this is not something an upstream
should think too much about.

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25 10:49 ` Stefan Hajnoczi
  2014-09-25 10:55   ` Olaf Hering
  2014-09-25 11:05   ` Michael Tokarev
@ 2014-09-25 13:51   ` Paolo Bonzini
  2014-10-02 15:39     ` Stefan Hajnoczi
  2 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2014-09-25 13:51 UTC (permalink / raw)
  To: Stefan Hajnoczi, Olaf Hering
  Cc: Peter Maydell, Cole Robinson, Michael Tokarev, qemu-devel,
	Stefan Weil

Il 25/09/2014 12:49, Stefan Hajnoczi ha scritto:
> On Thu, Sep 25, 2014 at 10:06:35AM +0200, Olaf Hering wrote:
>> During code review for xen I noticed that --enable-debug-info
>> would still strip the binaries because strip_opt= defaults to
>> yes. If --enable-debug-info is passed to configure it has to be
>> assumed that not only the compiled binaries have debugsymbols,
>> also the installed binaries should keep the symbols. The
>> requirement to pass also --disable-strip looks odd.
> 
> Perhaps package maintainers rely on installed binaries not having
> debug symbols?

If so, that should be taken care of by the distribution.

Of course, a distribution is free to separate the debug info and ship
it as a separate package; in that case, it makes sense to distribute
stripped binaries.

But I think discarding symbols on "make install" is in general a bad
idea, especially for long-lived processes such as QEMU where you often
have non-reproducible bugs.   If symbols are gone, even the simplest
bug becomes basically impossible to diagnose from a core dump.

The GNU Makefile standards have "make install" and "make
install-strip" targets.  It would be nice to add "make install-strip"
and at the same time flip the default from --enable-strip to
--disable-strip.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info
  2014-09-25 13:51   ` Paolo Bonzini
@ 2014-10-02 15:39     ` Stefan Hajnoczi
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2014-10-02 15:39 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Peter Maydell, Olaf Hering, Stefan Weil, Michael Tokarev,
	qemu-devel, Stefan Hajnoczi, Cole Robinson

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

On Thu, Sep 25, 2014 at 03:51:44PM +0200, Paolo Bonzini wrote:
> The GNU Makefile standards have "make install" and "make
> install-strip" targets.  It would be nice to add "make install-strip"
> and at the same time flip the default from --enable-strip to
> --disable-strip.

Makes sense.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-02 15:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-25  8:06 [Qemu-devel] [PATCH] build: preserve debug symbols with --enable-debug-info Olaf Hering
2014-09-25 10:36 ` Peter Maydell
2014-09-25 10:47   ` Olaf Hering
2014-09-25 10:51     ` Peter Maydell
2014-09-25 10:49 ` Stefan Hajnoczi
2014-09-25 10:55   ` Olaf Hering
2014-09-25 11:05   ` Michael Tokarev
2014-09-25 13:51   ` Paolo Bonzini
2014-10-02 15:39     ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).