summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Fischer <matt.fischer@garmin.com>2013-04-15 09:53:29 -0500
committerMatt Fischer <matt.fischer@garmin.com>2013-05-13 10:50:17 -0500
commiteac65dc9b8cc18fa4c65c0485878a11c470357b6 (patch)
tree9e9df0cd13876251b7240c2209fceb73631258d8 /include
parentac6c0a6535975f1dc2da6e4e2766614baac2a14a (diff)
downloadlibunwind-eac65dc9b8cc18fa4c65c0485878a11c470357b6.tar.gz
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile for QNX. * QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal with this, an AC_CHECK_HEADERS() was added to check for the files in both locations. * Similarly, QNX does not have <endian.h>. In cases where the file is not found, logic was added to refer to QNX-specific macros to determine endianness. * The QCC compiler, which is a wrapper around GCC, cannot handle some standard GCC options. Therefore, logic was added to check for QCC, and when it is found, to suppress the use of -lgcc, and to express the option -nostartfiles as -Wc,-nostartfiles instead, which is correctly passed on to the underlying GCC. * Finally, the support file os-qnx.c was added, patterned after the existing os-*.c files. Only local image lookup is currently supported (see the comments for more information), but this is sufficient for QNX, since ptrace is not supported there anyway, and that is the only case where the function is required to do remote image lookup. Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
Diffstat (limited to 'include')
-rw-r--r--include/dwarf.h14
-rw-r--r--include/libunwind_i.h17
2 files changed, 29 insertions, 2 deletions
diff --git a/include/dwarf.h b/include/dwarf.h
index 1885b9b1..7800567a 100644
--- a/include/dwarf.h
+++ b/include/dwarf.h
@@ -32,9 +32,21 @@ struct dwarf_cursor; /* forward-declaration */
struct elf_dyn_info;
#include "dwarf-config.h"
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#ifndef UNW_REMOTE_ONLY
-#include <link.h>
+ #if defined(HAVE_LINK_H)
+ #include <link.h>
+ #elif defined(HAVE_SYS_LINK_H)
+ #include <sys/link.h>
+ #else
+ #error Could not find <link.h>
+ #endif
#endif
+
#include <pthread.h>
/* DWARF expression opcodes. */
diff --git a/include/libunwind_i.h b/include/libunwind_i.h
index 966a3e36..f412e6ac 100644
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -56,7 +56,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <elf.h>
+
+#if defined(HAVE_ELF_H)
+# include <elf.h>
+#elif defined(HAVE_SYS_ELF_H)
+# include <sys/elf.h>
+#else
+# error Could not locate <elf.h>
+#endif
#if defined(HAVE_ENDIAN_H)
# include <endian.h>
@@ -67,6 +74,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# define __BIG_ENDIAN 4321
# if defined(__hpux)
# define __BYTE_ORDER __BIG_ENDIAN
+# elif defined(__QNX__)
+# if defined(__BIGENDIAN__)
+# define __BYTE_ORDER __BIG_ENDIAN
+# elif defined(__LITTLEENDIAN__)
+# define __BYTE_ORDER __LITTLE_ENDIAN
+# else
+# error Host has unknown byte-order.
+# endif
# else
# error Host has unknown byte-order.
# endif