[llvm-commits] [PATCH] Missing unistd.h in JIT/Intercept.cpp and MCJIT/Intercept.cpp

NAKAMURA Takumi geek4civic at gmail.com
Sat Aug 13 17:37:22 PDT 2011


Fixed in r137567. I think we would need more generic way to register
symbols. (oc, w/o ffi!)

Arigato! ...Takumi

2011/8/13 Ryuta Suzuki <ryuuta at gmail.com>:
> This patch is to fix the following compilation errors when "clang++
> -stdlib=libc++" is used:
> [ 49%] Building CXX object
> lib/ExecutionEngine/JIT/CMakeFiles/LLVMJIT.dir/Intercept.cpp.o
> /home/ryuta/devel/llvm/src/llvm/lib/ExecutionEngine/JIT/Intercept.cpp:70:67:
> error:
>       use of undeclared identifier 'lseek64'; did you mean 'fseeko64'?
>     sys::DynamicLibrary::AddSymbol("\x1lseek64", (void*)(intptr_t)lseek64);
>                                                                   ^~~~~~~
>                                                                   fseeko64
> /usr/include/stdio.h:811:12: note: 'fseeko64' declared here
> extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
>            ^
> 1 error generated.
> [ 50%] Building CXX object
> lib/ExecutionEngine/MCJIT/CMakeFiles/LLVMMCJIT.dir/Intercept.cpp.o
> /home/ryuta/devel/llvm/src/llvm/lib/ExecutionEngine/MCJIT/Intercept.cpp:70:67:
> error:
>       use of undeclared identifier 'lseek64'; did you mean 'fseeko64'?
>     sys::DynamicLibrary::AddSymbol("\x1lseek64", (void*)(intptr_t)lseek64);
>                                                                   ^~~~~~~
>                                                                   fseeko64
> /usr/include/stdio.h:811:12: note: 'fseeko64' declared here
> extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
>            ^
> 1 error generated.
>
> Note that lseek64 resides in unistd.h. Simply including the header fixed the
> problem.
>
> Index: lib/ExecutionEngine/JIT/Intercept.cpp
> ===================================================================
> --- lib/ExecutionEngine/JIT/Intercept.cpp (revision 137538)
> +++ lib/ExecutionEngine/JIT/Intercept.cpp (working copy)
> @@ -51,6 +51,7 @@
>  #if defined(HAVE_SYS_STAT_H)
>  #include <sys/stat.h>
>  #endif
> +#include <unistd.h>
>  #include <fcntl.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'
> Index: lib/ExecutionEngine/MCJIT/Intercept.cpp
> ===================================================================
> --- lib/ExecutionEngine/MCJIT/Intercept.cpp (revision 137538)
> +++ lib/ExecutionEngine/MCJIT/Intercept.cpp (working copy)
> @@ -51,6 +51,7 @@
>  #if defined(HAVE_SYS_STAT_H)
>  #include <sys/stat.h>
>  #endif
> +#include <unistd.h>
>  #include <fcntl.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'
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>




More information about the llvm-commits mailing list