On Wed, Aug 30, 2017 at 1:36 PM, Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx> wrote: >> > >> > 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?] > > This problem became visible during the make check phase when creating packaged > on the listed archs for horst[1]. You can see a build logs at > > https://buildd.debian.org/status/fetch.php?pkg=horst&arch=s390x&ver=5.0-1&stamp=1503905687&raw=0 > https://buildd.debian.org/status/fetch.php?pkg=horst&arch=ppc64el&ver=5.0-1&stamp=1503906226&raw=0 > > The error message looks identical (I checked the ppc64el log) to the > problem with backend/sum.c: > > sparse -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -std=gnu99 -Wall -Wextra -g -I. -DDO_DEBUG -I/usr/include/libnl3 *.[ch] > /usr/include/powerpc64le-linux-gnu/gnu/stubs.h:8:12: error: unable to open 'gnu/stubs-32.h' 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" Chris -- 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