From d745e52e60b84767b27c530a3ba0ce51efd3fc65 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sun, 9 Aug 2009 12:26:35 +0000 Subject: [PATCH] - Fix reading of dwarf 3 DW_AT_data_member_location - Use proper compiler flags --- crash-4.0-8.11-dwarf3.patch | 203 ++++++++++++++++++++++++++++++ crash-4.0-8.11-optflags.patch | 225 ++++++++++++++++++++++++++++++++++ crash.spec | 12 +- 3 files changed, 438 insertions(+), 2 deletions(-) create mode 100644 crash-4.0-8.11-dwarf3.patch create mode 100644 crash-4.0-8.11-optflags.patch diff --git a/crash-4.0-8.11-dwarf3.patch b/crash-4.0-8.11-dwarf3.patch new file mode 100644 index 0000000..193fdcc --- /dev/null +++ b/crash-4.0-8.11-dwarf3.patch @@ -0,0 +1,203 @@ +commit 4809b16f7e629929a10ab8b15816b4f6f775aa82 +Author: Jim Blandy +Date: Thu Dec 13 19:02:51 2007 +0000 + +commit 35fb264aa9a28b8d117df1e5a19fa3bfaf5a2cc8 +Author: Jim Blandy +Date: Mon Dec 17 18:38:30 2007 +0000 + +Cherry-picked and backported these, since gdb would crash reading dwarf 3 +DW_AT_data_member_location that gcc generates now. +-- Lubomir Rintel + +diff -urp gdb-6.1.orig/gdb/ChangeLog gdb-6.1/gdb/ChangeLog +--- gdb-6.1.orig/gdb/ChangeLog 2009-08-08 17:04:24.836969960 +0200 ++++ gdb-6.1/gdb/ChangeLog 2009-08-08 17:00:21.682970174 +0200 +@@ -1,3 +1,14 @@ ++2007-12-13 Jim Blandy ++ ++ * dwarf2read.c (attr_form_is_constant): New function. ++ (dwarf2_add_field): Use it and attr_form_is_section_offset to ++ recognize DW_AT_data_member_location attributes. Use ++ dwarf2_get_attr_constant_value when the attribute is a constant. ++ ++ * dwarf2read.c (attr_form_is_section_offset): New function. ++ (dwarf_add_member_fn, read_common_block, read_partial_die) ++ (dwarf2_symbol_mark_computed): Use it, instead of writing it out. ++ + 2004-04-03 GDB Administrator + + GDB 6.1 released. +diff -urp gdb-6.1.orig/gdb/dwarf2read.c gdb-6.1/gdb/dwarf2read.c +--- gdb-6.1.orig/gdb/dwarf2read.c 2009-06-30 17:31:20.000000000 +0200 ++++ gdb-6.1/gdb/dwarf2read.c 2009-08-08 17:20:00.031969143 +0200 +@@ -922,6 +922,10 @@ static void dwarf_decode_macros (struct + + static int attr_form_is_block (struct attribute *); + ++static int attr_form_is_section_offset (struct attribute *); ++ ++static int attr_form_is_constant (struct attribute *); ++ + static void + dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, + struct dwarf2_cu *cu); +@@ -2618,8 +2622,16 @@ dwarf2_add_field (struct field_info *fip + attr = dwarf2_attr (die, DW_AT_data_member_location, cu); + if (attr) + { +- FIELD_BITPOS (*fp) = +- decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte; ++ if (attr_form_is_section_offset (attr)) ++ { ++ dwarf2_complex_location_expr_complaint (); ++ FIELD_BITPOS (*fp) = 0; ++ } ++ else if (attr_form_is_constant (attr)) ++ FIELD_BITPOS (*fp) = dwarf2_get_attr_constant_value (attr, 0); ++ else ++ FIELD_BITPOS (*fp) = ++ decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte; + } + else + FIELD_BITPOS (*fp) = 0; +@@ -2939,7 +2951,7 @@ dwarf2_add_member_fn (struct field_info + { + fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu) + 2; + } +- else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) ++ else if (attr_form_is_section_offset (attr)) + { + dwarf2_complex_location_expr_complaint (); + } +@@ -3482,7 +3494,7 @@ read_common_block (struct die_info *die, + { + base = decode_locdesc (DW_BLOCK (attr), cu); + } +- else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) ++ else if (attr_form_is_section_offset (attr)) + { + dwarf2_complex_location_expr_complaint (); + } +@@ -4392,7 +4404,7 @@ read_partial_die (struct partial_die_inf + { + part_die->locdesc = DW_BLOCK (&attr); + } +- else if (attr.form == DW_FORM_data4 || attr.form == DW_FORM_data8) ++ else if (attr_form_is_section_offset (&attr)) + { + dwarf2_complex_location_expr_complaint (); + } +@@ -8030,11 +8042,51 @@ attr_form_is_block (struct attribute *at + || attr->form == DW_FORM_block); + } + ++/* Return non-zero if ATTR's value is a section offset (classes ++ lineptr, loclistptr, macptr or rangelistptr). In this case, ++ you may use DW_UNSND (attr) to retrieve the offset. */ ++static int ++attr_form_is_section_offset (struct attribute *attr) ++{ ++ return (attr->form == DW_FORM_data4 ++ || attr->form == DW_FORM_data8); ++} ++ ++ ++/* Return non-zero if ATTR's value falls in the 'constant' class, or ++ zero otherwise. When this function returns true, you can apply ++ dwarf2_get_attr_constant_value to it. ++ ++ However, note that for some attributes you must check ++ attr_form_is_section_offset before using this test. DW_FORM_data4 ++ and DW_FORM_data8 are members of both the constant class, and of ++ the classes that contain offsets into other debug sections ++ (lineptr, loclistptr, macptr or rangelistptr). The DWARF spec says ++ that, if an attribute's can be either a constant or one of the ++ section offset classes, DW_FORM_data4 and DW_FORM_data8 should be ++ taken as section offsets, not constants. */ ++static int ++attr_form_is_constant (struct attribute *attr) ++{ ++ switch (attr->form) ++ { ++ case DW_FORM_sdata: ++ case DW_FORM_udata: ++ case DW_FORM_data1: ++ case DW_FORM_data2: ++ case DW_FORM_data4: ++ case DW_FORM_data8: ++ return 1; ++ default: ++ return 0; ++ } ++} ++ + static void + dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, + struct dwarf2_cu *cu) + { +- if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) ++ if (attr_form_is_section_offset (attr)) + { + struct dwarf2_loclist_baton *baton; + +diff -urp gdb-6.1.orig/gdb/ChangeLog gdb-6.1/gdb/ChangeLog +--- gdb-6.1.orig/gdb/ChangeLog 2009-08-08 20:49:34.000000000 +0200 ++++ gdb-6.1/gdb/ChangeLog 2009-08-09 13:04:25.842288308 +0200 +@@ -1,3 +1,11 @@ ++2007-12-17 Jim Blandy ++ ++ * dwarf2read.c (dwarf2_add_field): Correctly scale all byte ++ offsets obtained from DW_AT_data_member_location before recording ++ them in FIELD_BITPOS (*fp). ++ ++ * dwarf2read.c (attr_form_is_section_offset): Doc fixes. ++ + 2007-12-13 Jim Blandy + + * dwarf2read.c (attr_form_is_constant): New function. +diff -urp gdb-6.1.orig/gdb/dwarf2read.c gdb-6.1/gdb/dwarf2read.c +--- gdb-6.1.orig/gdb/dwarf2read.c 2009-08-08 20:49:34.000000000 +0200 ++++ gdb-6.1/gdb/dwarf2read.c 2009-08-09 13:04:25.864291129 +0200 +@@ -2622,16 +2622,19 @@ dwarf2_add_field (struct field_info *fip + attr = dwarf2_attr (die, DW_AT_data_member_location, cu); + if (attr) + { ++ int byte_offset; ++ + if (attr_form_is_section_offset (attr)) + { + dwarf2_complex_location_expr_complaint (); +- FIELD_BITPOS (*fp) = 0; ++ byte_offset = 0; + } + else if (attr_form_is_constant (attr)) +- FIELD_BITPOS (*fp) = dwarf2_get_attr_constant_value (attr, 0); ++ byte_offset = dwarf2_get_attr_constant_value (attr, 0); + else +- FIELD_BITPOS (*fp) = +- decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte; ++ byte_offset = decode_locdesc (DW_BLOCK (attr), cu); ++ ++ FIELD_BITPOS (*fp) = byte_offset * bits_per_byte; + } + else + FIELD_BITPOS (*fp) = 0; +@@ -8042,9 +8045,14 @@ attr_form_is_block (struct attribute *at + || attr->form == DW_FORM_block); + } + +-/* Return non-zero if ATTR's value is a section offset (classes +- lineptr, loclistptr, macptr or rangelistptr). In this case, +- you may use DW_UNSND (attr) to retrieve the offset. */ ++/* Return non-zero if ATTR's value is a section offset --- classes ++ lineptr, loclistptr, macptr or rangelistptr --- or zero, otherwise. ++ You may use DW_UNSND (attr) to retrieve such offsets. ++ ++ Section 7.5.4, "Attribute Encodings", explains that no attribute ++ may have a value that belongs to more than one of these classes; it ++ would be ambiguous if we did, because we use the same forms for all ++ of them. */ + static int + attr_form_is_section_offset (struct attribute *attr) + { diff --git a/crash-4.0-8.11-optflags.patch b/crash-4.0-8.11-optflags.patch new file mode 100644 index 0000000..0c5447d --- /dev/null +++ b/crash-4.0-8.11-optflags.patch @@ -0,0 +1,225 @@ +Use proper compiler flags as mandated by the packaging guidelines. + +Lubomir Rintel + +diff -up crash-4.0-8.11/Makefile.optflags crash-4.0-8.11/Makefile +--- crash-4.0-8.11/Makefile.optflags 2009-06-30 17:31:20.000000000 +0200 ++++ crash-4.0-8.11/Makefile 2009-08-09 13:21:51.025292368 +0200 +@@ -224,7 +224,7 @@ GDB_FLAGS= + # TARGET_CFLAGS will be configured automatically by configure + TARGET_CFLAGS= + +-CFLAGS=-g -D${TARGET} ${TARGET_CFLAGS} ++CRASH_CFLAGS=${CFLAGS} -D${TARGET} ${TARGET_CFLAGS} + + TAR_FILES=${SOURCE_FILES} Makefile COPYING README .rh_rpm_package crash.8 \ + ${EXTENSION_SOURCE_FILES} +@@ -287,7 +287,7 @@ clean: + @(cd extensions; make --no-print-directory -i clean) + + make_build_data: force +- cc -c ${CFLAGS} build_data.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} build_data.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + install: + /usr/bin/install ${PROGRAM} ${INSTALLDIR} +@@ -309,150 +309,150 @@ nowarn: make_configure + @make --no-print-directory gdb_merge + + main.o: ${GENERIC_HFILES} main.c +- cc -c ${CFLAGS} main.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} main.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + cmdline.o: ${GENERIC_HFILES} cmdline.c +- cc -c ${CFLAGS} ${GDB_FLAGS} cmdline.c -I${READLINE_DIRECTORY} ${WARNING_OPTIONS} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} cmdline.c -I${READLINE_DIRECTORY} ${WARNING_OPTIONS} + + tools.o: ${GENERIC_HFILES} tools.c +- cc -c ${CFLAGS} tools.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} tools.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + global_data.o: ${GENERIC_HFILES} global_data.c +- cc -c ${CFLAGS} global_data.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} global_data.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + symbols.o: ${GENERIC_HFILES} symbols.c +- cc -c ${CFLAGS} ${GDB_FLAGS} symbols.c -I${BFD_DIRECTORY} -I${GDB_INCLUDE_DIRECTORY} ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} symbols.c -I${BFD_DIRECTORY} -I${GDB_INCLUDE_DIRECTORY} ${WARNING_OPTIONS} ${WARNING_ERROR} + + filesys.o: ${GENERIC_HFILES} filesys.c +- cc -c ${CFLAGS} filesys.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} filesys.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + help.o: ${GENERIC_HFILES} help.c +- cc -c ${CFLAGS} ${GDB_FLAGS} help.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} help.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + memory.o: ${GENERIC_HFILES} memory.c +- cc -c ${CFLAGS} memory.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} memory.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + test.o: ${GENERIC_HFILES} test.c +- cc -c ${CFLAGS} test.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} test.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + task.o: ${GENERIC_HFILES} task.c +- cc -c ${CFLAGS} ${GDB_FLAGS} task.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} task.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + kernel.o: ${GENERIC_HFILES} kernel.c +- cc -c ${CFLAGS} ${GDB_FLAGS} kernel.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} kernel.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + gdb_interface.o: ${GENERIC_HFILES} gdb_interface.c +- cc -c ${CFLAGS} ${GDB_FLAGS} gdb_interface.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} gdb_interface.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + va_server.o: ${MCORE_HFILES} va_server.c +- cc -c ${CFLAGS} va_server.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} va_server.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + va_server_v1.o: ${MCORE_HFILES} va_server_v1.c +- cc -c ${CFLAGS} va_server_v1.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} va_server_v1.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_common.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_common.c +- cc -c ${CFLAGS} lkcd_common.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} lkcd_common.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_v1.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v1.c +- cc -c ${CFLAGS} -DMCLX lkcd_v1.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX lkcd_v1.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_v2_v3.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v2_v3.c +- cc -c ${CFLAGS} -DMCLX lkcd_v2_v3.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX lkcd_v2_v3.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_v5.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v5.c +- cc -c ${CFLAGS} -DMCLX lkcd_v5.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX lkcd_v5.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_v7.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v7.c +- cc -c ${CFLAGS} -DMCLX lkcd_v7.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX lkcd_v7.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_v8.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v8.c +- cc -c ${CFLAGS} -DMCLX lkcd_v8.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX lkcd_v8.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + net.o: ${GENERIC_HFILES} net.c +- cc -c ${CFLAGS} net.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} net.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + dev.o: ${GENERIC_HFILES} dev.c +- cc -c ${CFLAGS} dev.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} dev.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + # remote.c functionality has been deprecated + remote.o: ${GENERIC_HFILES} remote.c +- @cc -c ${CFLAGS} remote.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ @cc -c ${CRASH_CFLAGS} remote.c ${WARNING_OPTIONS} ${WARNING_ERROR} + remote_daemon.o: ${GENERIC_HFILES} remote.c +- cc -c ${CFLAGS} -DDAEMON remote.c -o remote_daemon.o ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DDAEMON remote.c -o remote_daemon.o ${WARNING_OPTIONS} ${WARNING_ERROR} + + x86.o: ${GENERIC_HFILES} ${REDHAT_HFILES} x86.c +- cc -c ${CFLAGS} -DMCLX x86.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX x86.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + alpha.o: ${GENERIC_HFILES} alpha.c +- cc -c ${CFLAGS} ${GDB_FLAGS} alpha.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ${GDB_FLAGS} alpha.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + ppc.o: ${GENERIC_HFILES} ppc.c +- cc -c ${CFLAGS} ppc.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ppc.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + ia64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} ia64.c +- cc -c ${CFLAGS} ia64.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ia64.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + ppc64.o: ${GENERIC_HFILES} ppc64.c +- cc -c ${CFLAGS} ppc64.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} ppc64.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + x86_64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} x86_64.c +- cc -c ${CFLAGS} x86_64.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} x86_64.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + s390.o: ${GENERIC_HFILES} ${IBM_HFILES} s390.c +- cc -c ${CFLAGS} s390.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} s390.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + s390x.o: ${GENERIC_HFILES} ${IBM_HFILES} s390x.c +- cc -c ${CFLAGS} s390x.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} s390x.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + s390dbf.o: ${GENERIC_HFILES} ${IBM_HFILES} s390dbf.c +- cc -c ${CFLAGS} s390dbf.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} s390dbf.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + s390_dump.o: ${GENERIC_HFILES} ${IBM_HFILES} s390_dump.c +- cc -c ${CFLAGS} s390_dump.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} s390_dump.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + netdump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} netdump.c +- cc -c ${CFLAGS} netdump.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} netdump.c ${WARNING_OPTIONS} ${WARNING_ERROR} + netdump_daemon.o: ${GENERIC_HFILES} ${REDHAT_HFILES} netdump.c +- cc -c ${CFLAGS} -DDAEMON netdump.c -o netdump_daemon.o ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DDAEMON netdump.c -o netdump_daemon.o ${WARNING_OPTIONS} ${WARNING_ERROR} + + diskdump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} diskdump.c +- cc -c ${CFLAGS} diskdump.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} diskdump.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + xendump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} xendump.c +- cc -c ${CFLAGS} xendump.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} xendump.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + extensions.o: ${GENERIC_HFILES} extensions.c +- cc -c ${CFLAGS} extensions.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} extensions.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_x86_trace.o: ${GENERIC_HFILES} ${LKCD_TRACE_HFILES} lkcd_x86_trace.c +- cc -c ${CFLAGS} -DREDHAT lkcd_x86_trace.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DREDHAT lkcd_x86_trace.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + unwind_x86_32_64.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind_x86_32_64.c +- cc -c ${CFLAGS} unwind_x86_32_64.c -o unwind_x86_32_64.o ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} unwind_x86_32_64.c -o unwind_x86_32_64.o ${WARNING_OPTIONS} ${WARNING_ERROR} + + unwind_v1.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind.c unwind_decoder.c +- cc -c ${CFLAGS} -DREDHAT -DUNWIND_V1 unwind.c -o unwind_v1.o ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DREDHAT -DUNWIND_V1 unwind.c -o unwind_v1.o ${WARNING_OPTIONS} ${WARNING_ERROR} + + unwind_v2.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind.c unwind_decoder.c +- cc -c ${CFLAGS} -DREDHAT -DUNWIND_V2 unwind.c -o unwind_v2.o ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DREDHAT -DUNWIND_V2 unwind.c -o unwind_v2.o ${WARNING_OPTIONS} ${WARNING_ERROR} + + unwind_v3.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind.c unwind_decoder.c +- cc -c ${CFLAGS} -DREDHAT -DUNWIND_V3 unwind.c -o unwind_v3.o ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DREDHAT -DUNWIND_V3 unwind.c -o unwind_v3.o ${WARNING_OPTIONS} ${WARNING_ERROR} + + lkcd_fix_mem.o: ${GENERIC_HFILES} ${LKCD_HFILES} lkcd_fix_mem.c +- cc -c ${CFLAGS} -DMCLX lkcd_fix_mem.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} -DMCLX lkcd_fix_mem.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + xen_hyper.o: ${GENERIC_HFILES} xen_hyper.c +- cc -c ${CFLAGS} xen_hyper.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} xen_hyper.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + xen_hyper_command.o: ${GENERIC_HFILES} xen_hyper_command.c +- cc -c ${CFLAGS} xen_hyper_command.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} xen_hyper_command.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + xen_hyper_global_data.o: ${GENERIC_HFILES} xen_hyper_global_data.c +- cc -c ${CFLAGS} xen_hyper_global_data.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} xen_hyper_global_data.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + xen_hyper_dump_tables.o: ${GENERIC_HFILES} xen_hyper_dump_tables.c +- cc -c ${CFLAGS} xen_hyper_dump_tables.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ cc -c ${CRASH_CFLAGS} xen_hyper_dump_tables.c ${WARNING_OPTIONS} ${WARNING_ERROR} + + ${PROGRAM}: force + @make --no-print-directory all diff --git a/crash.spec b/crash.spec index 9abe8a4..4f24d0b 100644 --- a/crash.spec +++ b/crash.spec @@ -7,10 +7,12 @@ Summary: Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles Name: crash Version: %{major_version}.%{minor_version} -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: Development/Debuggers Source: http://people.redhat.com/anderson/crash-%{major_version}-%{minor_version}.tar.gz +Source1: crash-4.0-8.11-dwarf3.patch +Patch0: crash-4.0-8.11-optflags.patch URL: http://people.redhat.com/anderson ExclusiveOS: Linux ExclusiveArch: %{ix86} ia64 x86_64 ppc64 s390 s390x @@ -37,9 +39,11 @@ offered by Mission Critical Linux, or the LKCD kernel patch. %prep %setup -n %{name}-%{major_version}-%{minor_version} -q +%patch0 -p1 -b .optflags +cat %{SOURCE1} >> gdb-6.1.patch %build -make RPMPKG="%{version}-%{release}" +make RPMPKG="%{version}-%{release}" CFLAGS="%{optflags}" %install rm -rf %{buildroot} @@ -65,6 +69,10 @@ rm -rf %{buildroot} %{_includedir}/* %changelog +* Sun Aug 05 2009 Lubomir Rintel - 4.0.8.11-2 +- Fix reading of dwarf 3 DW_AT_data_member_location +- Use proper compiler flags + * Wed Aug 05 2009 Lubomir Rintel - 4.0.8.11-1 - Update to later upstream release - Fix abuse of Revision tag