Work around build issues

- 0001-noinline.patch adds __attribute__((noinline) in fstack_call to
  address LTO optimisations on s390x;
- 0002-ipc-xfail.patch marks ipc_msg/ipc_shm tests as XFAIL due to glibc
  bug.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2020-10-06 20:17:14 +02:00
parent 9831aa9ea1
commit 8300939a78
3 changed files with 261 additions and 1 deletions

52
0001-noinline.patch Normal file
View File

@ -0,0 +1,52 @@
Index: strace-5.9/tests/stack-fcall-0.c
===================================================================
--- strace-5.9.orig/tests/stack-fcall-0.c 2020-08-03 10:00:00.000000000 +0200
+++ strace-5.9/tests/stack-fcall-0.c 2020-10-06 11:12:07.163673799 +0200
@@ -7,7 +7,7 @@
#include "stack-fcall.h"
-int
+int __attribute__ ((noinline))
f0(int i, unsigned long f)
{
f ^= (unsigned long) (void *) f0;
Index: strace-5.9/tests/stack-fcall-1.c
===================================================================
--- strace-5.9.orig/tests/stack-fcall-1.c 2020-08-03 10:00:00.000000000 +0200
+++ strace-5.9/tests/stack-fcall-1.c 2020-10-06 11:12:15.875605255 +0200
@@ -7,7 +7,7 @@
#include "stack-fcall.h"
-int
+int __attribute__ ((noinline))
f1(int i, unsigned long f)
{
f ^= (unsigned long) (void *) f1;
Index: strace-5.9/tests/stack-fcall-2.c
===================================================================
--- strace-5.9.orig/tests/stack-fcall-2.c 2020-08-03 10:00:00.000000000 +0200
+++ strace-5.9/tests/stack-fcall-2.c 2020-10-06 11:12:22.700551557 +0200
@@ -7,7 +7,7 @@
#include "stack-fcall.h"
-int
+int __attribute__ ((noinline))
f2(int i, unsigned long f)
{
f ^= (unsigned long) (void *) f2;
Index: strace-5.9/tests/stack-fcall-3.c
===================================================================
--- strace-5.9.orig/tests/stack-fcall-3.c 2020-08-03 10:00:00.000000000 +0200
+++ strace-5.9/tests/stack-fcall-3.c 2020-10-06 11:12:32.556474012 +0200
@@ -8,7 +8,7 @@
#include <signal.h>
#include "stack-fcall.h"
-int
+int __attribute__ ((noinline))
f3(int i, unsigned long f)
{
f ^= (unsigned long) (void *) f3;

204
0002-ipc-xfail.patch Normal file
View File

@ -0,0 +1,204 @@
Index: strace-5.9/configure
===================================================================
--- strace-5.9.orig/configure 2020-09-24 11:18:58.000000000 +0200
+++ strace-5.9/configure 2020-10-06 19:49:07.708680050 +0200
@@ -678,6 +678,8 @@
clock_LIBS
timer_LIBS
dl_LIBS
+KERNEL_LONG_T_32_BIT_FALSE
+KERNEL_LONG_T_32_BIT_TRUE
SIZEOF_KERNEL_LONG_T
SIZEOF_LONG
ac_ct_AR
@@ -21947,6 +21949,14 @@
SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
+ if test x$SIZEOF_KERNEL_LONG_T == x4; then
+ KERNEL_LONG_T_32_BIT_TRUE=
+ KERNEL_LONG_T_32_BIT_FALSE='#'
+else
+ KERNEL_LONG_T_32_BIT_TRUE='#'
+ KERNEL_LONG_T_32_BIT_FALSE=
+fi
+
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -25039,6 +25049,10 @@
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${KERNEL_LONG_T_32_BIT_TRUE}" && test -z "${KERNEL_LONG_T_32_BIT_FALSE}"; then
+ as_fn_error $? "conditional \"KERNEL_LONG_T_32_BIT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ENABLE_STACKTRACE_TRUE}" && test -z "${ENABLE_STACKTRACE_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_STACKTRACE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Index: strace-5.9/tests-m32/Makefile.in
===================================================================
--- strace-5.9.orig/tests-m32/Makefile.in 2020-10-06 09:48:41.416722064 +0200
+++ strace-5.9/tests-m32/Makefile.in 2020-10-06 19:50:09.695155401 +0200
@@ -222,6 +222,8 @@
xet_robust_list--pidns-translation$(EXEEXT) zeroargc$(EXEEXT)
@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test
TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_2)
+XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) \
+ $(am__EXEEXT_3)
subdir = tests-m32
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/xlat/btrfs_compress_types.m4 \
@@ -5298,6 +5300,14 @@
AM_RECURSIVE_TARGETS = check recheck
@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test strace-k-p.test \
@ENABLE_STACKTRACE_TRUE@ $(am__append_1)
+@KERNEL_LONG_T_32_BIT_TRUE@am__EXEEXT_3 = ipc_msg.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xverbose.gen.test
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
am__test_logs1 = $(TESTS:=.log)
@@ -6780,10 +6790,25 @@
umovestr_cached.test \
# end of MISC_TESTS
+@KERNEL_LONG_T_32_BIT_FALSE@IPC_XFAIL =
+
+# Workaround for broken glibc
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26636
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26639
+@KERNEL_LONG_T_32_BIT_TRUE@IPC_XFAIL = \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ # end of IPC_XFAIL
+
XFAIL_TESTS_ =
XFAIL_TESTS_m32 = $(STACKTRACE_TESTS)
XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS)
-XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
TEST_LOG_COMPILER = env
AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \
SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \
Index: strace-5.9/tests-mx32/Makefile.in
===================================================================
--- strace-5.9.orig/tests-mx32/Makefile.in 2020-10-06 09:48:47.323672772 +0200
+++ strace-5.9/tests-mx32/Makefile.in 2020-10-06 19:50:43.044873131 +0200
@@ -222,6 +222,8 @@
xet_robust_list--pidns-translation$(EXEEXT) zeroargc$(EXEEXT)
@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test
TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_2)
+XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) \
+ $(am__EXEEXT_3)
subdir = tests-mx32
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/xlat/btrfs_compress_types.m4 \
@@ -5298,6 +5300,14 @@
AM_RECURSIVE_TARGETS = check recheck
@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test strace-k-p.test \
@ENABLE_STACKTRACE_TRUE@ $(am__append_1)
+@KERNEL_LONG_T_32_BIT_TRUE@am__EXEEXT_3 = ipc_msg.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xverbose.gen.test
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
am__test_logs1 = $(TESTS:=.log)
@@ -6780,10 +6790,25 @@
umovestr_cached.test \
# end of MISC_TESTS
+@KERNEL_LONG_T_32_BIT_FALSE@IPC_XFAIL =
+
+# Workaround for broken glibc
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26636
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26639
+@KERNEL_LONG_T_32_BIT_TRUE@IPC_XFAIL = \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ # end of IPC_XFAIL
+
XFAIL_TESTS_ =
XFAIL_TESTS_m32 = $(STACKTRACE_TESTS)
XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS)
-XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
TEST_LOG_COMPILER = env
AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \
SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \
Index: strace-5.9/tests/Makefile.in
===================================================================
--- strace-5.9.orig/tests/Makefile.in 2020-10-06 09:47:53.610143253 +0200
+++ strace-5.9/tests/Makefile.in 2020-10-06 19:49:25.669528031 +0200
@@ -222,6 +222,8 @@
xet_robust_list--pidns-translation$(EXEEXT) zeroargc$(EXEEXT)
@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test
TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_2)
+XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) \
+ $(am__EXEEXT_3)
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/xlat/btrfs_compress_types.m4 \
@@ -5298,6 +5300,14 @@
AM_RECURSIVE_TARGETS = check recheck
@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test strace-k-p.test \
@ENABLE_STACKTRACE_TRUE@ $(am__append_1)
+@KERNEL_LONG_T_32_BIT_TRUE@am__EXEEXT_3 = ipc_msg.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xverbose.gen.test
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
am__test_logs1 = $(TESTS:=.log)
@@ -6780,10 +6790,25 @@
umovestr_cached.test \
# end of MISC_TESTS
+@KERNEL_LONG_T_32_BIT_FALSE@IPC_XFAIL =
+
+# Workaround for broken glibc
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26636
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26639
+@KERNEL_LONG_T_32_BIT_TRUE@IPC_XFAIL = \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_msg-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xabbrev.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xraw.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ ipc_shm-Xverbose.gen.test \
+@KERNEL_LONG_T_32_BIT_TRUE@ # end of IPC_XFAIL
+
XFAIL_TESTS_ =
XFAIL_TESTS_m32 = $(STACKTRACE_TESTS)
XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS)
-XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
TEST_LOG_COMPILER = env
AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \
SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \

View File

@ -14,11 +14,13 @@ Group: Development%{?suse_version:/Tools}/Debuggers
URL: https://strace.io
%if 0%{?fedora} >= 12 || 0%{?centos} >= 6 || 0%{?rhel} >= 6 || 0%{?suse_version} >= 1200
Source: https://strace.io/files/%{version}/strace-%{version}.tar.xz
Patch0: gcc-11.patch
Patch1: 0001-noinline.patch
Patch2: 0002-ipc-xfail.patch
BuildRequires: xz
%else
Source: strace-%{version}.tar.gz
%endif
Patch0: gcc-11.patch
BuildRequires: gcc gzip
# Install Bluetooth headers for AF_BLUETOOTH sockets decoding.
@ -59,6 +61,8 @@ received by a process.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
echo -n %version-%release > .tarball-version
echo -n 2020 > .year
echo -n 2020-09-23 > .strace.1.in.date