summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2012-09-04 09:14:45 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2012-09-04 09:14:45 +0000
commitc439a426499df7fa4e829087228bc3e313dd1e81 (patch)
tree1d24eb3c94e1ec0fc43d645f3cb34a85d93dd6cc /llvm
parentad41c4ce20ab92e679458c94767542cb965719f6 (diff)
downloadbcm5719-llvm-c439a426499df7fa4e829087228bc3e313dd1e81.tar.gz
bcm5719-llvm-c439a426499df7fa4e829087228bc3e313dd1e81.zip
Fix Android build of gtest and lib/Support.
llvm-svn: 163131
Diffstat (limited to 'llvm')
-rwxr-xr-xllvm/cmake/config-ix.cmake16
-rw-r--r--llvm/lib/Support/DynamicLibrary.cpp2
-rw-r--r--llvm/lib/Support/LockFileManager.cpp2
-rw-r--r--llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h2
4 files changed, 16 insertions, 6 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 9637363d38c..fcd5dd55667 100755
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -85,9 +85,19 @@ check_include_file(mach-o/dyld.h HAVE_MACH_O_DYLD_H)
# library checks
if( NOT PURE_WINDOWS )
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
- check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
- check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
- check_library_exists(pthread pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
+ if (HAVE_LIBPTHREAD)
+ check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
+ check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
+ check_library_exists(pthread pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
+ else()
+ # this could be Android
+ check_library_exists(c pthread_create "" PTHREAD_IN_LIBC)
+ if (PTHREAD_IN_LIBC)
+ check_library_exists(c pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
+ check_library_exists(c pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
+ check_library_exists(c pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
+ endif()
+ endif()
check_library_exists(dl dlopen "" HAVE_LIBDL)
endif()
diff --git a/llvm/lib/Support/DynamicLibrary.cpp b/llvm/lib/Support/DynamicLibrary.cpp
index fb02c07e4af..45fec361c1a 100644
--- a/llvm/lib/Support/DynamicLibrary.cpp
+++ b/llvm/lib/Support/DynamicLibrary.cpp
@@ -160,7 +160,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
// On linux we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we
// boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
-#if defined(__linux__)
+#if defined(__linux__) and !defined(__ANDROID__)
{
EXPLICIT_SYMBOL(stderr);
EXPLICIT_SYMBOL(stdout);
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index 64404a1a8e7..59bfcfcd254 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -49,7 +49,7 @@ LockFileManager::readLockFile(StringRef LockFileName) {
}
bool LockFileManager::processStillExecuting(StringRef Hostname, int PID) {
-#if LLVM_ON_UNIX
+#if LLVM_ON_UNIX && !defined(__ANDROID__)
char MyHostname[256];
MyHostname[255] = 0;
MyHostname[0] = 0;
diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
index 8ef5d7dd26a..58f6cafa75f 100644
--- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
+++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -230,7 +230,7 @@
# define GTEST_OS_MAC 1
#elif defined __linux__
# define GTEST_OS_LINUX 1
-# ifdef ANDROID
+# if defined(ANDROID) || defined(__ANDROID__)
# define GTEST_OS_LINUX_ANDROID 1
# endif // ANDROID
#elif defined __MVS__
OpenPOWER on IntegriCloud