From c57ee43e00a218d005a139544b54d1063e3b818240a9ebd5e2f59fc7f2ea535a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sun, 24 Apr 2016 19:34:44 +0000 Subject: [PATCH] Accepting request 391464 from home:matwey:branches:devel:libraries:c_c++ Fix build for armv7l OBS-URL: https://build.opensuse.org/request/show/391464 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libunwind?expand=0&rev=26 --- ...mapper-and-run-ptrace-misc-as-XFAIL-.patch | 69 +++++++++++++++++++ ...mapper-and-run-ptrace-misc-as-XFAIL-.patch | 53 ++++++++++++++ libunwind.changes | 7 ++ libunwind.spec | 8 ++- 4 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch create mode 100644 0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch diff --git a/0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch b/0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch new file mode 100644 index 0000000..f5b6686 --- /dev/null +++ b/0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch @@ -0,0 +1,69 @@ +From c90a2e02b3c1b03362a549a05261a4d0513d6026 Mon Sep 17 00:00:00 2001 +From: Simon Atanasyan +Date: Tue, 21 Oct 2014 15:43:20 -0700 +Subject: [PATCH] Mark run-ptrace-mapper and run-ptrace-misc as XFAIL on MIPS + +Though PTRACE_SINGLESTEP is defined on MIPS Linux, the kernel does +not support that kind of request. The ptrace call failed and sets +errno to EIO and paused process is not resumed. In case of +run-ptrace-mapper and run-ptrace-misc this leads to hanged execution +because next call to wait4 never returns. + +This change adds run-ptrace-mapper and run-ptrace-misc to the list +of 'expected failed' tests on MIPS targets. + +Signed-off-by: Simon Atanasyan +--- + tests/Makefile.am | 9 ++++++++- + tests/test-ptrace.c | 12 ++++++++++-- + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 9c76628..9c62f92 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -94,9 +94,16 @@ check_SCRIPTS = $(check_SCRIPTS_common) $(check_SCRIPTS_cdep) \ + + + TESTS = $(check_PROGRAMS) $(check_SCRIPTS) ++XFAIL_TESTS = + + if !ARCH_IA64 +-XFAIL_TESTS = Gtest-dyn1 Ltest-dyn1 ++XFAIL_TESTS += Gtest-dyn1 Ltest-dyn1 ++endif ++ ++if ARCH_MIPS ++# MIPS kernel does not support PTRACE_SINGLESTEP ++# ptrace request used in the tests. ++XFAIL_TESTS += run-ptrace-mapper run-ptrace-misc + endif + + noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \ +diff --git a/tests/test-ptrace.c b/tests/test-ptrace.c +index 942b0db..a5b71dd 100644 +--- a/tests/test-ptrace.c ++++ b/tests/test-ptrace.c +@@ -303,9 +303,17 @@ main (int argc, char **argv) + { + do_backtrace (); + #if HAVE_DECL_PTRACE_SINGLESTEP +- ptrace (PTRACE_SINGLESTEP, target_pid, 0, pending_sig); ++ if (ptrace (PTRACE_SINGLESTEP, target_pid, 0, pending_sig) < 0) ++ { ++ panic ("ptrace(PTRACE_SINGLESTEP) failed (errno=%d)\n", errno); ++ killed = 1; ++ } + #elif HAVE_DECL_PT_STEP +- ptrace (PT_STEP, target_pid, (caddr_t)1, pending_sig); ++ if (ptrace (PT_STEP, target_pid, (caddr_t)1, pending_sig) < 0) ++ { ++ panic ("ptrace(PT_STEP) failed (errno=%d)\n", errno); ++ killed = 1; ++ } + #else + #error Singlestep me + #endif +-- +2.1.4 + diff --git a/0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch b/0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch new file mode 100644 index 0000000..700ea10 --- /dev/null +++ b/0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch @@ -0,0 +1,53 @@ +From 0bed10aa217157b287e036fba1e48ad2c6a3356e Mon Sep 17 00:00:00 2001 +From: Gregory Fong +Date: Wed, 18 Feb 2015 13:18:41 -0800 +Subject: [PATCH] Mark run-ptrace-mapper and run-ptrace-misc as XFAIL on ARM + +This is similar to commit c90a2e02b3c1b03362a549a05261a4d0513d6026 +"Mark run-ptrace-mapper and run-ptrace-misc as XFAIL on MIPS". +Starting with 2.6.39, ARM Linux returns -EIO for PTRACE_SINGLESTEP, so +we need to mark this as XFAIL for ARM too. + +The Linux commit that changed this is + + commit 425fc47adb5bb69f76285be77a09a3341a30799e + Author: Will Deacon + Date: Mon Feb 14 14:31:09 2011 +0100 + + ARM: 6668/1: ptrace: remove single-step emulation code + +see: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=425fc47adb5bb69f76285be77a09a3341a30799e + +Signed-off-by: Gregory Fong +--- + tests/Makefile.am | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 9c62f92..fe2dba8 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -100,10 +100,17 @@ if !ARCH_IA64 + XFAIL_TESTS += Gtest-dyn1 Ltest-dyn1 + endif + +-if ARCH_MIPS +-# MIPS kernel does not support PTRACE_SINGLESTEP ++# Use if arch defines but does not support PTRACE_SINGLESTEP + # ptrace request used in the tests. +-XFAIL_TESTS += run-ptrace-mapper run-ptrace-misc ++XFAIL_TESTS_PTRACE_SINGLESTEP = run-ptrace-mapper run-ptrace-misc ++ ++if ARCH_MIPS ++XFAIL_TESTS += $(XFAIL_TESTS_PTRACE_SINGLESTEP) ++endif ++ ++if ARCH_ARM ++# ARM Linux kernel >=2.6.39 removed PTRACE_SINGLESTEP emulation ++XFAIL_TESTS += $(XFAIL_TESTS_PTRACE_SINGLESTEP) + endif + + noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \ +-- +2.1.4 + diff --git a/libunwind.changes b/libunwind.changes index e25e403..f09c34f 100644 --- a/libunwind.changes +++ b/libunwind.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Apr 24 16:25:21 UTC 2016 - matwey.kornilov@gmail.com + +- Add patches for boo#976955: + * 0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch + * 0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch + ------------------------------------------------------------------- Thu Jul 2 12:47:57 UTC 2015 - tchvatal@suse.com diff --git a/libunwind.spec b/libunwind.spec index d416ce9..7ad3118 100644 --- a/libunwind.spec +++ b/libunwind.spec @@ -1,7 +1,7 @@ # # spec file for package libunwind # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -36,6 +36,10 @@ Patch2: libunwind-aarch64.patch Patch3: libunwind-ppc64le.patch # PATCH-FIX-UPSTREAM: bnc#936786 CVE-2015-3239 Patch4: libunwind-CVE-2015-3239.patch +# PATCH-FIX-UPSTREAM: boo#976955 +Patch5: 0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch +# PATCH-FIX-UPSTREAM: boo#976955 +Patch6: 0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -66,6 +70,8 @@ call-chain of a program. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build autoreconf -fvi