Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
classlib: add guards for x86_64 unwind implementation
On ARMv7 architecture we are compiling x86_64 unwind implementation which depends on libgcc_s implemenation. In particular _Unwind_GetIP call, which is exported by libgcc_s library for x86_84, but on ARMv7 _Unwind_GetIP is a macro. Macro depends on _Unwind_GetGR, which is not a public symbol in libgcc_s. Here we might be using private and not cross-platform solution for unwind. ``classlib'' is no more maintaind project. The patch adds guards for x86_64 specific implemention and it's not compiled on ARMv7 architecture anymore. Signed-off-by: David Abdurachmanov <davidlt@cern.ch>
- Loading branch information
David Abdurachmanov
committed
Aug 20, 2013
1 parent
043b706
commit 81c1bd0
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/src/utils/DebugAids.cpp b/src/utils/DebugAids.cpp | ||
index 894c8a0..f014b1b 100644 | ||
--- a/src/utils/DebugAids.cpp | ||
+++ b/src/utils/DebugAids.cpp | ||
@@ -83,7 +83,7 @@ GetLogicalAddress (PVOID addr, PTSTR name, DWORD length, | ||
} | ||
#endif | ||
|
||
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) // FIXME: Check | ||
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__) // FIXME: Check | ||
extern "C" { | ||
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); | ||
struct _Unwind_Context; | ||
@@ -168,7 +168,7 @@ unwindWalkStack (_Unwind_Context *ctx, void *data) | ||
writev (fd, bufs, nbufs); | ||
return _URC_NO_REASON; | ||
} | ||
-#endif // GCC 3.4+ | ||
+#endif // (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__) | ||
|
||
|
||
#if __hpux | ||
@@ -868,10 +868,10 @@ DebugAids::stacktrace (IOFD fd /* = IOFD_INVALID */) | ||
sprintf (buffer, PSTACK_COMMAND, (unsigned long) getpid (), fd); | ||
system (buffer); | ||
|
||
-#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) | ||
+#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__) | ||
// FIXME: Check for _Unwind*, compilers other than GCC support this API | ||
_Unwind_Backtrace (unwindWalkStack, &fd); | ||
-#endif | ||
+#endif // (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__) | ||
|
||
// FIXME: mpatrol has some generic unix unwind code. | ||
// FIXME: from unix faq: ask debugger to dump stack trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters