All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Robert Schwebel <r.schwebel@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH][SOLO] add sparse support
Date: Thu, 03 Apr 2008 11:37:31 +0200	[thread overview]
Message-ID: <47F4A55B.4060605@domain.hid> (raw)
In-Reply-To: <20080401103647.GR13814@domain.hid>

Robert Schwebel wrote:
> This patch adds static analysis support with sparse to the xenomai-solo
> makefiles. To enable sparse checking, use
> 
> 	./configure --with-sparse[=PATH]
> 
> and run 'make sparse' afterwards. I don't have a good idea right now how
> to avoid this extra step; it would be much nicer if every call to
> $(COMPILE) could be substituted by a sparse call plus the original one,
> but I didn't find a good method for that yet that also works with the
> libtool calls.
>

I have merged this patch series, adapting the Makefiles so that we don't need
any support from configure.in to run sparse.

Normally, you should be able to run "make [SPARSE=/path/to/sparse] sparse" to
start the analysis. Default path is "sparse".

Additionally, this now works with out of tree builds and supports mixed 32/64bit
environments.

Thanks,

> Signed-off-by: Robert Schwebel <r.schwebel@domain.hid>
> 
> ---
>  Makefile.am         |   18 +++++++++++++++++-
>  base/Makefile.am    |    6 ++++++
>  configure.in        |   32 ++++++++++++++++++++++++++++++++
>  psos/Makefile.am    |    6 ++++++
>  vxworks/Makefile.am |    5 +++++
>  5 files changed, 66 insertions(+), 1 deletion(-)
> 
> Index: xenomai-solo/base/Makefile.am
> ===================================================================
> --- xenomai-solo.orig/base/Makefile.am	2008-03-30 21:29:12.000000000 +0200
> +++ xenomai-solo/base/Makefile.am	2008-03-30 21:29:46.000000000 +0200
> @@ -36,3 +36,9 @@
>  	-DTLSF_USE_LOCKS=1 -DUSE_MMAP=1 -DUSE_SBRK=1
>  
>  EXTRA_DIST = tlsf/README
> +
> +sparse:
> +	@for i in $(libxenomai_la_SOURCES) $(libtlsf_la_SOURCES); do \
> +		$(SPARSE) $(CHECKFLAGS) $$i; \
> +	done
> +
> Index: xenomai-solo/configure.in
> ===================================================================
> --- xenomai-solo.orig/configure.in	2008-03-30 21:29:12.000000000 +0200
> +++ xenomai-solo/configure.in	2008-03-30 21:29:14.000000000 +0200
> @@ -70,6 +70,38 @@
>  	esac])
>  AC_MSG_RESULT(${debug_symbols:-no})
>  
> +dnl Sparse check (default: off)
> +
> +sparse=
> +AC_MSG_CHECKING(whether to enable sparse)
> +AC_ARG_WITH(sparse,
> +    AC_HELP_STRING([--with-sparse@<:@=PATH@:>@], [activate static code analysis with sparse]),
> +    [case "$withval" in
> +    y | yes) sparse=sparse ;;
> +    n | no)  sparse= ;;
> +    *) sparse=$withval
> +    esac],
> +    [sparse=],[]
> +)
> +if test -n "$sparse" ; then
> +    AC_MSG_RESULT(yes)
> +    AC_SUBST(SPARSE, $sparse)
> +    AC_MSG_CHECKING(whether sparse=$sparse is executable)
> +    if test "`$sparse 2>&1 > /dev/null; echo $?`" = "0"; then
> +        AC_MSG_RESULT(yes)
> +        AC_SUBST(SPARSE, $sparse)
> +    else
> +        AC_MSG_RESULT(no)
> +        AC_MSG_ERROR($sparse is not executable)
> +    fi
> +else
> +    AC_MSG_RESULT(no)
> +    AC_SUBST(SPARSE, true)
> +fi
> +
> +checkflags="-nostdinc -isystem \$(SYSROOT)/usr/include -isystem `$CC -print-file-name=include` -Wbitwise -Wno-transparent-union -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_REENTRANT \$(DEFS) \$(DEFAULT_INCLUDES) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS)"
> +AC_SUBST(CHECKFLAGS, $checkflags)
> +
>  dnl Enable assertions (default: off)
>  
>  AC_MSG_CHECKING(whether assertions should be enabled)
> Index: xenomai-solo/Makefile.am
> ===================================================================
> --- xenomai-solo.orig/Makefile.am	2008-03-30 21:29:12.000000000 +0200
> +++ xenomai-solo/Makefile.am	2008-03-30 21:29:14.000000000 +0200
> @@ -1,6 +1,15 @@
>  ACLOCAL_AMFLAGS=-I config
>  
> -SUBDIRS = base vxworks psos include config scripts
> +SRC_SUBDIRS= \
> +	base \
> +	vxworks \
> +	psos
> +
> +SUBDIRS = \
> +	$(SRC_SUBDIRS) \
> +	include \
> +	config \
> +	scripts
>  
>  EXTRA_DIST =
>  
> @@ -11,3 +20,10 @@
>  
>  install-user:
>  	$(MAKE) install
> +
> +sparse:
> +	@for i in $(SRC_SUBDIRS); do \
> +		echo; \
> +		make -C $$i sparse; \
> +	done
> +
> Index: xenomai-solo/psos/Makefile.am
> ===================================================================
> --- xenomai-solo.orig/psos/Makefile.am	2008-03-30 21:29:12.000000000 +0200
> +++ xenomai-solo/psos/Makefile.am	2008-03-30 21:29:14.000000000 +0200
> @@ -22,3 +22,9 @@
>  	-I$(top_srcdir)/include
>  
>  EXTRA_DIST =
> +
> +sparse:
> +	@for i in $(libpsos_la_SOURCES); do \
> +		$(SPARSE) $(CHECKFLAGS) $$i; \
> +	done
> +
> Index: xenomai-solo/vxworks/Makefile.am
> ===================================================================
> --- xenomai-solo.orig/vxworks/Makefile.am	2008-03-30 21:29:53.000000000 +0200
> +++ xenomai-solo/vxworks/Makefile.am	2008-03-30 21:30:10.000000000 +0200
> @@ -24,3 +24,8 @@
>  	-I$(top_srcdir)/include
>  
>  EXTRA_DIST = testsuite
> +
> +sparse:
> +	@for i in $(libvxworks_la_SOURCES); do \
> +		$(SPARSE) $(CHECKFLAGS) $$i; \
> +	done
> 


-- 
Philippe.


  parent reply	other threads:[~2008-04-03  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 10:36 [Xenomai-core] [PATCH][SOLO] add sparse support Robert Schwebel
2008-04-01 10:43 ` [Xenomai-core] [PATCH][SOLO] sparse fix: use NULL instead of 0 Robert Schwebel
2008-04-01 10:44 ` [Xenomai-core] [PATCH][SOLO] sparse: clockobj_unmap not declared Robert Schwebel
2008-04-01 10:44 ` [Xenomai-core] [PATCH][SOLO] sparse: threadobj_global_rr " Robert Schwebel
2008-04-01 10:45 ` [Xenomai-core] [PATCH][SOLO] sparse: include panic header file Robert Schwebel
2008-04-01 10:46 ` [Xenomai-core] [PATCH][SOLO] sparse: include sysClkRateGet declaration Robert Schwebel
2008-04-01 14:38 ` [Xenomai-core] [PATCH][SOLO] add sparse support Uwe Kleine-König
2008-04-03  9:37 ` Philippe Gerum [this message]
2008-04-04 12:22   ` Robert Schwebel

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=47F4A55B.4060605@domain.hid \
    --to=rpm@xenomai.org \
    --cc=r.schwebel@domain.hid \
    --cc=xenomai@xenomai.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.