* [Qemu-devel] [PATCH] build: allow turning off debuginfo
@ 2012-02-08 12:54 Gerd Hoffmann
2012-02-24 10:39 ` Gerd Hoffmann
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2012-02-08 12:54 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
This patch adds --{enable,disable}-debug-info switches to configure
which allows to include/exclude the '-g' switch on the gcc & ld
command lines. Not building debug info reduces ressource usage
(especially disk) alot and is quite useful for test builds.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 763db24..8e46600 100755
--- a/configure
+++ b/configure
@@ -98,6 +98,7 @@ audio_pt_int=""
audio_win_int=""
cc_i386=i386-pc-linux-gnu-gcc
libs_qga=""
+debug_info="yes"
target_list=""
@@ -207,6 +208,10 @@ for opt do
;;
--extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
;;
+ --enable-debug-info) debug_info="yes"
+ ;;
+ --disable-debug-info) debug_info="no"
+ ;;
--sparc_cpu=*)
sparc_cpu="$optarg"
case $sparc_cpu in
@@ -244,13 +249,15 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
# default flags for all hosts
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
-CFLAGS="-g $CFLAGS"
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
-LDFLAGS="-g $LDFLAGS"
+if test "$debug_info" = "yes"; then
+ CFLAGS="-g $CFLAGS"
+ LDFLAGS="-g $LDFLAGS"
+fi
# make source path absolute
source_path=`cd "$source_path"; pwd`
@@ -545,6 +552,10 @@ for opt do
;;
--extra-ldflags=*)
;;
+ --enable-debug-info)
+ ;;
+ --disable-debug-info)
+ ;;
--cpu=*)
;;
--target-list=*) target_list="$optarg"
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] build: allow turning off debuginfo
2012-02-08 12:54 [Qemu-devel] [PATCH] build: allow turning off debuginfo Gerd Hoffmann
@ 2012-02-24 10:39 ` Gerd Hoffmann
2012-02-24 11:16 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2012-02-24 10:39 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 02/08/12 13:54, Gerd Hoffmann wrote:
> This patch adds --{enable,disable}-debug-info switches to configure
> which allows to include/exclude the '-g' switch on the gcc & ld
> command lines. Not building debug info reduces ressource usage
> (especially disk) alot and is quite useful for test builds.
ping?
cheers,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] build: allow turning off debuginfo
2012-02-24 10:39 ` Gerd Hoffmann
@ 2012-02-24 11:16 ` Peter Maydell
2012-02-24 17:52 ` Gerd Hoffmann
2012-02-24 19:46 ` Anthony Liguori
0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2012-02-24 11:16 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 24 February 2012 10:39, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On 02/08/12 13:54, Gerd Hoffmann wrote:
>> This patch adds --{enable,disable}-debug-info switches to configure
>> which allows to include/exclude the '-g' switch on the gcc & ld
>> command lines. Not building debug info reduces ressource usage
>> (especially disk) alot and is quite useful for test builds.
>
> ping?
We've had this suggested before, haven't we? I quite like the
existing "just build with -g and strip it later" approach...
is the resource usage change really that significant?
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] build: allow turning off debuginfo
2012-02-24 11:16 ` Peter Maydell
@ 2012-02-24 17:52 ` Gerd Hoffmann
2012-02-24 19:46 ` Anthony Liguori
1 sibling, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2012-02-24 17:52 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel
On 02/24/12 12:16, Peter Maydell wrote:
> On 24 February 2012 10:39, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> On 02/08/12 13:54, Gerd Hoffmann wrote:
>>> This patch adds --{enable,disable}-debug-info switches to configure
>>> which allows to include/exclude the '-g' switch on the gcc & ld
>>> command lines. Not building debug info reduces ressource usage
>>> (especially disk) alot and is quite useful for test builds.
>>
>> ping?
>
> We've had this suggested before, haven't we? I quite like the
> existing "just build with -g and strip it later" approach...
> is the resource usage change really that significant?
Disk usage is factor ten:
[kraxel@mort qemu]$ du -sh build-*
1,7G build-debug
173M build-nodebug
Build time is factor two:
[build-debug]
7263.45user 805.85system 3:11:03elapsed 70%CPU (0avgtext+0avgdata
1782576maxresident)k
72784880inputs+13340840outputs (1273066major+29668783minor)pagefaults 0swaps
[build-nodebug]
5329.72user 320.46system 1:34:26elapsed 99%CPU (0avgtext+0avgdata
1542848maxresident)k
116000inputs+755248outputs (255major+16535699minor)pagefaults 0swaps
cheers,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] build: allow turning off debuginfo
2012-02-24 11:16 ` Peter Maydell
2012-02-24 17:52 ` Gerd Hoffmann
@ 2012-02-24 19:46 ` Anthony Liguori
1 sibling, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2012-02-24 19:46 UTC (permalink / raw)
To: Peter Maydell; +Cc: Gerd Hoffmann, qemu-devel
On 02/24/2012 05:16 AM, Peter Maydell wrote:
> On 24 February 2012 10:39, Gerd Hoffmann<kraxel@redhat.com> wrote:
>> On 02/08/12 13:54, Gerd Hoffmann wrote:
>>> This patch adds --{enable,disable}-debug-info switches to configure
>>> which allows to include/exclude the '-g' switch on the gcc& ld
>>> command lines. Not building debug info reduces ressource usage
>>> (especially disk) alot and is quite useful for test builds.
>>
>> ping?
>
> We've had this suggested before, haven't we? I quite like the
> existing "just build with -g and strip it later" approach...
> is the resource usage change really that significant?
I applied this because I see almost no harm at all in supporting this and even
if the resource usage change is small, the benefit compared to the cost of
maintaining this seems like a reasonable trade off.
Regards,
Anthony Liguori
>
> -- PMM
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-24 19:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08 12:54 [Qemu-devel] [PATCH] build: allow turning off debuginfo Gerd Hoffmann
2012-02-24 10:39 ` Gerd Hoffmann
2012-02-24 11:16 ` Peter Maydell
2012-02-24 17:52 ` Gerd Hoffmann
2012-02-24 19:46 ` Anthony Liguori
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).