Sparse package doesn't run on 64 bits system

Bug #374927 reported by Stéphane Raimbault
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
sparse (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: sparse

1) sb_release -rd
Description: Ubuntu 9.04
Release: 9.04

2) sparse:
  Installed: 0.4.1-1
  Candidate: 0.4.1-1
  Version table:
 *** 0.4.1-1 0
        500 http://fr.archive.ubuntu.com jaunty/multiverse Packages
        100 /var/lib/dpkg/status

3 and 4)
Tested on Jaunty x86_64.
1 - Run sparse on any C file.
2 - The ouput: /usr/include/gnu/stubs.h:7:12: error: unable to open 'gnu/stubs-32.h'

Only the file gnu/stubs-64.h is available on my system.

Extract from gnu/stubs.h:
#if __WORDSIZE == 32
# include <gnu/stubs-32.h>
#elif __WORDSIZE == 64
# include <gnu/stubs-64.h>

Revision history for this message
Joachim Nilsson (troglobit) wrote :

Same problem here on Ubuntu 10.04 (64-bit).

However, running sparse via the GCC wrapper 'cgcc' seems to work better. Don't really understand why, but it does. So simply setting the CC variable before calling 'make' does the trick for me:

jocke@luthien:~/Troglobit/pimd$ CC=cgcc make -j3 clean all

... most Makefiles support overriding the CC variable, but not all YMMV.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hmm, this is a bit messy

On raring:
  sparse t.c
/usr/include/stdc-predef.h:30:11: error: unable to open 'bits/predefs.h'

so I add a -I:
sparse -I/usr/include/x86_64-linux-gnu t.c
/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:12: error: unable to open 'gnu/stubs-32.h'

then we have Stéphane's original error.

If I add another to point to the correct gcc path (sparse seems to be using a non-existent one):

sparse -I/usr/include/x86_64-linux-gnu -D__x86_64__ -I /usr/lib/gcc/x86_64-linux-gnu/4.6/include t.c

almost works, although it's hitting a
/usr/include/stdio.h:347:41: error: attribute '__leaf__': unknown attribute

I guess the age of the sparse version doesn't help either.

Dave

Changed in sparse (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Rusty Russell (rusty-rustcorp) wrote :

Sparse gives me the same erorr on 13.04 i686:
$ cgcc -c foo.c
/usr/include/stdc-predef.h:30:11: error: unable to open 'bits/predefs.h'

Fix is to install gcc-multilib: perhaps this should be a dependency?

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hmm, I don't think it's gcc-multilib directly; I think it's something it depends on libc6-dev-i386 that it pulls in.

I just tried this in a saucy (13.10) 64 bit vm, and it failed.

sudo apt-get install gcc-multilib
and it works

But sudo dpkg --purge gcc-multilib gcc-4.8-multilib
and it still works.

sudo apt-get remove libc6-dev-i386
and it fails again

so I think it depends on what you actually want from a fix; putting a dep on libc6-dev-i386 makes it
work but it's still running sparse in 32 bits.

Revision history for this message
Matthias Klose (doko) wrote :

closing old issue, 0.5 is in the archive

Changed in sparse (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.