<div dir="ltr">Hello,<div><br></div><div>I'm trying to use SSE intrinsic functions like _mm_store_ps from the header xmmintrin.h. I believe that the compiler is meant to provide the definitions for these functions, is that right? For some reason clang doesn't seem to be doing that so I'm getting undefined symbol errors while linking. This problem occurs when I invoke clang programatically, but not when I compile using the clang frontend executable, despite using the same arguments with both the executable and CompilerInvocation::CreateFromArgs. I'm trying to work out what could be causing this.</div><div><br></div><div>So for instance, this works fine:</div><div><br></div><div><div>F:\Clanggit\build\32\Release\bin>clang -cc1 -triple i686-pc-windows-msvc -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -mrelocation-model static -mdisable-fp-elim -std=c++11 -masm-verbose -mconstructor-aliases -target-cpu pentium4 -D_MT --depe</div><div>ndent-lib=libcmt --dependent-lib=oldnames -fdiagnostics-format msvc -D _HAS_EXCEPTIONS=1 -internal-isystem "F:\Clanggit\build\32\Debug\lib\clang\3.7.0\include" -internal-isystem "E:/Microsoft Visual Studio 12.0/VC/include" -internal-isystem "C:/Program Fil</div><div>es (x86)/Windows Kits/8.1/Include" -internal-isystem "F:/git/scripta/trunk/include" -internal-isystem "F:\\Libraries\\eigen\\Eigen" -fno-dwarf-directory-asm -ferror-limit 19 -fmessage-length 80 -mstackrealign -target-feature +sse4.2 -fms-extensions -fms-co</div><div>mpatibility -fms-compatibility-version=18.00 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -fdelayed-template-parsing -O3 -o outsource.obj -x c++  source.cpp -v</div><div>clang -cc1 version 3.7.0 based upon LLVM 3.7.0svn default target i686-pc-windows-msvc</div><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div><div> F:\Clanggit\build\32\Debug\lib\clang\3.7.0\include</div><div> E:/Microsoft Visual Studio 12.0/VC/include</div><div> C:/Program Files (x86)/Windows Kits/8.1/Include</div><div> F:/git/scripta/trunk/include</div><div> F:\\Libraries\\eigen\\Eigen</div><div>End of search list.</div></div><div><br></div><div>Resulting obj relocs from the above compilation using the clang frontend executable:</div><div><br></div><div><div>File: outsource.obj</div><div>Format: COFF-i386</div><div>Arch: i386</div><div>AddressSize: 32bit</div><div>Relocations [</div><div>  Section (1) .text {</div><div>    0x7 IMAGE_REL_I386_DIR32 .rdata</div><div>    0xC IMAGE_REL_I386_REL32 _puts</div><div>    0x11 IMAGE_REL_I386_REL32 _getchar</div><div>  }</div></div><div><br></div><div>Resulting obj relocs from the obj created by the compiler instance invocation in my program (using the same arguments): </div><div><br></div><div><div>File: temp</div><div>Format: COFF-i386</div><div>Arch: i386</div><div>AddressSize: 32bit</div><div>Relocations [</div><div>  Section (1) .text {</div><div>    0x26 IMAGE_REL_I386_DIR32 ??_C@_1LA@EKEBDMEJ@?$AA?4?$AA?1?$AAS?$AAc?$AAr?$AAi?$AAp?$AAt?$AAa?$AA?1?$AAs?$AAc?$AAr?$AAi?$AAp?$AAt?$AAs?$AA?1?$AA?4?$AA?4?$AA?1?$AA?4?$AA?4?$AA?1?$AA?4?$AA?4?$AA?1?$AA?4?$AA?4?$AA?1?$AA?4?$AA?4@</div><div>    0x2D IMAGE_REL_I386_DIR32 ??_C@_1BIM@JPMPBING@?$AA?$CI?$AAr?$AAe?$AAi?$AAn?$AAt?$AAe?$AAr?$AAp?$AAr?$AAe?$AAt?$AA_?$AAc?$AAa?$AAs?$AAt?$AA?$DM?$AAs?$AAi?$AAz?$AAe?$AA_?$AAt?$AA?$DO?$AA?$CI?$AAa?$AAr?$AAr?$AAa?$AAy?$AA?$CJ@</div><div>    0x32 IMAGE_REL_I386_REL32 __wassert</div><div>    0x60 IMAGE_REL_I386_DIR32 .rdata</div><div>    0x65 IMAGE_REL_I386_REL32 _puts</div><div>    0x81 IMAGE_REL_I386_REL32 __mm_load_ps</div><div>    0x94 IMAGE_REL_I386_REL32 __mm_load_ps</div><div>    0xB4 IMAGE_REL_I386_REL32 __mm_store_ps</div><div>    0xD4 IMAGE_REL_I386_REL32 __mm_store_ps</div><div>    0xDB IMAGE_REL_I386_DIR32 .rdata</div><div>    0xE0 IMAGE_REL_I386_REL32 _puts</div><div>    0xE5 IMAGE_REL_I386_REL32 _getchar</div><div>    0x10C IMAGE_REL_I386_DIR32 .rdata</div><div>    0x111 IMAGE_REL_I386_REL32 _puts</div><div>  }</div></div><div><br></div></div>