diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-04-09 20:45:04 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-04-09 20:45:04 +0000 |
| commit | a3872cd664c9d9fd08524e27ea258cff32fe6fc8 (patch) | |
| tree | 31267a53e38be19682f5395c271d5191c9e2766f /lib | |
| parent | 3716552fc25a3c4ea11094b44126071017a2224b (diff) | |
| download | external_llvm-a3872cd664c9d9fd08524e27ea258cff32fe6fc8.zip external_llvm-a3872cd664c9d9fd08524e27ea258cff32fe6fc8.tar.gz external_llvm-a3872cd664c9d9fd08524e27ea258cff32fe6fc8.tar.bz2 | |
add minix support, patch by Kees van Reeuwijk! PR6797
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Support/raw_ostream.cpp | 3 | ||||
| -rw-r--r-- | lib/System/DynamicLibrary.cpp | 14 | ||||
| -rw-r--r-- | lib/Transforms/Makefile | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 7a02db1..0b05c54 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -442,7 +442,8 @@ uint64_t raw_fd_ostream::seek(uint64_t off) { } size_t raw_fd_ostream::preferred_buffer_size() const { -#if !defined(_MSC_VER) && !defined(__MINGW32__) // Windows has no st_blksize. +#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_MINIX) + // Windows and Minix have no st_blksize. assert(FD >= 0 && "File not yet open!"); struct stat statbuf; if (fstat(FD, &statbuf) != 0) diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp index d6f3140..ebc8acf 100644 --- a/lib/System/DynamicLibrary.cpp +++ b/lib/System/DynamicLibrary.cpp @@ -44,6 +44,7 @@ void llvm::sys::DynamicLibrary::AddSymbol(const char* symbolName, #else +#if HAVE_DLFCN_H #include <dlfcn.h> using namespace llvm; using namespace llvm::sys; @@ -68,6 +69,17 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename, OpenedHandles->push_back(H); return false; } +#else + +using namespace llvm; +using namespace llvm::sys; + +bool DynamicLibrary::LoadLibraryPermanently(const char *Filename, + std::string *ErrMsg) { + if (ErrMsg) *ErrMsg = "dlopen() not supported on this platform"; + return true; +} +#endif namespace llvm { void *SearchForAddressOfSpecialSymbol(const char* symbolName); @@ -84,6 +96,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { return I->second; } +#if HAVE_DLFCN_H // Now search the libraries. if (OpenedHandles) { for (std::vector<void *>::iterator I = OpenedHandles->begin(), @@ -95,6 +108,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { } } } +#endif if (void *Result = llvm::SearchForAddressOfSpecialSymbol(symbolName)) return Result; diff --git a/lib/Transforms/Makefile b/lib/Transforms/Makefile index ea4a115..e527be2 100644 --- a/lib/Transforms/Makefile +++ b/lib/Transforms/Makefile @@ -13,7 +13,7 @@ PARALLEL_DIRS = Utils Instrumentation Scalar InstCombine IPO Hello include $(LEVEL)/Makefile.config # No support for plugins on windows targets -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW Minix)) PARALLEL_DIRS := $(filter-out Hello, $(PARALLEL_DIRS)) endif |
