diff -Naur llvm-2.9/lib/ExecutionEngine/JIT/Intercept.cpp llvm-2.9-patched/lib/ExecutionEngine/JIT/Intercept.cpp
--- llvm-2.9/lib/ExecutionEngine/JIT/Intercept.cpp	2010-11-30 02:16:10.000000000 +0800
+++ llvm-2.9-patched/lib/ExecutionEngine/JIT/Intercept.cpp	2015-01-28 14:49:29.063660956 +0800
@@ -52,6 +52,7 @@
 #include <sys/stat.h>
 #endif
 #include <fcntl.h>
+#include <unistd.h>
 /* stat functions are redirecting to __xstat with a version number.  On x86-64 
  * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat' 
  * available as an exported symbol, so we have to add it explicitly.
