xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Xen EFI build system and gcov
Date: Mon, 29 Aug 2016 19:41:32 +0100	[thread overview]
Message-ID: <20160829184132.GD8502@citrix.com> (raw)

Hi Jan

Today I had some free cycles so I spent some time looking at gcov
support in the hypervisor and tried to write a patch to fix the
currently broken gcov build. But my patch alone is not enough to fix
that.

There seems to be a problem with the EFI Makefile. With my patch
applied, efi/boot.init.o still gets all gcov options _and_
-DINIT_SECTIONS_ONLY. See output and patch for more context.

If I force efi to be disabled by putting in a hack into efi/Makefile,
Xen builds fine. It suggests for all other files my patch works.

I am confused why efi/boot.init.o gets both set of options and I'm not
sure what is the best approach to fix it.

Do you have any suggestion on fixing that?

Thanks
Wei.

gcc ... -fprofile-arcs -ftest-coverage -DTEST_COVERAGE -DINIT_SECTIONS_ONLY -c boot.c -o boot.o
objdump -h boot.o | sed -n '/[0-9]/{s,00*,0,g;p;}' | while read idx name sz rest; do \
	case "$name" in \
	.*.local) ;; \
	.text|.text.*|.data|.data.*|.bss) \
		test $sz != 0 || continue; \
		echo "Error: size of boot.o:$name is 0x$sz" >&2; \
		exit $(expr $idx + 1);; \
	esac; \
done
Error: size of boot.o:.text is 0x012
/local/work/xen.git/xen/Rules.mk:184: recipe for target 'boot.init.o' failed

---8<---
From 36c9fe8274187c6f8a4caa6f6b9c354ca9db2866 Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@citrix.com>
Date: Mon, 29 Aug 2016 19:11:59 +0100
Subject: [PATCH] xen: fix gcov compilation

Currently enabling gcov in hypervisor won't build because although
26c9d03d ("gcov: Adding support for coverage information") claimed that
%.init.o files were excluded from applying compilation options, it was
in fact not true.

Fix that by filtering out the options correctly.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/Rules.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index a190ff0..e49566c 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -115,7 +115,9 @@ subdir-all := $(subdir-y) $(subdir-n)
 
 $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY
 
-$(obj-$(coverage)): CFLAGS += -fprofile-arcs -ftest-coverage -DTEST_COVERAGE
+ifeq ($(coverage),y)
+$(filter-out %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage -DTEST_COVERAGE
+endif
 
 ifeq ($(lto),y)
 # Would like to handle all object files as bitcode, but objects made from
-- 
2.1.4


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

             reply	other threads:[~2016-08-29 18:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 18:41 Wei Liu [this message]
2016-08-30  8:38 ` Xen EFI build system and gcov Jan Beulich
2016-08-30  8:56   ` 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=20160829184132.GD8502@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xenproject.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 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).