[dwarves/el5/master] Add new patch for build failure on RHEL5
Jon Stanley
jstanley at fedoraproject.org
Thu Mar 17 19:42:54 UTC 2011
commit 99960d6c05dddd2560521abe3675f4ffa5082c67
Author: Jon Stanley <jonstanley at gmail.com>
Date: Thu Mar 17 15:42:06 2011 -0400
Add new patch for build failure on RHEL5
dwarves-1.9-fix-build.patch | 118 +++++++++++++++++++++++++++++++++++++++++++
dwarves.spec | 8 +++-
2 files changed, 125 insertions(+), 1 deletions(-)
---
diff --git a/dwarves-1.9-fix-build.patch b/dwarves-1.9-fix-build.patch
new file mode 100644
index 0000000..debd750
--- /dev/null
+++ b/dwarves-1.9-fix-build.patch
@@ -0,0 +1,118 @@
+From 76f687bf49b7bdc13e520f3456827502c3988031 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme at redhat.com>
+Date: Thu, 17 Mar 2011 15:33:28 -0300
+Subject: [PATCH 1/1] dwarf_loader: Fix the build on older systems
+
+RHEL5 and Fedora 11 were not building due to the GNU attributes stuff,
+cope with that using a define we know is not present in both RHEL5 and
+Fedora 11 to #ifdef those parts. Ugly, but _ELFUTILS_PREREQ, i.e.
+elfutils/version.h is not present in RHEL5 either.
+
+Reported-by: Jon Stanley <jstanley at fedoraproject.org>
+Signed-off-by: Arnaldo Carvalho de Melo <acme at redhat.com>
+---
+ dutil.h | 8 ++++++++
+ dwarf_loader.c | 8 +++++++-
+ dwarves_fprintf.c | 20 ++++++++++++++++++--
+ 3 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/dutil.h b/dutil.h
+index af26cba..c6a1a79 100644
+--- a/dutil.h
++++ b/dutil.h
+@@ -72,4 +72,12 @@ void *zalloc(const size_t size);
+ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
+ GElf_Shdr *shp, const char *name, size_t *index);
+
++#ifndef SHT_GNU_ATTRIBUTES
++/* Just a way to check if we're using an old elfutils version */
++static inline int elf_getshdrstrndx(Elf *elf, size_t *dst)
++{
++ return elf_getshstrndx(elf, dst);
++}
++#endif
++
+ #endif /* _DUTIL_H_ */
+diff --git a/dwarf_loader.c b/dwarf_loader.c
+index 774cff2..9b4a500 100644
+--- a/dwarf_loader.c
++++ b/dwarf_loader.c
+@@ -38,9 +38,13 @@ struct strings *strings;
+
+ static void __tag__print_not_supported(uint32_t tag, const char *func)
+ {
+-
++#ifdef STB_GNU_UNIQUE
+ static bool dwarf_tags_warned[DW_TAG_rvalue_reference_type];
+ static bool dwarf_gnu_tags_warned[DW_TAG_GNU_formal_parameter_pack - DW_TAG_MIPS_loop];
++#else
++ static bool dwarf_tags_warned[DW_TAG_shared_type];
++ static bool dwarf_gnu_tags_warned[DW_TAG_class_template - DW_TAG_MIPS_loop];
++#endif
+
+ if (tag < DW_TAG_MIPS_loop) {
+ if (dwarf_tags_warned[tag])
+@@ -1201,8 +1205,10 @@ static int die__process_class(Dwarf_Die *die, struct type *class,
+ {
+ do {
+ switch (dwarf_tag(die)) {
++#ifdef STB_GNU_UNIQUE
+ case DW_TAG_GNU_template_template_param:
+ case DW_TAG_GNU_template_parameter_pack:
++#endif
+ case DW_TAG_template_type_parameter:
+ case DW_TAG_template_value_parameter:
+ /* FIXME: probably we'll have to attach this as a list of
+diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c
+index 498bf30..a64d916 100644
+--- a/dwarves_fprintf.c
++++ b/dwarves_fprintf.c
+@@ -77,8 +77,10 @@ static const char *dwarf_tag_names[] = {
+ [DW_TAG_mutable_type] = "mutable_type",
+ [DW_TAG_condition] = "condition",
+ [DW_TAG_shared_type] = "shared_type",
++#ifdef STB_GNU_UNIQUE
+ [DW_TAG_type_unit] = "type_unit",
+ [DW_TAG_rvalue_reference_type] = "rvalue_reference_type",
++#endif
+ };
+
+ static const char *dwarf_gnu_tag_names[] = {
+@@ -86,18 +88,32 @@ static const char *dwarf_gnu_tag_names[] = {
+ [DW_TAG_format_label - DW_TAG_MIPS_loop] = "format_label",
+ [DW_TAG_function_template - DW_TAG_MIPS_loop] = "function_template",
+ [DW_TAG_class_template - DW_TAG_MIPS_loop] = "class_template",
++#ifdef STB_GNU_UNIQUE
+ [DW_TAG_GNU_BINCL - DW_TAG_MIPS_loop] = "BINCL",
+ [DW_TAG_GNU_EINCL - DW_TAG_MIPS_loop] = "EINCL",
+ [DW_TAG_GNU_template_template_param - DW_TAG_MIPS_loop] = "template_template_param",
+ [DW_TAG_GNU_template_parameter_pack - DW_TAG_MIPS_loop] = "template_parameter_pack",
+ [DW_TAG_GNU_formal_parameter_pack - DW_TAG_MIPS_loop] = "formal_parameter_pack",
++#endif
+ };
+
+ const char *dwarf_tag_name(const uint32_t tag)
+ {
+- if (tag >= DW_TAG_array_type && tag <= DW_TAG_rvalue_reference_type)
++ if (tag >= DW_TAG_array_type && tag <=
++#ifdef STB_GNU_UNIQUE
++ DW_TAG_rvalue_reference_type
++#else
++ DW_TAG_shared_type
++#endif
++ )
+ return dwarf_tag_names[tag];
+- else if (tag >= DW_TAG_MIPS_loop && tag <= DW_TAG_GNU_formal_parameter_pack)
++ else if (tag >= DW_TAG_MIPS_loop && tag <=
++#ifdef STB_GNU_UNIQUE
++ DW_TAG_GNU_formal_parameter_pack
++#else
++ DW_TAG_class_template
++#endif
++ )
+ return dwarf_gnu_tag_names[tag - DW_TAG_MIPS_loop];
+ return "INVALID";
+ }
+--
+1.6.2.5
+
diff --git a/dwarves.spec b/dwarves.spec
index 99f5ed1..468349d 100644
--- a/dwarves.spec
+++ b/dwarves.spec
@@ -3,12 +3,13 @@
Name: dwarves
Version: 1.9
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Summary: Debugging Information Manipulation Tools
Group: Development/Tools
URL: http://oops.ghostprotocols.net:81/blog
Source0: http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.bz2
+Patch0: dwarves-1.9-fix-build.patch
BuildRequires: cmake
BuildRequires: zlib-devel
BuildRequires: elfutils-devel >= 0.130
@@ -49,6 +50,7 @@ Debugging information processing library development files.
%prep
%setup -q -c -n %{name}-%{version}
+%patch0 -p1 -b .loader_build
%build
%cmake .
@@ -78,6 +80,7 @@ rm -rf %{buildroot}
%{_bindir}/pfunct
%{_bindir}/pglobal
%{_bindir}/prefcnt
+%{_bindir}/scncopy
%{_bindir}/syscse
%{_bindir}/ostra-cg
%dir %{_datadir}/dwarves/
@@ -113,6 +116,9 @@ rm -rf %{buildroot}
%{_libdir}/%{libname}_reorganize.so
%changelog
+* Tue Mar 17 2011 Jon Stanley <jonstanley at gmail.com> - 1.9-2
+- Fix build failure on RHEL5
+
* Mon Feb 28 2011 Jon Stanley <jonstanley at gmail.com> - 1.9-1
- New upstream release
More information about the scm-commits
mailing list