gperftools/ppc64-fix-367fd5731a8c68225cb870aa656ea0ce677fe040.patch
Dirk Mueller 39fe45417f Accepting request 682171 from home:marxin:branches:devel:libraries:c_c++
- Add ppc64-fix-367fd5731a8c68225cb870aa656ea0ce677fe040.patch
  in order to address power targets.
- Update to version 2.7:
  * bug in span stats printing introduced by new scalable page heap
    change was fixed.
  * Christoph Müllner has contributed couple warnings fixes and
    initial support for aarch64_ilp32 architecture.
  * Ben Dang contributed documentation fix for heap checker.
  * Fabrice Fontaine contributed fixed for linking benchmarks
    with --disable-static.
  * Holy Wu has added sized deallocation unit tests.
  * Holy Wu has enabled support of sized deallocation (c++14)
    on recent MSVC.
  * Holy Wu has fixed MSVC build in WIN32_OVERRIDE_ALLOCATORS
    mode. This closed issue #716.
  * Holy Wu has contributed cleanup of config.h used on windows.
  * Mao Huang has contributed couple simple tcmalloc changes from
    chromium code base. Making our tcmalloc forks a tiny bit closer.
  * issue #946 that caused compilation failures on some Linux
    clang installations has been fixed. Much thanks to github
    user htuch for helping to diagnose issue and proposing a fix.
  * Tulio Magno Quites Machado Filho has contributed build-time
    fix for PPC (for problem introduced in one of commits
    since RC).
- Add gcc-dont-clobber-rsp.patch (bsc#1121265).
- Remove ucontext.patch, gperftools-s390.patch
  and gperftools-aarch64.patch patches.

OBS-URL: https://build.opensuse.org/request/show/682171
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/gperftools?expand=0&rev=46
2019-03-10 16:30:14 +00:00

70 lines
3.2 KiB
Diff

From 367fd5731a8c68225cb870aa656ea0ce677fe040 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date: Fri, 8 Feb 2019 10:33:09 -0200
Subject: [PATCH] Include asm/ptrace.h when accessing ucontext_t
In some architectures (e.g. powerpc, powerpc64 and powerpc64le), the
macro that specifies the position of the program counter is defined in
header asm/ptrace.h.
When glibc bug 21457 got fixed in version 2.27, header sys/ucontext.h
stopped including signal.h, which indirectly removed asm/ptrace.h too.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
m4/pc_from_ucontext.m4 | 12 +++++++++++-
src/getpc.h | 3 +++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/m4/pc_from_ucontext.m4 b/m4/pc_from_ucontext.m4
index c9224bc6..7114bd0d 100644
--- a/m4/pc_from_ucontext.m4
+++ b/m4/pc_from_ucontext.m4
@@ -20,6 +20,7 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
AC_CHECK_HEADERS(sys/ucontext.h) # ucontext on OS X 10.6 (at least)
fi
AC_CHECK_HEADERS(cygwin/signal.h) # ucontext on cywgin
+ AC_CHECK_HEADERS(asm/ptrace.h) # get ptrace macros, e.g. PT_NIP
AC_MSG_CHECKING([how to access the program counter from a struct ucontext])
pc_fields=" uc_mcontext.gregs[[REG_PC]]" # Solaris x86 (32 + 64 bit)
pc_fields="$pc_fields uc_mcontext.gregs[[REG_EIP]]" # Linux (i386)
@@ -53,14 +54,23 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
How to access the PC from a struct ucontext)
AC_MSG_RESULT([$pc_field])
pc_field_found=true)
- elif test "x$ac_cv_header_sys_ucontext_h" = xyes; then
+ elif test "x$ac_cv_header_asm_ptrace_h" = xyes -a "x$ac_cv_header_sys_ucontext_h" = xyes; then
AC_TRY_COMPILE([#define _GNU_SOURCE 1
+ #include <asm/ptrace.h>
#include <sys/ucontext.h>],
[ucontext_t u; return u.$pc_field == 0;],
AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field,
How to access the PC from a struct ucontext)
AC_MSG_RESULT([$pc_field])
pc_field_found=true)
+ elif test "x$ac_cv_header_sys_ucontext_h" = xyes; then
+ AC_TRY_COMPILE([#define _GNU_SOURCE 1
+ #include <sys/ucontext.h>],
+ [ucontext_t u; return u.$pc_field == 0;],
+ AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field,
+ How to access the PC from a struct ucontext)
+ AC_MSG_RESULT([$pc_field])
+ pc_field_found=true)
elif test "x$ac_cv_header_ucontext_h" = xyes; then
AC_TRY_COMPILE([#define _GNU_SOURCE 1
#include <ucontext.h>],
diff --git a/src/getpc.h b/src/getpc.h
index 163873ea..9605363b 100644
--- a/src/getpc.h
+++ b/src/getpc.h
@@ -56,6 +56,9 @@
//#define _XOPEN_SOURCE 500
#include <string.h> // for memcmp
+#ifdef HAVE_ASM_PTRACE_H
+#include <asm/ptrace.h>
+#endif
#if defined(HAVE_SYS_UCONTEXT_H)
#include <sys/ucontext.h>
#elif defined(HAVE_UCONTEXT_H)