Fix sdt.h to avoid warning on arm arches.

This commit is contained in:
William Cohen 2011-07-15 15:07:33 -04:00
parent 8ae282f493
commit 6f48688609
2 changed files with 38 additions and 1 deletions

30
systemtap-sdt.patch Normal file
View File

@ -0,0 +1,30 @@
From c02332052959e4213a59ce0ff40354f51506103a Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 6 Jul 2011 23:07:51 +0200
Subject: [PATCH] Silence sys/sdt.h comparison of unsigned expression < 0 is always false.
Some arm g++ setups would complain about the wchar_t "signedness detection":
sys/sdt.h:102: error: comparison of unsigned expression < 0 is always false
jistone said: "((T)(-1) < 1)" would still get the right boolean value,
and shouldn't trigger range errors like "unsigned is never < 0".
---
includes/sys/sdt.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
index f7e1360..0a9fd40 100644
--- a/includes/sys/sdt.h
+++ b/includes/sys/sdt.h
@@ -77,7 +77,7 @@ struct __sdt_type
#define __SDT_ALWAYS_SIGNED(T) \
template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
#define __SDT_COND_SIGNED(T) \
-template<> struct __sdt_type<T> { static const bool __sdt_signed = ((T)(-1) < 0); };
+template<> struct __sdt_type<T> { static const bool __sdt_signed = ((T)(-1) < 1); };
__SDT_ALWAYS_SIGNED(signed char)
__SDT_ALWAYS_SIGNED(short)
__SDT_ALWAYS_SIGNED(int)
--
1.7.3.4

View File

@ -16,7 +16,7 @@
Name: systemtap Name: systemtap
Version: 1.5 Version: 1.5
Release: 6%{?dist} Release: 7%{?dist}
# for version, see also configure.ac # for version, see also configure.ac
Summary: Instrumentation System Summary: Instrumentation System
Group: Development/System Group: Development/System
@ -24,6 +24,8 @@ License: GPLv2+
URL: http://sourceware.org/systemtap/ URL: http://sourceware.org/systemtap/
Source: ftp://sourceware.org/pub/%{name}/releases/%{name}-%{version}.tar.gz Source: ftp://sourceware.org/pub/%{name}/releases/%{name}-%{version}.tar.gz
Patch25: systemtap-sdt.patch
Obsoletes: systemtap-client < 1.5 Obsoletes: systemtap-client < 1.5
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -189,6 +191,8 @@ cd ..
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch25 -p1
%build %build
%if %{with_bundled_elfutils} %if %{with_bundled_elfutils}
@ -504,6 +508,9 @@ exit 0
%changelog %changelog
* Fri Jul 15 2011 William Cohen <wcohen@redhat.com> - 1.5-7
- Fix sdt.h to avoid warning on arm arches.
* Mon Jul 11 2011 William Cohen <wcohen@redhat.com> - 1.5-6 * Mon Jul 11 2011 William Cohen <wcohen@redhat.com> - 1.5-6
- there is no crash available on arm arches - there is no crash available on arm arches