[cfe-dev] Error in xmmintrin.h with Clang and LLVM 3.1 built from RELEASE_31 tag.

Eli Friedman eli.friedman at gmail.com
Tue May 22 22:29:24 PDT 2012


On Tue, May 22, 2012 at 9:28 PM, Gabe Rives-Corbett
<gabe at gaberivescorbett.com> wrote:
> Hello,
>
> I built Clang and LLVM 3.1 on OS X using the following configure command:
>
> configure --with-gcc-toolchain=/opt/local/ --prefix=/opt/clang-3.1/
> --enable-targets=x86_64,x86 --enable-optimized
>
> the reason for the gcc-tolchain location is to use the macports gcc 4.6
> libstdc++ in order to support more of C++11.  I also made the following
> changes to InitHeaderSearch::AddDefaultCIncludePaths:
>
> void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
>                                             const HeaderSearchOptions
> &HSOpts) {
>   llvm::Triple::OSType os = triple.getOS();
>
>   if (HSOpts.UseStandardSystemIncludes) {
>     switch (os) {
>     case llvm::Triple::FreeBSD:
>     case llvm::Triple::NetBSD:
>       break;
>     default:
>       // FIXME: temporary hack: hard-coded paths.
>       //AddPath("/usr/local/include", System, true, false, false);
>
>       AddPath("/opt/local/include/gcc46/c++", System, true, false, false);
>  AddPath("/opt/local/include/gcc46/c++/x86_64-apple-darwin11/.", System,
> true, false, false);
>       AddPath("/opt/local/include/gcc46/c++/backward/", System, true, false,
> false);
>
> AddPath("/opt/local/lib/gcc46/gcc/x86_64-apple-darwin11/4.6.3/include",
> System, true, false, false);
>       AddPath("/usr/local/include", System, true, false, false);
>
> AddPath("/opt/local/lib/gcc46/gcc/x86_64-apple-darwin11/4.6.3/include-fixed",
> System, true, false, false);
>       AddPath("/usr/include", System, true, false, false);
>
>       break;
>     }
>   }
>
>
> Then when building a C source file I get the following error:
>
> In file included from
> /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20:
> In file included from
> /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21:
> In file included from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
> In file included from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:129:
> In file included from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32:
> In file included from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:29:
> /opt/local/lib/gcc46/gcc/x86_64-apple-darwin11/4.6.3/include/xmmintrin.h:102:10:
> error: invalid conversion between vector type '__m128' and integer type
> 'int' of different size
>
> Any ideas?

Adding "/opt/local/lib/gcc46/gcc/x86_64-apple-darwin11/4.6.3/include/"
to your include paths is a bad idea.

-Eli




More information about the cfe-dev mailing list