Re: sparse test failures on ppc32le (and other not so common archs)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 30/08/17 17:14, Uwe Kleine-König wrote:
> Hello,
> 
> Antoine Beaupre (on Cc:) noticed that sparse doesn't work on some not so
> common architectures like ppc32le, s390x, ppc64 and sparc64[1]. This is
> nicely catched by the testsuite, e.g.:

The only architecture, from the above list, that is not supported
by cgcc seems to be ppc32le.

> 	ukleinek@plummer:~/sparse$ git rev-parse HEAD
> 	958c11c35d98417eb6b948bffe2dffed14eb3320
> 	ukleinek@plummer:~/sparse$ uname -a
> 	Linux plummer 4.9.0-3-powerpc64le #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) ppc64le GNU/Linux
> 	ukleinek@plummer:~/sparse$ make check V=1

It would be easier to see the results if you _didn't_ add V=1. ;-)

[snip]
> 	Out of 287 tests, 272 passed, 15 failed (10 of them are known to fail)
> 	Makefile:232: recipe for target 'check' failed
> 	make: *** [check] Error 1
> 	ukleinek@plummer:~/sparse$ 

The additional five failures are all in the llvm backend (sparsec),
which you do not need to use sparse as a 'checker'.

> The problem is that some cpp symbols are not defined in sparse that are
> expected to exist. So I can "fix" backend/sum.c with the following
> patch:
> 
> diff --git a/validation/backend/sum.c b/validation/backend/sum.c
> index 0604299..d0be8dd 100644
> --- a/validation/backend/sum.c
> +++ b/validation/backend/sum.c
> @@ -1,3 +1,5 @@
> +#define __powerpc64__
> +#define _CALL_ELF 2
>  #include <stdio.h>
>  #include <stdlib.h>
>  
> 

Yep, sparse/sparsec do not define various macros that gcc/clang define
by default on a given architecture. This is a known problem (that I have
been meaning to fix ...). The 'workaround' for the time being is to use
the cgcc front-end to sparse. (for example 'make CC=cgcc', or perhaps
'cgcc -no-compile').

[You didn't mention your usage - is this for a kernel build?]

ATB,
Ramsay Jones

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux