All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Doug Goldstein <cardoe@cardoe.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v3] tools: detect appropriate debug optimization level
Date: Thu, 28 Apr 2016 18:40:49 +0100	[thread overview]
Message-ID: <20160428174049.GG18194@citrix.com> (raw)
In-Reply-To: <1461681525-12078-1-git-send-email-cardoe@cardoe.com>

On Tue, Apr 26, 2016 at 09:38:45AM -0500, Doug Goldstein wrote:
> When building debug use -Og as the optimization level if its available,
> otherwise retain the use of -O0. -Og has been added by GCC to enable all
> optimizations that to not affect debugging while retaining full
> debugability.
> 
> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
> ---
> change since v2:
> - switch back to cc-option-add to not call cc-option on every invocation
> change since v1:
> - switch to cc-option to only specify -O0 if -Og isn't supported
> ---
>  tools/Rules.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/Rules.mk b/tools/Rules.mk
> index 9ef0b47..1b79a6e 100644
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -138,6 +138,7 @@ SHLIB_libxenvchan  = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
>  ifeq ($(debug),y)
>  # Disable optimizations and enable debugging information for macros
>  CFLAGS += -O0 -g3
> +$(call cc-option-add,CFLAGS,CC,-Og)
>  # But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=<n>.
>  PY_CFLAGS += $(PY_NOOPT_CFLAGS)
>  endif
> -- 
> 2.7.3

Heh, this patch seems to has a (good) side effect. I will look into
fixing that tomorrow.

make[10]: Entering directory '/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/tcgbios'
gcc   -O1 -fno-omit-frame-pointer -m32 -march=i686 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs   -O0 -g3 -Og -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MF .tcgbios.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -mno-tls-direct-seg-refs  -Werror -fno-stack-protector -fno-exceptions -fno-builtin -msoft-float -I/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/tcgbios/../../../../../tools/include -I.. -I../..  -c -o tcgbios.o tcgbios.c 
gcc   -O1 -fno-omit-frame-pointer -m32 -march=i686 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs   -O0 -g3 -Og -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MF .tpm_drivers.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -mno-tls-direct-seg-refs  -Werror -fno-stack-protector -fno-exceptions -fno-builtin -msoft-float -I/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/tcgbios/../../../../../tools/include -I.. -I../..  -c -o tpm_drivers.o tpm_drivers.c 
tcgbios.c: In function ‘tcpa_extend_acpi_log’:
tcgbios.c:362:3: error: ‘size’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   memcpy((char *)lasa_last, (char *)entry_ptr, size);
   ^
tcgbios.c: In function ‘HashLogEvent32’:
tcgbios.c:1142:22: error: ‘entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    hleo->eventnumber = entry;
                      ^
tcgbios.c:1131:10: error: ‘logdataptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    entry = tcpa_extend_acpi_log(logdataptr);
          ^
cc1: all warnings being treated as errors
/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/tcgbios/../../../../../tools/Rules.mk:192: recipe for target 'tcgbios.o' failed
make[10]: *** [tcgbios.o] Error 1
make[10]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/tcgbios'
/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/../../../../tools/Rules.mk:216: recipe for target 'subdir-all-tcgbios' failed
make[9]: *** [subdir-all-tcgbios] Error 2
make[9]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit'
/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit/../../../../tools/Rules.mk:211: recipe for target 'subdirs-all' failed
make[8]: *** [subdirs-all] Error 2
make[8]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware/rombios/32bit'
/local/work/COMMITTER/xen.git/tools/firmware/rombios/../../../tools/Rules.mk:216: recipe for target 'subdir-all-32bit' failed
make[7]: *** [subdir-all-32bit] Error 2
make[7]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware/rombios'
/local/work/COMMITTER/xen.git/tools/firmware/rombios/../../../tools/Rules.mk:211: recipe for target 'subdirs-all' failed
make[6]: *** [subdirs-all] Error 2
make[6]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware/rombios'
/local/work/COMMITTER/xen.git/tools/firmware/../../tools/Rules.mk:216: recipe for target 'subdir-all-rombios' failed
make[5]: *** [subdir-all-rombios] Error 2
make[5]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware'
/local/work/COMMITTER/xen.git/tools/firmware/../../tools/Rules.mk:211: recipe for target 'subdirs-all' failed
make[4]: *** [subdirs-all] Error 2
make[4]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware'
Makefile:33: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/local/work/COMMITTER/xen.git/tools/firmware'
/local/work/COMMITTER/xen.git/tools/../tools/Rules.mk:216: recipe for target 'subdir-install-firmware' failed
make[2]: *** [subdir-install-firmware] Error 2
make[2]: Leaving directory '/local/work/COMMITTER/xen.git/tools'
/local/work/COMMITTER/xen.git/tools/../tools/Rules.mk:211: recipe for target 'subdirs-install' failed
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory '/local/work/COMMITTER/xen.git/tools'
Makefile:101: recipe for target 'install-tools' failed
make: *** [install-tools] Error 2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-04-28 17:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 14:38 [PATCH v3] tools: detect appropriate debug optimization level Doug Goldstein
2016-04-28 10:57 ` Wei Liu
2016-04-28 17:19 ` Ian Jackson
2016-04-28 17:22   ` Wei Liu
2016-04-28 17:40 ` Wei Liu [this message]
2018-02-24  5:26   ` Doug Goldstein
2018-03-02 12:46     ` Wei Liu
2018-03-11  5:08       ` Doug Goldstein
2018-03-12 16:16         ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160428174049.GG18194@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.