[cfe-dev] Does clang work on X86-64 machines?

Devang Patel dpatel at apple.com
Fri Feb 29 14:23:00 PST 2008


On Feb 29, 2008, at 1:59 PM, Eli Friedman wrote:

> On Fri, Feb 29, 2008 at 1:52 PM, Török Edwin <edwintorok at gmail.com>  
> wrote:
>> Index: Driver/clang.cpp
>> ===================================================================
>> --- Driver/clang.cpp    (revision 47285)
>> +++ Driver/clang.cpp    (working copy)
>> @@ -891,6 +891,8 @@
>>     AddPath("/usr/include", System, false, false, false, Headers);
>>     AddPath("/System/Library/Frameworks", System, true, false, true,
>> Headers);
>>     AddPath("/Library/Frameworks", System, true, false, true,  
>> Headers);
>> +    AddPath("/usr/lib/gcc/x86_64-linux-gnu/4.2.3/include", System,
>> +            false,false,false,Headers);
>>   }
>
> Feel free to commit this patch; the whole thing is just a temporary
> hack until clang gets its own standard headers anyway.

This hack hard codes gcc version 4.2.3 and target triplet. This hack  
opens door for multiple paths (each one for a unique combination of  
gcc version # and target triplet. Which could turn this into ugly hack  
very soon.

A better alternative is to use a clang configure time option that  
allows you to capture "/usr/lib/gcc/x86_64-linux-gnu/4.2.3/" as  
GCC_HEADERS_PATH and then add GCC_HEADERS_PATH/include here. A clang  
command line option to do the same would also work here, I guess.

-
Devang



More information about the cfe-dev mailing list