diff options
author | Ranjeet Singh <Ranjeet.Singh@arm.com> | 2017-02-24 16:38:05 +0000 |
---|---|---|
committer | Ranjeet Singh <Ranjeet.Singh@arm.com> | 2017-02-24 16:38:05 +0000 |
commit | 744dabcdcdeec081aa148088fabd2b3502eaee1a (patch) | |
tree | e98b0cf5d72dcda026d5afafee8c5029359d3fe0 | |
parent | ae6f2bcb258472b3ed89b24b8fa6989395c059e3 (diff) | |
download | bcm5719-llvm-744dabcdcdeec081aa148088fabd2b3502eaee1a.tar.gz bcm5719-llvm-744dabcdcdeec081aa148088fabd2b3502eaee1a.zip |
[libunwind] Disable calls to fprintf for baremetal targets.
We've been having issues with using libcxxabi and libunwind for baremetal
targets because fprintf is dependent on io functions, this patch disables calls
to fprintf when building for baremetal in release mode.
Differential Revision: https://reviews.llvm.org/D30340
llvm-svn: 296135
-rw-r--r-- | libunwind/src/config.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libunwind/src/config.h b/libunwind/src/config.h index 8e57ec330af..2c046104827 100644 --- a/libunwind/src/config.h +++ b/libunwind/src/config.h @@ -78,6 +78,12 @@ #define _LIBUNWIND_BUILD_ZERO_COST_APIS 0 #endif +#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL) +#define _LIBUNWIND_ABORT(msg) \ + do { \ + abort(); \ + } while (0) +#else #define _LIBUNWIND_ABORT(msg) \ do { \ fprintf(stderr, "libunwind: %s %s:%d - %s\n", __func__, __FILE__, \ @@ -85,9 +91,14 @@ fflush(stderr); \ abort(); \ } while (0) +#endif +#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL) +#define _LIBUNWIND_LOG(msg, ...) +#else #define _LIBUNWIND_LOG(msg, ...) \ fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__) +#endif #if defined(_LIBUNWIND_HAS_NO_THREADS) // only used with pthread calls, not needed for the single-threaded builds |