You are not logged in.

#1 2009-08-25 00:05:53

hack.augusto
Member
From: Brazil
Registered: 2008-08-28
Posts: 124

missing #define __x86_64__

I'm trying to use sparse on a x86_64 machine and I always get the following error message:

% sparse test.c
/usr/include/gnu/stubs.h:7:12: error: unable to open 'gnu/stubs-32.h'

where test.c is quite simple:

% cat test.c
#include <stdio.h>

int main(int argc, char* argv[]){

        printf("hello world");
        return 0;
}

so I've tracked why stubs-32.h was being used and the reason is that in the file /usr/include/bits/wordsize.h __WORDSIZE depends on __x86_64__ to be 64, because __x86_64__ is defined nowhere  __WORDSIZE  turns out to be 32 and stubs-32.h is used instead of stubs-64.h, any fix for that?

here is the exact same problem: https://bugs.launchpad.net/ubuntu/+sour … bug/374927

Offline

#2 2009-08-25 02:08:08

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: missing #define __x86_64__

Arch Linux's x86_64 gcc doesn't have multilib support. So sparse can't be built on x86_64. You could try building and using it in a 32 bit chroot.

Offline

#3 2009-11-14 23:05:53

slinkygn
Member
Registered: 2009-05-03
Posts: 15

Re: missing #define __x86_64__

Forgive the potentially dumb question, but -- does gcc have to support multilib for __x86_64__ to be defined?

I would've thought that, independent of whether gcc has multilib or not, it'd be appropriate to include the #define that dictates that builds should be for the x86_64 arch...

Then again, I'm not very confident of that.  Sorry if it's not a very clever question.  Would appreciate any explanations.

Offline

#4 2009-11-14 23:29:15

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: missing #define __x86_64__

slinkygn wrote:

Forgive the potentially dumb question, but -- does gcc have to support multilib for __x86_64__ to be defined?

I would've thought that, independent of whether gcc has multilib or not, it'd be appropriate to include the #define that dictates that builds should be for the x86_64 arch...

Then again, I'm not very confident of that.  Sorry if it's not a very clever question.  Would appreciate any explanations.

No, GCC has to have multilib enabled and Arch's doesn't. There's a GCC package in AUR that's multilib enabled, but you'll have to jump through a few hoops to get it working:

http://aur.archlinux.org/packages.php?ID=28545

**EDIT***

Crap. I misread your question. I don't actually know the answer. Sorry.

Offline

Board footer

Powered by FluxBB