Skip to content

Commit

Permalink
classlib: add guards for x86_64 unwind implementation
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions classlib-3.1.3-fix-unwind-x86_64.patch
@@ -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
2 changes: 2 additions & 0 deletions classlib.spec
Expand Up @@ -4,6 +4,7 @@ Source: http://cmsrep.cern.ch/cmssw/cms/SOURCES/slc5_amd64_gcc472/external/class
Patch0: classlib-3.1.3-gcc46
Patch1: classlib-3.1.3-sl6
Patch2: classlib-3.1.3-fix-gcc47-cxx11
Patch3: classlib-3.1.3-fix-unwind-x86_64

Requires: bz2lib
Requires: pcre
Expand All @@ -28,6 +29,7 @@ Requires: onlinesystemtools
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
./configure --prefix=%i \
Expand Down

0 comments on commit 81c1bd0

Please sign in to comment.