This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Build Error - gcc must provide the <cpuid.h> header
- From: Sreyan Chakravarty <sreyan dot mailing at gmail dot com>
- To: "Carlos O'Donell" <carlos at systemhalted dot org>
- Cc: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Sat, 21 May 2016 21:54:55 +0530
- Subject: Re: Build Error - gcc must provide the <cpuid.h> header
- Authentication-results: sourceware.org; auth=none
- References: <CAOcRYWrB24rSTw_snTa-gA9EnvQz6bP=KAW3dP4rwJ6yrgzVzA at mail dot gmail dot com> <20160519221544 dot GR26300 at vapier dot lan> <CAOcRYWqoq0sfn+Y5OeQyCFrwqrg8Gwu7ChEwz1a1zPFv2GSHLw at mail dot gmail dot com> <CAE2sS1h344dJG8dMgRqmshqh=UQOfYEo3J1os1OKW0dHBYSqRw at mail dot gmail dot com> <CAOcRYWq=XDd70S+RxX_X7ixDmUzhz9f09bVWQReHF9AWU_KcUw at mail dot gmail dot com> <CAE2sS1i5dofuMLHACHPi8505QmqU88NXtiEHDEhZvjok+Tj0Cg at mail dot gmail dot com> <CAOcRYWrFRMSbRA7LUkBKPF26wD1YMNBf=auz0jYG5nd9UZSi4A at mail dot gmail dot com> <CAOcRYWoLx9NJ8U-5rqB7ysFZgE5WWcDfzv3M0mVXXJdyhPcRrA at mail dot gmail dot com>
Thank you Carlos. I have resolved the error.
Here is what I did-:
I did the search on my system for cpuid.h using the following command-:
find /usr/ -name cpuid.h
which turned up only one result-:
/usr/src/linux-headers-2.6.24-32-generic/include/config/x86/cpuid.h
Then I copied the above file into my /usr/include/ using the cp
command. Then the configuration worked fine.
What still confuses me is that why was cpuid.h present in x86 folder
when I am clearly on x86_64 machine. If anyone can explain that then
it would be great.
Thanks once to Carlos for pointing me in the right direction.
On 5/21/16, Sreyan Chakravarty <sreyan.mailing@gmail.com> wrote:
> Could you also please tell me where is
>
> contest.c located ? Its obviously not in the glibc sources that I
> downloaded. So where is it coming from ?
>
> On 5/21/16, Sreyan Chakravarty <sreyan.mailing@gmail.com> wrote:
>> Guess you are right. Something is wrong with my toolchain. The test
>> program you gave did not compile.
>>
>> But when I did a
>> find /usr/ -name cpuid.h
>>
>> /usr/src/linux-headers-2.6.24-32-generic/include/config/x86/cpuid.h
>>
>> I managed to find the above file. What bothers me is that, it was
>> found under x86 while I am clearly trying to compile for x86_64.
>>
>> Thanks for shedding light on why my configuration process is failing.
>>
>> Do you have any ideas why this might be happening ?
>>
>> On 5/21/16, Carlos O'Donell <carlos@systemhalted.org> wrote:
>>> On Fri, May 20, 2016 at 5:01 PM, Sreyan Chakravarty
>>> <sreyan.mailing@gmail.com> wrote:
>>>> I have no idea on how to read the config.log. All I can understand is
>>>> that from lines 19-28 I am getting "unknown" probably because I am on
>>>> a VM.
>>>
>>> configure:635: checking cpuid.h usability
>>> configure:635: gcc -c -g -O2 conftest.c >&5
>>> conftest.c:84:19: error: cpuid.h: No such file or directory
>>>
>>> You lack cpuid.h. It looks like your installation is broken.
>>>
>>> Are you compiling locally? If yes, then what does `find /usr -name
>>> cpuid.h` show?
>>>
>>> The following program should compile just fine:
>>> #include <stdio.h>
>>> #include <cpuid.h>
>>> int main (void) { return 0; }
>>>
>>> gcc -o test test.c
>>>
>>> If this fails, then your toolchain is broken.
>>>
>>> Cheers,
>>> Carlos.
>>>
>>
>