[PATCH] libunwind cannot be used in C programs due to __cxxabi_config.h include

Oleg Ranevskyy llvm.mail.list at gmail.com
Thu May 21 10:25:40 PDT 2015


Hi compnerd,

Hello,

The public libunwind's headers include <__cxxabi_config.h> that is installed into C++ headers directory.
libunwind.h / unwind.h cannot be used from C code for this reason.

The patch introduces libunwind specific <libunwind_config.h> header instead and removes dependency on <__cxxabi_config.h>.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9915

Files:
  include/libunwind.h
  include/libunwind_config.h
  include/unwind.h
  src/Unwind-EHABI.h

Index: include/libunwind.h
===================================================================
--- include/libunwind.h
+++ include/libunwind.h
@@ -17,7 +17,7 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#include <__cxxabi_config.h>
+#include <libunwind_config.h>
 
 #ifdef __APPLE__
   #include <Availability.h>
Index: include/libunwind_config.h
===================================================================
--- include/libunwind_config.h
+++ include/libunwind_config.h
@@ -0,0 +1,20 @@
+//===-------------------------- libunwind_config.h -------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ____LIBUNWIND_CONFIG_H
+#define ____LIBUNWIND_CONFIG_H
+
+#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
+    !defined(__ARM_DWARF_EH__)
+#define LIBCXXABI_ARM_EHABI 1
+#else
+#define LIBCXXABI_ARM_EHABI 0
+#endif
+
+#endif // ____LIBUNWIND_CONFIG_H
Index: include/unwind.h
===================================================================
--- include/unwind.h
+++ include/unwind.h
@@ -23,7 +23,7 @@
 #define LIBUNWIND_UNAVAIL
 #endif
 
-#include <__cxxabi_config.h>
+#include <libunwind_config.h>
 
 typedef enum {
   _URC_NO_REASON = 0,
Index: src/Unwind-EHABI.h
===================================================================
--- src/Unwind-EHABI.h
+++ src/Unwind-EHABI.h
@@ -11,7 +11,7 @@
 #ifndef __UNWIND_EHABI_H__
 #define __UNWIND_EHABI_H__
 
-#include <__cxxabi_config.h>
+#include <libunwind_config.h>
 
 #if LIBCXXABI_ARM_EHABI

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9915.26250.patch
Type: text/x-patch
Size: 1781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150521/3d0ec848/attachment.bin>


More information about the llvm-commits mailing list