]> granicus.if.org Git - llvm/commitdiff
Fix LLDB Android AArch64 GCC debug info build
authorOmair Javaid <omair.javaid@linaro.org>
Thu, 2 Feb 2017 01:17:49 +0000 (01:17 +0000)
committerOmair Javaid <omair.javaid@linaro.org>
Thu, 2 Feb 2017 01:17:49 +0000 (01:17 +0000)
Committing after fixing suggested changes and tested release/debug builds on
x86_64-linux and arm/aarch64 builds.

Differential revision: https://reviews.llvm.org/D29042

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293850 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/config-ix.cmake
include/llvm/Config/config.h.cmake
lib/Support/Unix/Path.inc
lib/Support/Unix/Signals.inc

index a96a722f34d6bbbcd65eaf5a5982a76dd23bb65f..50bcc508a8024448f9d46a60974a52f4bceec0ba 100755 (executable)
@@ -227,6 +227,7 @@ if( HAVE_DLFCN_H )
     list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
   endif()
   check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
+  check_symbol_exists(dladdr dlfcn.h HAVE_DLADDR)
   if( HAVE_LIBDL )
     list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
   endif()
index 30a31ecd27f967b8b88b8f6b12a959fda12c5121..3ee48a0d1ba884611ec2109e61d8b2e333c2b080 100644 (file)
@@ -51,6 +51,9 @@
 /* Define if dlopen() is available on this platform. */
 #cmakedefine HAVE_DLOPEN ${HAVE_DLOPEN}
 
+/* Define if dladdr() is available on this platform. */
+#cmakedefine HAVE_DLADDR ${HAVE_DLADDR}
+
 /* Define to 1 if you have the <errno.h> header file. */
 #cmakedefine HAVE_ERRNO_H ${HAVE_ERRNO_H}
 
index ecc9a2ea8e2156f38f87d55e05e610417520cc04..10e21af5371520ddc3eda829c0ae2663a7119e25 100644 (file)
@@ -180,7 +180,7 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
       if (getprogpath(exe_path, argv0))
         return exe_path;
   }
-#elif defined(HAVE_DLFCN_H)
+#elif defined(HAVE_DLFCN_H) && defined(HAVE_DLADDR)
   // Use dladdr to get executable path if available.
   Dl_info DLInfo;
   int err = dladdr(MainAddr, &DLInfo);
index 9752b70644c64a2c5a69a4e923e1bb8893507309..081b2fe33a6ebd44c83a42a8bf2f4be50196ea0b 100644 (file)
@@ -412,7 +412,7 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS) {
 
   if (printSymbolizedStackTrace(Argv0, StackTrace, depth, OS))
     return;
-#if HAVE_DLFCN_H && __GNUG__ && !defined(__CYGWIN__)
+#if HAVE_DLFCN_H && HAVE_DLADDR
   int width = 0;
   for (int i = 0; i < depth; ++i) {
     Dl_info dlinfo;