From 81c1bd03c07d2ed245966104dbe7681291196b44 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Tue, 20 Aug 2013 23:29:42 +0200 Subject: [PATCH] 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 --- classlib-3.1.3-fix-unwind-x86_64.patch | 35 ++++++++++++++++++++++++++ classlib.spec | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 classlib-3.1.3-fix-unwind-x86_64.patch diff --git a/classlib-3.1.3-fix-unwind-x86_64.patch b/classlib-3.1.3-fix-unwind-x86_64.patch new file mode 100644 index 00000000000..36f1ee7a77e --- /dev/null +++ b/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 diff --git a/classlib.spec b/classlib.spec index 1881ed2ea52..c3c24108ca2 100644 --- a/classlib.spec +++ b/classlib.spec @@ -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 @@ -28,6 +29,7 @@ Requires: onlinesystemtools %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build ./configure --prefix=%i \