On Wed, Sep 7, 2011 at 10:54 AM, Juan Quintela <quint...@redhat.com> wrote: > Brad <b...@comstyle.com> wrote: >> ----- Original message ----- >>> On 09/06/11 10:02, Brad wrote: >>> > Only build with -g CFLAGS/LDFLAGS if using --enable-debug. >>> > Add --optflags to allow overriding the default optimization >>> > level added to CFLAGS. >>> > >>> > This is a first draft of coming up with a patch I could potentially >>> > push upstream based on much cruder local patches to do something >>> > similar. I'm trying to eliminate having to patch the configure >>> > script. >>> >>> You don't have to. You can just run 'make CFLAGS="$optflags"' to >>> override the defaults. Nevertheless having optflags would be nice as >>> you don't have to type this for each make run then. >> >> I do when its unconditionally on the commandline either way. If the >> configure scipt didnt put it their if CFLAGS wasnt empty it wouldnt be an >> issue. > > $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) > $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") > > this is the rule called in rules.make. QEMU don't use CFLAGS > internally^W^W^W^W, it is only used for -g -O2, so it should be enough > to use make CFLAGS="" or something like that. > >> >>> I don't think we should mess with the -g flag. It should stay enabled >>> by default, so you can easily get a useful stacktrace out of a core >>> without having to rebuild with debug info first. >> >> I dont care what the default is as long as I can disable it without patching. > > What is the reason for that? I guess that compilation speed/memory, but > just to be sure.
Also disk space. Speed/memory effect seems to be about 3%. Generating sparc64-softmmu/translate.o with -g, time -v output: User time (seconds): 33.00 System time (seconds): 0.95 Percent of CPU this job got: 99% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:34.01 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 1636016 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 0 Minor (reclaiming a frame) page faults: 240264 Voluntary context switches: 7 Involuntary context switches: 3201 Swaps: 0 File system inputs: 0 File system outputs: 17488 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 $ ls -sh translate.o 2.5M translate.o Without: User time (seconds): 31.55 System time (seconds): 1.10 Percent of CPU this job got: 99% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:32.73 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 1619056 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 0 Minor (reclaiming a frame) page faults: 220316 Voluntary context switches: 7 Involuntary context switches: 3335 Swaps: 0 File system inputs: 0 File system outputs: 4040 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 $ ls -sh translate.o 768K translate.o