On Wed, Jan 24, 2018 at 10:01:22AM +0000, Roger Pau Monne wrote:
> So it can be used by both gcc and clang. Just add the Kconfig option
> and modify the makefiles so the llvm coverage specific code can be
> added in a follow up patch.
> 
> Signed-off-by: Roger Pau Monné <roger....@citrix.com>
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index 3cf40754a6..0bc40fd0e6 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -115,8 +115,13 @@ subdir-all := $(subdir-y) $(subdir-n)
>  
>  $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += 
> -DINIT_SECTIONS_ONLY
>  
> -ifeq ($(CONFIG_GCOV),y)
> -$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS 
> += -fprofile-arcs -ftest-coverage
> +ifeq ($(CONFIG_COVERAGE),y)
> +ifeq ($(clang),y)
> +    COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
> +else
> +    COV_FLAGS := -fprofile-arcs -ftest-coverage
> +endif
> +    $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): 
> CFLAGS += $(COV_FLAGS)

Please also change nogcov to nocov. Also remove the leading spaces from
this line.

Other than this, this patch looks good.

Wei.

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

Reply via email to