[Crash-utility] Error when compiling crash-4.0-2.21

Dave Anderson anderson at redhat.com
Wed Mar 22 13:50:42 UTC 2006


Nguyen Anh Quynh wrote:

> On 3/22/06, Dave Anderson <anderson at redhat.com> wrote:
> > Nguyen Anh Quynh wrote:
> >
> > > Hi,
> > >
> > > I am trying to compile crash-4.0-2.21 on my x86 box. I am running
> > > Ubuntu 5.10, with gcc 4.0.2. I grabbed crash from
> > > http://people.redhat.com/anderson/crash-4.0-2.21.tar.gz, untar it and
> > > inside the newly created crash-4.0-2.21 directory, I compiled it with
> > > "make". But there is a problem, see below. How could I fix it?
> > >
> > > Thank you,
> > > Q
> > >
> > > ^^^^
> > > $make
> > > ......
> > > ......
> > > ar: creating libgdb.a
> > > ranlib libgdb.a
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 build_data.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 main.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 tools.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 global_data.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 memory.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 filesys.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 help.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 task.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 kernel.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 test.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 gdb_interface.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 net.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 dev.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 alpha.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DMCLX x86.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 ppc.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 ia64.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 s390.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 s390x.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 ppc64.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 x86_64.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 extensions.c
> > > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 va_server.c
> > > va_server.c:60: error: initializer element is not constant
> > > make[4]: *** [va_server.o] Error 1
> > > make[3]: *** [gdb] Error 2
> > > make[2]: *** [all-gdb] Error 2
> > > make[1]: *** [gdb_merge] Error 2
> > > make: *** [all] Error 2
> > >
> >
> > It's this remnant of the ancient "mcore" dumpfile format handling code
> > in va_server.c:
> >
> >   int Page_Size = PAGE_SIZE;  /* temporary setting until disk header is read */
> >
>
> that is always annoying because Linux distros have no common file
> headers. the problem is that in my Ubuntu box, PAGE_SIZE is defined as
> a function, like this:
>
> #define PAGE_SIZE ((unsigned long)getpagesize())
>
> obviously you guys run FC/Redhat, which has a different file header,
> so you have no such a problem.
>

Ah, OK, so I'll fix it like this:

--- va_server.c.orig    2006-03-22 08:57:36.000000000 -0500
+++ va_server.c 2006-03-22 08:55:34.000000000 -0500
@@ -57,13 +57,15 @@ void set_vas_debug(ulong);

 extern int monitor_memory(long *, long *, long *, long *);

-int Page_Size = PAGE_SIZE;  /* temporary setting until disk header is read */
+int Page_Size;
 ulong vas_debug = 0;

 extern void *malloc(size_t);

 int va_server_init(char *crash_file, u_long *start, u_long *end, u_long *stride)
 {
+       Page_Size = getpagesize();  /* temporary setting until disk header is read */
+
        if(read_map(crash_file)) {
                if(va_server_init_v1(crash_file, start, end, stride))
                        return -1;

That will keep mcore happy.

Thanks again,
  Dave


>
> thanks,
> Quynh
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20060322/c6448923/attachment.htm>


More information about the Crash-utility mailing list