[Lldb-commits] [lldb] r304405 - cmake: Enable process_vm_readv detection on android

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 1 04:20:17 PDT 2017


Author: labath
Date: Thu Jun  1 06:20:17 2017
New Revision: 304405

URL: http://llvm.org/viewvc/llvm-project?rev=304405&view=rev
Log:
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.

Modified:
    lldb/trunk/cmake/modules/LLDBConfig.cmake

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=304405&r1=304404&r2=304405&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Jun  1 06:20:17 2017
@@ -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)
+# 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_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()
+  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




More information about the lldb-commits mailing list