Author: rsingh Date: Fri Feb 24 10:38:05 2017 New Revision: 296135 URL: http://llvm.org/viewvc/llvm-project?rev=296135&view=rev Log: [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 Modified: libunwind/trunk/src/config.h Modified: libunwind/trunk/src/config.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/config.h?rev=296135&r1=296134&r2=296135&view=diff ============================================================================== --- libunwind/trunk/src/config.h (original) +++ libunwind/trunk/src/config.h Fri Feb 24 10:38:05 2017 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits