On 2/15/19 10:10 PM, Ramsay Jones wrote: > > > On 15/02/2019 20:17, Uwe Kleine-König wrote: >> On 2/15/19 6:22 PM, Ramsay Jones wrote: >>> >>> >>> On 15/02/2019 08:34, Uwe Kleine-König wrote: >>> [snip] >>>> I use CC = gcc-8 for the debian package because other it can happen (and >>>> it actually did) that /usr/bin/gcc was updated from gcc-X to gcc-(X+1) >>>> and then sparse started to fail because it still used >>>> /usr/lib/gcc/x86_64-linux-gnu/X/ (i.e. the output of >>>> >>>> gcc --print-file-name= >>>> >>>> ) which disappeard as it changes on major version bumps. >>>> >>>> So sparse depends explicitly on the current gcc version and uses this. >>> >>> Hmm, yes, sparse may well depend a little too much on gcc. ;-) >>> >>> Having said that, these values built-in to sparse are just >>> default values that can be set from the command-line of >>> sparse (see -gcc-base-dir and -multiarch-dir). Indeed they >>> _are_ set by cgcc by running the 'specified c compiler' at >>> each invocation, if not _also_ specified on the cgcc command >>> line. >>> >>> Hmm, do you remember how/what failed? (I suppose this was not >>> a kernel usage). >> >> Right. The problem was https://bugs.debian.org/906472 . > > Oh, my word! So, the 'horst' package was using sparse on user-space > code directly, not via 'cgcc -no-compile'? I am somewhat surprised > that it worked at all! ;-) > > Also, it seems that the package was built in a chroot environment > where the compiler was 'swapped out' mid build! What ??? No, no I > must have misunderstood something. :( There happened nothing in the middle of the build. sparse 0.5.2-1 was built in April 2018 when gcc was still gcc-7, so it used the gcc-7 path. Later in August after gcc was bumped to gcc-8 to build horst the following packages were installed: sparse 0.5.2-1 gcc-8 and no gcc-7. As sparse was not rebuild from source but just the binary from April installed sparse failed to find stdarg.h. So the problem was that sparse hard-coded a path to the gcc-7 includes but didn't ensure gcc-7 to be around. Today sparse hardcodes the gcc-8 includes and depends on gcc-8 such that the used path is provided and available to pick includes from there. > 'sparse' has improved quite a bit recently, but I would still > highly recommend using 'cgcc [-no-compile]' on user-space code! Yeah, Luc's 949a29adb9f400ebdc15aed2dd874c17ffa839cb is a right step here. Best regards Uwe
Attachment:
signature.asc
Description: OpenPGP digital signature