diff mbox

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

Message ID 20170901074643.rivm2rit53mavkjr@taurus.defre.kleine-koenig.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Uwe Kleine-König Sept. 1, 2017, 7:46 a.m. UTC
Hello,

On Thu, Aug 31, 2017 at 11:43:53PM +0100, Ramsay Jones wrote:
> On 31/08/17 21:55, Uwe Kleine-König wrote:
> > On Wed, Aug 30, 2017 at 08:11:49PM -0400, Christopher Li wrote:
> >> That is very much like on x86_64 missing define "#weak_define __x86_64__ 1"
> >>
> >> Does cgcc work for you? In the future we do want to move the archetecture
> >> related define from cgcc into sparse by itself. For now you can set
> >> "sparse" as "cgcc -no-compile"
> > 
> > Yes that works. So to address the Debian bug I can do:
> > 
> >  - move sparse to /usr/lib
> >  - teach cgcc about the move of sparse
> >  - make /usr/bin/sparse call cgcc -no-compile "$@"
> 
> Hmm, I don't think that would be a good idea ...
> 
> > or is it easier to teach sparse about the architecture stuff?
> 
> I now understand (I think!) that you are building a sparse
> package (presumably a .deb) and you are concerned that sparse
> does not pass it's own testsuite on those platforms.

Nearly right. I'm responsible for the sparse Debian package and the
problem at hand is https://bugs.debian.org/873508. This bug report has
"Severity: serious" wihch might eventually result in the removal of
sparse from the Debian archive.

@anarcat: Given that cgcc seems to work, would you agree to apply the
following patch to horst:


and downgrade the bug to "important"? That would be a compromise that
buys us a bit of time.
 
> As I said before, the additional failures you are seeing are
> in the 'llvm backend' code (which, as far as I know, only passes
> on x86_64 Linux), and in my opinion the llvm-backend programs should
> not be installed. (The Makefile will build them automatically if
> you have llvm installed, likewise for c2xml/libxml and test-inspect/gtk).

Currently the sparse package contains /usr/include/sparse/, c2xml, cgcc,
sparse, sparse-llvm, sparsec and a separate package sparse-test-inspect
includes test-inspect. (That's how I inherited the package some time
ago.)
 
> [I would like to see build variable(s) to allow the user to suppress
> the build (or installation) of the other 'non-primary' sparse programs.]
> 
> Anyway, if you were to un-install llvm, sparse-llvm etc., would not
> be built, and the tests would not be run ... ;-)
> 
> Christopher, as the project maintainer, has the joy of making these
> kinds of decisions! :-D

This only solves a part of the problem because the bug report is about
sparse itself, not it's llvm part.

Best regards
Uwe

Comments

Antoine Beaupré Sept. 1, 2017, 11:33 a.m. UTC | #1
On 2017-09-01 09:46:44, Uwe Kleine-König wrote:
> Hello,
>
> On Thu, Aug 31, 2017 at 11:43:53PM +0100, Ramsay Jones wrote:
>> On 31/08/17 21:55, Uwe Kleine-König wrote:
>> > On Wed, Aug 30, 2017 at 08:11:49PM -0400, Christopher Li wrote:
>> >> That is very much like on x86_64 missing define "#weak_define __x86_64__ 1"
>> >>
>> >> Does cgcc work for you? In the future we do want to move the archetecture
>> >> related define from cgcc into sparse by itself. For now you can set
>> >> "sparse" as "cgcc -no-compile"
>> > 
>> > Yes that works. So to address the Debian bug I can do:
>> > 
>> >  - move sparse to /usr/lib
>> >  - teach cgcc about the move of sparse
>> >  - make /usr/bin/sparse call cgcc -no-compile "$@"
>> 
>> Hmm, I don't think that would be a good idea ...
>> 
>> > or is it easier to teach sparse about the architecture stuff?
>> 
>> I now understand (I think!) that you are building a sparse
>> package (presumably a .deb) and you are concerned that sparse
>> does not pass it's own testsuite on those platforms.
>
> Nearly right. I'm responsible for the sparse Debian package and the
> problem at hand is https://bugs.debian.org/873508. This bug report has
> "Severity: serious" wihch might eventually result in the removal of
> sparse from the Debian archive.
>
> @anarcat: Given that cgcc seems to work, would you agree to apply the
> following patch to horst:
>
> diff --git a/Makefile b/Makefile
> index 4f924fa..d563652 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -110,7 +110,7 @@ $(NAME): $(OBJS)
>  $(OBJS): .buildflags
>  
>  check:
> -	sparse $(CFLAGS) *.[ch]
> +	cgcc -no-compile $(CFLAGS) *.[ch]
>  
>  clean:
>  	-rm -f *.o radiotap/*.o *~
>
> and downgrade the bug to "important"? That would be a compromise that
> buys us a bit of time.

Well right now I have simply disabled the checks for those broken
architectures, so sparse isn't as affected anymore.

Frankly, I don't quite know what to do with this - but I'd be happy to
happly that patch to sparse if it fixes the issue better.

A.
Christopher Li Sept. 1, 2017, 11:51 a.m. UTC | #2
On Fri, Sep 1, 2017 at 3:46 AM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
\>
> Nearly right. I'm responsible for the sparse Debian package and the
> problem at hand is https://bugs.debian.org/873508. This bug report has
> "Severity: serious" wihch might eventually result in the removal of
> sparse from the Debian archive.
>
> @anarcat: Given that cgcc seems to work, would you agree to apply the
> following patch to horst:
>
> diff --git a/Makefile b/Makefile
> index 4f924fa..d563652 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -110,7 +110,7 @@ $(NAME): $(OBJS)
>  $(OBJS): .buildflags
>
>  check:
> -       sparse $(CFLAGS) *.[ch]
> +       cgcc -no-compile $(CFLAGS) *.[ch]

You patch definitely works.
I think it is the better way to fix it.
Sparse "selfcheck" target was doing the same thing.
It is using "cgcc -no-compile" already.

I suggest in your patch you can do some thing
similar to "selfcheck" target:

CHECKER = cgcc -no-compile

         $(CHECKER) $(CFLAGS) *.[ch]

Later when we update sparse to handle architecture
properly. We can just invoke make with "CHECKER=xxxx"
to test.


> and downgrade the bug to "important"? That would be a compromise that
> buys us a bit of time.

Agree.

>
> This only solves a part of the problem because the bug report is about
> sparse itself, not it's llvm part.

I agree with that too.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Uwe Kleine-König Sept. 21, 2017, 6:58 p.m. UTC | #3
Control: clone 873508 -1
Control: retitle -1 Please use cgcc to check hosted C code instead of sparse
Control: severity -1 normal
Control: reassign -1 horst

On Fri, Sep 01, 2017 at 09:46:44AM +0200, Uwe Kleine-König wrote:
> @anarcat: Given that cgcc seems to work, would you agree to apply the
> following patch to horst:
> 
> diff --git a/Makefile b/Makefile
> index 4f924fa..d563652 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -110,7 +110,7 @@ $(NAME): $(OBJS)
>  $(OBJS): .buildflags
>  
>  check:
> -	sparse $(CFLAGS) *.[ch]
> +	cgcc -no-compile $(CFLAGS) *.[ch]
>  
>  clean:
>  	-rm -f *.o radiotap/*.o *~
> 

In the meantime I learned from upstream that sparse is not expected to
grok arbitrary hosted code. For that it is needed to use the cgcc
wrapper to handle the required cpp symbols. That it works on some
architectures with plain sparse is mostly luck.

I still expect some platforms to fail with the wrapper, too, because
cgcc doesn't know about all platforms yet. But I intend to upload a new
sparse package soon that includes a build time check for that, and the
respective fixes are easy.

> and downgrade the bug to "important"? That would be a compromise that
> buys us a bit of time.

I'd say sparse failing on hosted code isn't "important", but cgcc should
have all necessary definitions for Debian platforms. So I'm keeping this
bug at important and intend to close it once all platforms are known to
it.

Best regards
Uwe
Uwe Kleine-König Sept. 26, 2017, 6:11 p.m. UTC | #4
Control: severity 873508 normal
Control: retitle 873508 Fix FTBFS for m68k, hurd, x32 and ppc64

On Thu, Sep 21, 2017 at 08:58:23PM +0200, Uwe Kleine-König wrote:
> I still expect some platforms to fail with the wrapper, too, because
> cgcc doesn't know about all platforms yet. But I intend to upload a new
> sparse package soon that includes a build time check for that, and the
> respective fixes are easy.

I did that now, and at least all official Debian ports pass that new
check. I downgraded the severity accordingly to normal.
 
Current build failures can be seen at

	https://buildd.debian.org/status/package.php?p=sparse&suite=unstable

hurd fails because it doesn't define PATH_MAX and NAME_MAX. m68k fails
with

	sparse: ptrlist.c:125: __add_ptr_list: Assertion `(3 & (unsigned long)ptr) == 0' failed.

(Didn't look into this one yet.) And ppc64 and x32 need the respective
cpp defines added I think. If noone beats me to it, I will look into the
latter at least during the next few days.

Best regards
Uwe
Antoine Beaupré Jan. 10, 2019, 2:28 a.m. UTC | #5
Control: forwarded -1 https://github.com/br101/horst/issues/93

On 2017-09-01 10:46:44, Uwe Kleine-König wrote:
> Hello,
>
> On Thu, Aug 31, 2017 at 11:43:53PM +0100, Ramsay Jones wrote:
>> On 31/08/17 21:55, Uwe Kleine-König wrote:
>> > On Wed, Aug 30, 2017 at 08:11:49PM -0400, Christopher Li wrote:
>> >> That is very much like on x86_64 missing define "#weak_define __x86_64__ 1"
>> >>
>> >> Does cgcc work for you? In the future we do want to move the archetecture
>> >> related define from cgcc into sparse by itself. For now you can set
>> >> "sparse" as "cgcc -no-compile"
>> > 
>> > Yes that works. So to address the Debian bug I can do:
>> > 
>> >  - move sparse to /usr/lib
>> >  - teach cgcc about the move of sparse
>> >  - make /usr/bin/sparse call cgcc -no-compile "$@"
>> 
>> Hmm, I don't think that would be a good idea ...
>> 
>> > or is it easier to teach sparse about the architecture stuff?
>> 
>> I now understand (I think!) that you are building a sparse
>> package (presumably a .deb) and you are concerned that sparse
>> does not pass it's own testsuite on those platforms.
>
> Nearly right. I'm responsible for the sparse Debian package and the
> problem at hand is https://bugs.debian.org/873508. This bug report has
> "Severity: serious" wihch might eventually result in the removal of
> sparse from the Debian archive.
>
> @anarcat: Given that cgcc seems to work, would you agree to apply the
> following patch to horst:
>
> diff --git a/Makefile b/Makefile
> index 4f924fa..d563652 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -110,7 +110,7 @@ $(NAME): $(OBJS)
>  $(OBJS): .buildflags
>  
>  check:
> -	sparse $(CFLAGS) *.[ch]
> +	cgcc -no-compile $(CFLAGS) *.[ch]
>  
>  clean:
>  	-rm -f *.o radiotap/*.o *~
>
> and downgrade the bug to "important"? That would be a compromise that
> buys us a bit of time.

For what it's worth, this doesn't work with the latest horst. I've
reported the bug upstream now and disabled the checks for all
architectures now that it also fails on amd64.

A.
Luc Van Oostenryck Jan. 10, 2019, 11:39 a.m. UTC | #6
On Wed, Jan 09, 2019 at 09:28:54PM -0500, Antoine Beaupré wrote:
> Control: forwarded -1 https://github.com/br101/horst/issues/93

Hi,

The issue showed there, more precisely the one:
  /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:21:1: error: Expected ) in function declarator
is caused by sparse's lack of support for _Float128 and occurs with
recent version of glibc.

This has been fixed and upstreamed (see
https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=4e9c8ee467dd87d41d5aaa3c5a487e3f05ffb79c
for more details).
 
Best regards,
-- Luc
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 4f924fa..d563652 100644
--- a/Makefile
+++ b/Makefile
@@ -110,7 +110,7 @@  $(NAME): $(OBJS)
 $(OBJS): .buildflags
 
 check:
-	sparse $(CFLAGS) *.[ch]
+	cgcc -no-compile $(CFLAGS) *.[ch]
 
 clean:
 	-rm -f *.o radiotap/*.o *~