* Bug#906472: horst: FTBFS in buster/sid (unable to open 'stdarg.h') [not found] ` <20180914140409.GA25593@localhost> @ 2018-09-14 19:45 ` Uwe Kleine-König 2018-09-24 16:23 ` Luc Van Oostenryck 0 siblings, 1 reply; 4+ messages in thread From: Uwe Kleine-König @ 2018-09-14 19:45 UTC (permalink / raw) To: Christoph Biedl, Santiago Vila; +Cc: 906472, linux-sparse, Adrian Bunk [-- Attachment #1: Type: text/plain, Size: 1851 bytes --] Hello, [Cc += sparse mailing list] On Fri, Sep 14, 2018 at 05:04:09PM +0300, Adrian Bunk wrote: > Control: reassign -1 sparse 0.5.2-1 > Control: affects -1 src:horst > > On Sat, Aug 25, 2018 at 10:09:47PM +0200, Christoph Biedl wrote: > > Santiago Vila wrote... > > > > > make -j1 check > > > make[1]: Entering directory '/<<PKGBUILDDIR>>' > > > 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/err.h:25:11: error: unable to open 'stdarg.h' > > > > To reproduce this it's important to remove gcc-7 from the build chroot > > (apt purge libgcc-7-dev ; apt --purge autoremove). > > > > Problem is, sparse appearently uses hardcoded paths and looks for > > stdarg.h in (among other places) > > > > | /usr/lib/gcc/x86_64-linux-gnu/7//include/stdarg.h > > | ^ > > > > ... which fails. > > > > Solution is to rebuild sparse, building horst was successful then. > > If this is true (please check!), the interesting question is why this > > wasn't a problem in earlier gcc version bumps. I think this is a known limitation of sparse and there are three ways to fix this (in my order of preference): a) let horst use cgcc -no-compile instead of sparse; or b) let sparse depend on libgcc-7-dev (or whatever provides the necessary files); or c) use autodetection which gcc is used and pick its files. I'm not sure if a) fixes the problem. It fixed another problem we had with horst's usage of sparse in the past though[1]. The downside of c) is that running this autodetection on every call to sparse is probably slowing down sparse a bit which isn't nice. Best regards Uwe [1] https://bugs.debian.org/873508 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Bug#906472: horst: FTBFS in buster/sid (unable to open 'stdarg.h') 2018-09-14 19:45 ` Bug#906472: horst: FTBFS in buster/sid (unable to open 'stdarg.h') Uwe Kleine-König @ 2018-09-24 16:23 ` Luc Van Oostenryck 2018-09-25 14:38 ` Uwe Kleine-König 0 siblings, 1 reply; 4+ messages in thread From: Luc Van Oostenryck @ 2018-09-24 16:23 UTC (permalink / raw) To: Uwe Kleine-König Cc: Christoph Biedl, Santiago Vila, 906472, linux-sparse, Adrian Bunk On Fri, Sep 14, 2018 at 09:45:44PM +0200, Uwe Kleine-König wrote: > Hello, > > [Cc += sparse mailing list] Sorry for the late answer. > > > Santiago Vila wrote... > > > > > > > make -j1 check > > > > make[1]: Entering directory '/<<PKGBUILDDIR>>' > > > > 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/err.h:25:11: error: unable to open 'stdarg.h' > > > > > > To reproduce this it's important to remove gcc-7 from the build chroot > > > (apt purge libgcc-7-dev ; apt --purge autoremove). > > > > > > Problem is, sparse appearently uses hardcoded paths and looks for > > > stdarg.h in (among other places) Well, sparse needs to know where it can find the system header files. There is an option for this: -gcc-base-dir (and -multiarch-dir). Usually you will want to use either some that are installed by your distro or the one that match the exact GCC version you're using. By *default*, if no -gcc-base-dir is used, sparse use the same dir as the one used by the GCC used to compile sparse itself. It's only this default that is hardcoded. > > > Solution is to rebuild sparse, building horst was successful then. > > > If this is true (please check!), the interesting question is why this > > > wasn't a problem in earlier gcc version bumps. > > I think this is a known limitation of sparse and there are three > ways to fix this (in my order of preference): > > a) let horst use cgcc -no-compile instead of sparse; or > b) let sparse depend on libgcc-7-dev (or whatever provides the > necessary files); or > c) use autodetection which gcc is used and pick its files. > > I'm not sure if a) fixes the problem. It fixed another problem we had > with horst's usage of sparse in the past though[1]. > > The downside of c) is that running this autodetection on every call to > sparse is probably slowing down sparse a bit which isn't nice. In case the default can't be used, like here, I think the best is to add in your Makefile something like: GCC_BASE_DIR=$(shell $(CC) -print-file-name=) SPARSE_FLAGS= -gcc-base-dir $(GCC_BASE_DIR) ... sparse $(SPARSE_FLAGS) ... This doesn't need to be done at each invocation of sparse (but will be done at each top-level make invocation). Regards, -- Luc ^ permalink raw reply [flat|nested] 4+ messages in thread
* Bug#906472: horst: FTBFS in buster/sid (unable to open 'stdarg.h') 2018-09-24 16:23 ` Luc Van Oostenryck @ 2018-09-25 14:38 ` Uwe Kleine-König 2018-09-25 17:06 ` Luc Van Oostenryck 0 siblings, 1 reply; 4+ messages in thread From: Uwe Kleine-König @ 2018-09-25 14:38 UTC (permalink / raw) To: Luc Van Oostenryck Cc: Christoph Biedl, Santiago Vila, 906472, linux-sparse, Adrian Bunk [-- Attachment #1.1: Type: text/plain, Size: 2258 bytes --] Hello Luc, On 09/24/2018 06:23 PM, Luc Van Oostenryck wrote: > On Fri, Sep 14, 2018 at 09:45:44PM +0200, Uwe Kleine-König wrote: >>>> Santiago Vila wrote... >>>> >>>>> make -j1 check >>>>> make[1]: Entering directory '/<<PKGBUILDDIR>>' >>>>> 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/err.h:25:11: error: unable to open 'stdarg.h' >>>> >>>> To reproduce this it's important to remove gcc-7 from the build chroot >>>> (apt purge libgcc-7-dev ; apt --purge autoremove). >>>> >>>> Problem is, sparse appearently uses hardcoded paths and looks for >>>> stdarg.h in (among other places) > > Well, sparse needs to know where it can find the system header files. > There is an option for this: -gcc-base-dir (and -multiarch-dir). > Usually you will want to use either some that are installed by your > distro or the one that match the exact GCC version you're using. I think I don't want to impose on sparse users to know the system header location. > By *default*, if no -gcc-base-dir is used, sparse use the same dir > as the one used by the GCC used to compile sparse itself. It's only > this default that is hardcoded. I wasn't sure if this is expected to work. I had in mind, that the version of gcc is used somewhere but couldn't find proof for that. > In case the default can't be used, like here, I think the best is > to add in your Makefile something like: > GCC_BASE_DIR=$(shell $(CC) -print-file-name=) > SPARSE_FLAGS= -gcc-base-dir $(GCC_BASE_DIR) > ... > sparse $(SPARSE_FLAGS) ... IMHO it is sensible to let sparse depend on (or at least recommend) gcc. And then the default value should be right. > This doesn't need to be done at each invocation of sparse (but will be done > at each top-level make invocation). I'd say you'd need := for this effect instead of =. But as I intend to make sure that with sparse the default headers are also available, this is a non-issue. (And this only happened because sparse was built with gcc-7 while horst was built with gcc-8.) Best regards and thanks for your valuable input, Uwe [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Bug#906472: horst: FTBFS in buster/sid (unable to open 'stdarg.h') 2018-09-25 14:38 ` Uwe Kleine-König @ 2018-09-25 17:06 ` Luc Van Oostenryck 0 siblings, 0 replies; 4+ messages in thread From: Luc Van Oostenryck @ 2018-09-25 17:06 UTC (permalink / raw) To: Uwe Kleine-König Cc: Christoph Biedl, Santiago Vila, 906472, linux-sparse, Adrian Bunk On Tue, Sep 25, 2018 at 04:38:01PM +0200, Uwe Kleine-König wrote: > > By *default*, if no -gcc-base-dir is used, sparse use the same dir > > as the one used by the GCC used to compile sparse itself. It's only > > this default that is hardcoded. > > I wasn't sure if this is expected to work. I had in mind, that the > version of gcc is used somewhere but couldn't find proof for that. Several other flags have their default value corresponding to the GCC used to compile sparse: for example the architecture (x86, x86-64) or the endianness. The one you're thinking about is probably the macros for the GCC version: __GNUC__, __GNUC_MINOR__ & __GNUC_PATCHLEVEL__. As far as I know, everything that should matter can be set explicitly either by defining the macro via -D...=... or an explicit flag like -m{32,64}, -m{little,big}-endian, -funsigned-char, ... When using sparse for userspace code, it may be best to use the cgcc wrapper since it take care to set (some of) these values. I'm saying 'may' because personnaly, I have no experience of using sparse via cgcc (as an user, I've only used sparse for OS or bare-metal code) but I know others use it like so (for example for git). > > In case the default can't be used, like here, I think the best is > > to add in your Makefile something like: > > GCC_BASE_DIR=$(shell $(CC) -print-file-name=) > > SPARSE_FLAGS= -gcc-base-dir $(GCC_BASE_DIR) > > ... > > sparse $(SPARSE_FLAGS) ... > > IMHO it is sensible to let sparse depend on (or at least recommend) gcc. > And then the default value should be right. > > > This doesn't need to be done at each invocation of sparse (but will be done > > at each top-level make invocation). > > I'd say you'd need := for this effect instead of =. Yes, indeed. > Best regards and thanks for your valuable input, > Uwe You're very welcome, -- Luc ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-25 17:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1535227396@msgid.manchmal.in-ulm.de>
[not found] ` <E1fqkJB-0004Wc-55@paradis.debian.org>
[not found] ` <20180914140409.GA25593@localhost>
2018-09-14 19:45 ` Bug#906472: horst: FTBFS in buster/sid (unable to open 'stdarg.h') Uwe Kleine-König
2018-09-24 16:23 ` Luc Van Oostenryck
2018-09-25 14:38 ` Uwe Kleine-König
2018-09-25 17:06 ` Luc Van Oostenryck
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox