This patch is to fix the following compilation errors when "clang++ -stdlib=libc++" is used:<div><br></div><div><div>[ 49%] Building CXX object lib/ExecutionEngine/JIT/CMakeFiles/LLVMJIT.dir/Intercept.cpp.o</div>
<div>/home/ryuta/devel/llvm/src/llvm/lib/ExecutionEngine/JIT/Intercept.cpp:70:67: error: </div><div>      use of undeclared identifier 'lseek64'; did you mean 'fseeko64'?</div><div>    sys::DynamicLibrary::AddSymbol("\x1lseek64", (void*)(intptr_t)lseek64);</div>
<div>                                                                  ^~~~~~~</div><div>                                                                  fseeko64</div><div>/usr/include/stdio.h:811:12: note: 'fseeko64' declared here</div>
<div>extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);</div><div>           ^</div><div>1 error generated.</div></div><div><br></div><div><div>[ 50%] Building CXX object lib/ExecutionEngine/MCJIT/CMakeFiles/LLVMMCJIT.dir/Intercept.cpp.o</div>
<div>/home/ryuta/devel/llvm/src/llvm/lib/ExecutionEngine/MCJIT/Intercept.cpp:70:67: error: </div><div>      use of undeclared identifier 'lseek64'; did you mean 'fseeko64'?</div><div>    sys::DynamicLibrary::AddSymbol("\x1lseek64", (void*)(intptr_t)lseek64);</div>
<div>                                                                  ^~~~~~~</div><div>                                                                  fseeko64</div><div>/usr/include/stdio.h:811:12: note: 'fseeko64' declared here</div>
<div>extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);</div><div>           ^</div><div>1 error generated.</div></div><div><br></div><div><br></div><div>Note that lseek64 resides in unistd.h. Simply including the header fixed the problem.</div>
<div><br></div><div><br></div><div><div>Index: lib/ExecutionEngine/JIT/Intercept.cpp</div><div>===================================================================</div><div>--- lib/ExecutionEngine/JIT/Intercept.cpp<span class="Apple-tab-span" style="white-space:pre">   </span>(revision 137538)</div>
<div>+++ lib/ExecutionEngine/JIT/Intercept.cpp<span class="Apple-tab-span" style="white-space:pre">     </span>(working copy)</div><div>@@ -51,6 +51,7 @@</div><div> #if defined(HAVE_SYS_STAT_H)</div><div> #include <sys/stat.h></div>
<div> #endif</div><div>+#include <unistd.h></div><div> #include <fcntl.h></div><div> /* stat functions are redirecting to __xstat with a version number.  On x86-64</div><div>  * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'</div>
<div>Index: lib/ExecutionEngine/MCJIT/Intercept.cpp</div><div>===================================================================</div><div>--- lib/ExecutionEngine/MCJIT/Intercept.cpp<span class="Apple-tab-span" style="white-space:pre">    </span>(revision 137538)</div>
<div>+++ lib/ExecutionEngine/MCJIT/Intercept.cpp<span class="Apple-tab-span" style="white-space:pre">   </span>(working copy)</div><div>@@ -51,6 +51,7 @@</div><div> #if defined(HAVE_SYS_STAT_H)</div><div> #include <sys/stat.h></div>
<div> #endif</div><div>+#include <unistd.h></div><div> #include <fcntl.h></div><div> /* stat functions are redirecting to __xstat with a version number.  On x86-64</div><div>  * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'</div>
</div>