22 lines
999 B
Diff
22 lines
999 B
Diff
diff --git a/onnxruntime/core/platform/posix/stacktrace.cc b/onnxruntime/core/platform/posix/stacktrace.cc
|
|
index 76864b2..185f131 100644
|
|
--- a/onnxruntime/core/platform/posix/stacktrace.cc
|
|
+++ b/onnxruntime/core/platform/posix/stacktrace.cc
|
|
@@ -3,7 +3,7 @@
|
|
|
|
#include "core/common/common.h"
|
|
|
|
-#if !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) && !defined(_AIX)
|
|
+#if defined(__GLIBC__) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) && !defined(_AIX)
|
|
#include <execinfo.h>
|
|
#endif
|
|
#include <vector>
|
|
@@ -13,7 +13,7 @@ namespace onnxruntime {
|
|
std::vector<std::string> GetStackTrace() {
|
|
std::vector<std::string> stack;
|
|
|
|
-#if !defined(NDEBUG) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_)
|
|
+#if defined(__GLIBC__) && !defined(NDEBUG) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_)
|
|
constexpr int kCallstackLimit = 64; // Maximum depth of callstack
|
|
|
|
void* array[kCallstackLimit];
|