Added a "ArchSpec::SetElfArch()" that was removed by a previous patch and
avoid using RTLD_FIRST with dlopen to keep things compatible with other *NIX
variants. Patch from Jai Menon.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125015 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index 7ca26b4..061a31e 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -25,6 +25,8 @@
 #include <libproc.h>
 #include <mach-o/dyld.h>
 #include <sys/sysctl.h>
+#elif defined (__linux__)
+#include <sys/wait.h>
 #endif
 
 using namespace lldb;
@@ -243,7 +245,7 @@
             }
         }
 #elif defined (__linux__)
-        g_host_arch.SetArch(7u, 144u);
+        g_host_arch.SetElfArch(7u, 144u);
 #endif
     }
     return g_host_arch;
@@ -648,7 +650,11 @@
     char path[PATH_MAX];
     if (file_spec.GetPath(path, sizeof(path)))
     {
+#if defined (__linux__)
+        dynamic_library_handle = ::dlopen (path, RTLD_LAZY | RTLD_GLOBAL);
+#else
         dynamic_library_handle = ::dlopen (path, RTLD_LAZY | RTLD_GLOBAL | RTLD_FIRST);
+#endif
         if (dynamic_library_handle)
         {
             error.Clear();