[Crash-utility] EPPIC: fails to build in crash-7.0.0/gdb-7.6 environment

Dave Anderson anderson at redhat.com
Fri May 17 20:07:23 UTC 2013


Luc et al,

As I mentioned in the crash-7.0.0 announcement, the build 
of the eppic extension module fails due to changes in the
newly-embedded gdb-7.6 tree:

$ make extensions
...
Cloning into 'eppic'...
remote: Counting objects: 154, done.
remote: Finding sources: 100% (154/154), done.
remote: Total 154 (delta 65)
Receiving objects: 100% (154/154), 173.79 KiB | 267 KiB/s, done.
Resolving deltas: 100% (65/65), done.
cd eppic/libeppic && make
bison -peppic -v -t -d eppic.y
eppic.y: conflicts: 253 shift/reduce, 20 reduce/reduce
cc -O0 -g -fPIC   -c -o eppic_util.o eppic_util.c
cc -O0 -g -fPIC   -c -o eppic_node.o eppic_node.c
cc -O0 -g -fPIC   -c -o eppic_var.o eppic_var.c
cc -O0 -g -fPIC   -c -o eppic_func.o eppic_func.c
cc -O0 -g -fPIC   -c -o eppic_str.o eppic_str.c
cc -O0 -g -fPIC   -c -o eppic_op.o eppic_op.c
cc -O0 -g -fPIC   -c -o eppic_num.o eppic_num.c
cc -O0 -g -fPIC   -c -o eppic_stat.o eppic_stat.c
cc -O0 -g -fPIC   -c -o eppic_builtin.o eppic_builtin.c
cc -O0 -g -fPIC   -c -o eppic_type.o eppic_type.c
cc -O0 -g -fPIC   -c -o eppic_case.o eppic_case.c
cc -O0 -g -fPIC   -c -o eppic_api.o eppic_api.c
cc -O0 -g -fPIC   -c -o eppic_member.o eppic_member.c
cc -O0 -g -fPIC   -c -o eppic_alloc.o eppic_alloc.c
cc -O0 -g -fPIC   -c -o eppic_define.o eppic_define.c
cc -O0 -g -fPIC   -c -o eppic_input.o eppic_input.c
cc -O0 -g -fPIC   -c -o eppic_print.o eppic_print.c
bison -peppicpp -v -t -d eppicpp.y
eppicpp.y: conflicts: 23 shift/reduce
cc -O0 -g -fPIC -c eppicpp.tab.c
cc -O0 -g -fPIC -c eppic.tab.c
flex -L -Peppic -t eppic.l > lex.eppic.c
cc -O0 -g -fPIC -c lex.eppic.c
flex -Peppicpp -t eppicpp.l  > lex.eppicpp.c
cc -O0 -g -fPIC -c lex.eppicpp.c
cc -O0 -g -fPIC -o mkbaseop mkbaseop.c
./mkbaseop > baseops.c
cc -O0 -g -fPIC -c baseops.c
ar ccurl libeppic.a eppic_util.o eppic_node.o eppic_var.o eppic_func.o eppic_str.o eppic_op.o eppic_num.o eppic_stat.o eppic_builtin.o eppic_type.o eppic_case.o eppic_api.o eppic_member.o eppic_alloc.o eppic_define.o eppic_input.o eppic_print.o eppicpp.tab.o eppic.tab.o lex.eppic.o lex.eppicpp.o baseops.o
gcc -g -I.. -Ieppic/libeppic -I../gdb-7.6/bfd -I../gdb-7.6/include -I../gdb-7.6/gdb -I../gdb-7.6/gdb/config -I../gdb-7.6/gdb/common -I../gdb-7.6 -nostartfiles -shared -rdynamic -o eppic.so eppic/applications/crash/eppic.c -fPIC -DX86_64 -DGDB_7_6 -Leppic/libeppic -leppic 
In file included from ../gdb-7.6/gdb/common/common-utils.h:23:0,
                 from ../gdb-7.6/gdb/defs.h:564,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/bfd/config.h:7:4: error: #error config.h must be #included before system headers
../gdb-7.6/bfd/config.h:267:0: warning: "PACKAGE" redefined [enabled by default]
In file included from ../gdb-7.6/gdb/defs.h:28:0,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/gdb/config.h:606:0: note: this is the location of the previous definition
In file included from ../gdb-7.6/gdb/common/common-utils.h:23:0,
                 from ../gdb-7.6/gdb/defs.h:564,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/bfd/config.h:273:0: warning: "PACKAGE_NAME" redefined [enabled by default]
In file included from ../gdb-7.6/gdb/defs.h:29:0,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/gdb/build-gnulib/config.h:431:0: note: this is the location of the previous definition
In file included from ../gdb-7.6/gdb/common/common-utils.h:23:0,
                 from ../gdb-7.6/gdb/defs.h:564,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/bfd/config.h:276:0: warning: "PACKAGE_STRING" redefined [enabled by default]
In file included from ../gdb-7.6/gdb/defs.h:29:0,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/gdb/build-gnulib/config.h:434:0: note: this is the location of the previous definition
In file included from ../gdb-7.6/gdb/common/common-utils.h:23:0,
                 from ../gdb-7.6/gdb/defs.h:564,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/bfd/config.h:279:0: warning: "PACKAGE_TARNAME" redefined [enabled by default]
In file included from ../gdb-7.6/gdb/defs.h:29:0,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/gdb/build-gnulib/config.h:437:0: note: this is the location of the previous definition
In file included from ../gdb-7.6/gdb/common/common-utils.h:23:0,
                 from ../gdb-7.6/gdb/defs.h:564,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/bfd/config.h:285:0: warning: "PACKAGE_VERSION" redefined [enabled by default]
In file included from ../gdb-7.6/gdb/defs.h:29:0,
                 from eppic/applications/crash/eppic.c:19:
../gdb-7.6/gdb/build-gnulib/config.h:443:0: note: this is the location of the previous definition
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3848:6: error: nested redefinition of 'enum type_code'
../defs.h:3848:6: error: redeclaration of 'enum type_code'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:59:6: note: originally defined here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3849:3: error: redeclaration of enumerator 'TYPE_CODE_UNDEF'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:62:5: note: previous definition of 'TYPE_CODE_UNDEF' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3850:3: error: redeclaration of enumerator 'TYPE_CODE_PTR'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:63:5: note: previous definition of 'TYPE_CODE_PTR' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3851:3: error: redeclaration of enumerator 'TYPE_CODE_ARRAY'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:83:5: note: previous definition of 'TYPE_CODE_ARRAY' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3852:3: error: redeclaration of enumerator 'TYPE_CODE_STRUCT'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:85:5: note: previous definition of 'TYPE_CODE_STRUCT' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3853:3: error: redeclaration of enumerator 'TYPE_CODE_UNION'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:86:5: note: previous definition of 'TYPE_CODE_UNION' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3854:3: error: redeclaration of enumerator 'TYPE_CODE_ENUM'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:87:5: note: previous definition of 'TYPE_CODE_ENUM' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3857:3: error: redeclaration of enumerator 'TYPE_CODE_FLAGS'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:88:5: note: previous definition of 'TYPE_CODE_FLAGS' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3859:3: error: redeclaration of enumerator 'TYPE_CODE_FUNC'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:89:5: note: previous definition of 'TYPE_CODE_FUNC' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3860:3: error: redeclaration of enumerator 'TYPE_CODE_INT'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:90:5: note: previous definition of 'TYPE_CODE_INT' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3864:3: error: redeclaration of enumerator 'TYPE_CODE_FLT'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:94:5: note: previous definition of 'TYPE_CODE_FLT' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3871:3: error: redeclaration of enumerator 'TYPE_CODE_VOID'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:101:5: note: previous definition of 'TYPE_CODE_VOID' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3873:3: error: redeclaration of enumerator 'TYPE_CODE_SET'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:103:5: note: previous definition of 'TYPE_CODE_SET' was here
In file included from ../gdb-7.6/gdb/common/btrace-common.h:32:0,
                 from ../gdb-7.6/gdb/btrace.h:29,
                 from ../gdb-7.6/gdb/target.h:65,
                 from eppic/applications/crash/eppic.c:20:
../defs.h:3874:3: error: redeclaration of enumerator 'TYPE_CODE_RANGE'
In file included from ../gdb-7.6/gdb/symtab.h:25:0,
                 from ../gdb-7.6/gdb/target.h:61,
                 from eppic/applications/crash/eppic.c:20:
../gdb-7.6/gdb/gdbtypes.h:104:5: note: previous definition of 'TYPE_CODE_RANGE' was here
eppic/applications/crash/eppic.c:29:23: fatal error: call-cmds.h: No such file or directory
compilation terminated.
make[4]: [eppic.so] Error 1 (ignored)
...

The "redefined" and "reclaration" warnings can be addressed by modifying
the extensions/eppic.mk file by:

 (1) removing the "-I.." entirely, and
 (2) moving the "../$(GDB)/gdb" so that it is the first gdb directory in the compile line 

$ diff extensions/eppic.mk.orig extensions/eppic.mk
65c65
< 	gcc -g -I.. -Ieppic/libeppic -I../$(GDB)/bfd -I../$(GDB)/include -I../$(GDB)/gdb -I../$(GDB)/gdb/config -I../$(GDB)/gdb/common -I../$(GDB) -nostartfiles -shared -rdynamic -o eppic.so $(APPFILE) -fPIC $(TARGET_FLAGS) $(GDB_FLAGS) -Leppic/libeppic -leppic 
---
> 	gcc -g -Ieppic/libeppic -I../$(GDB)/gdb -I../$(GDB)/bfd -I../$(GDB)/include -I../$(GDB)/gdb/config -I../$(GDB)/gdb/common -I../$(GDB) -nostartfiles -shared -rdynamic -o eppic.so $(APPFILE) -fPIC $(TARGET_FLAGS) $(GDB_FLAGS) -Leppic/libeppic -leppic 
$

And the fatal error can be avoided by this patch to the $(APPFILE),
or eppic/applications/crash/eppic.c:

$ cat /tmp/eppic.patch
diff --git a/applications/crash/eppic.c b/applications/crash/eppic.c
index 984b764..cc980ee 100644
--- a/applications/crash/eppic.c
+++ b/applications/crash/eppic.c
@@ -26,7 +26,9 @@
 #include "symfile.h"
 #include "objfiles.h"
 #include "gdbcmd.h"
+#ifndef GDB_7_6
 #include "call-cmds.h"
+#endif
 #include "gdb_regex.h"
 #include "expression.h"
 #include "language.h"
$

With those changes made, the extension module builds OK, albeit with
the following warnings that I'm not going to tinker with -- but it 
would be nice if they could be cleaned up:

$ make extensions
cd eppic/libeppic && make
make[5]: Nothing to be done for 'all'.
gcc -g -Ieppic/libeppic -I../gdb-7.6/gdb -I../gdb-7.6/bfd -I../gdb-7.6/include -I../gdb-7.6/gdb/config -I../gdb-7.6/gdb/common -I../gdb-7.6 -nostartfiles -shared -rdynamic -o eppic.so eppic/applications/crash/eppic.c -fPIC -DX86_64 -DGDB_7_6 -Leppic/libeppic -leppic 
eppic/applications/crash/eppic.c: In function 'drilldowntype':
eppic/applications/crash/eppic.c:302:24: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
eppic/applications/crash/eppic.c:326:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
eppic/applications/crash/eppic.c: In function 'apimember':
eppic/applications/crash/eppic.c:403:4: warning: passing argument 2 of 'eppic_member_sname' discards 'const' qualifier from pointer target type [enabled by default]
In file included from eppic/applications/crash/eppic.c:58:0:
eppic/libeppic/eppic_api.h:262:6: note: expected 'char *' but argument is of type 'const char *'
eppic/applications/crash/eppic.c: In function 'apigetval':
eppic/applications/crash/eppic.c:484:42: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
eppic/applications/crash/eppic.c: In function 'apigetenum':
eppic/applications/crash/eppic.c:512:12: warning: passing argument 1 of 'eppic_strdup' discards 'const' qualifier from pointer target type [enabled by default]
In file included from eppic/applications/crash/eppic.c:58:0:
eppic/libeppic/eppic_api.h:184:10: note: expected 'char *' but argument is of type 'const char *'
$ 

So unless you direct me otherwise, I will queue the "-I" changes to the eppic.mk
file for crash-7.0.1, given that it's part of the crash source tree.

And I'll let you guys ruminate the eppic.c patch shown above and
let you deal with the remaining warnings.

Thanks,
  Dave




More information about the Crash-utility mailing list