aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-06-01 11:20:17 +0000
committerPavel Labath <labath@google.com>2017-06-01 11:20:17 +0000
commitd8d98f4d1baff2c0f79298bcf13e83c171a7e6cd (patch)
tree16961f9142093978ae627caaee98359e0b750fcc
parent921a9fc96ea6d1d73ac21f313305e94b5df7e593 (diff)
downloadlldb-d8d98f4d1baff2c0f79298bcf13e83c171a7e6cd.tar.gz
cmake: Enable process_vm_readv detection on android
Only android and linux can have this function as far as I am aware, but it seems cleaner to enable this code for all platforms. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@304405 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/modules/LLDBConfig.cmake42
1 files changed, 20 insertions, 22 deletions
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
index 609851f46..79512941f 100644
--- a/cmake/modules/LLDBConfig.cmake
+++ b/cmake/modules/LLDBConfig.cmake
@@ -334,28 +334,26 @@ if (HAVE_LIBDL)
list(APPEND system_libs ${CMAKE_DL_LIBS})
endif()
-if (CMAKE_SYSTEM_NAME MATCHES "Linux")
- # Check for syscall used by lldb-server on linux.
- # If these are not found, it will fall back to ptrace (slow) for memory reads.
- check_cxx_source_compiles("
- #include <sys/uio.h>
- int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
- HAVE_PROCESS_VM_READV)
-
- if (HAVE_PROCESS_VM_READV)
- add_definitions(-DHAVE_PROCESS_VM_READV)
- else()
- # If we don't have the syscall wrapper function, but we know the syscall number, we can
- # still issue the syscall manually
- check_cxx_source_compiles("
- #include <sys/syscall.h>
- int main() { return __NR_process_vm_readv; }"
- HAVE_NR_PROCESS_VM_READV)
-
- if (HAVE_NR_PROCESS_VM_READV)
- add_definitions(-DHAVE_NR_PROCESS_VM_READV)
- endif()
- endif()
+# Check for syscall used by lldb-server on linux.
+# If these are not found, it will fall back to ptrace (slow) for memory reads.
+check_cxx_source_compiles("
+ #include <sys/uio.h>
+ int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
+ HAVE_PROCESS_VM_READV)
+
+if (HAVE_PROCESS_VM_READV)
+ add_definitions(-DHAVE_PROCESS_VM_READV)
+else()
+ # If we don't have the syscall wrapper function, but we know the syscall number, we can
+ # still issue the syscall manually
+ check_cxx_source_compiles("
+ #include <sys/syscall.h>
+ int main() { return __NR_process_vm_readv; }"
+ HAVE_NR_PROCESS_VM_READV)
+
+ if (HAVE_NR_PROCESS_VM_READV)
+ add_definitions(-DHAVE_NR_PROCESS_VM_READV)
+ endif()
endif()
# Figure out if lldb could use lldb-server. If so, then we'll