<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Nguyen Anh Quynh wrote:
<blockquote TYPE=CITE>On 3/22/06, Dave Anderson <anderson@redhat.com>
wrote:
<br>> Nguyen Anh Quynh wrote:
<br>>
<br>> > Hi,
<br>> >
<br>> > I am trying to compile crash-4.0-2.21 on my x86 box. I am running
<br>> > Ubuntu 5.10, with gcc 4.0.2. I grabbed crash from
<br>> > <a href="http://people.redhat.com/anderson/crash-4.0-2.21.tar.gz">http://people.redhat.com/anderson/crash-4.0-2.21.tar.gz</a>,
untar it and
<br>> > inside the newly created crash-4.0-2.21 directory, I compiled it
with
<br>> > "make". But there is a problem, see below. How could I fix it?
<br>> >
<br>> > Thank you,
<br>> > Q
<br>> >
<br>> > ^^^^
<br>> > $make
<br>> > ......
<br>> > ......
<br>> > ar: creating libgdb.a
<br>> > ranlib libgdb.a
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 build_data.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 main.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 tools.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 global_data.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 memory.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 filesys.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 help.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 task.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 kernel.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 test.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 gdb_interface.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 net.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 dev.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DGDB_6_1 alpha.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 -DMCLX x86.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 ppc.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 ia64.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 s390.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 s390x.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 ppc64.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 x86_64.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 extensions.c
<br>> > cc -c -g -DX86 -D_FILE_OFFSET_BITS=64 va_server.c
<br>> > va_server.c:60: error: initializer element is not constant
<br>> > make[4]: *** [va_server.o] Error 1
<br>> > make[3]: *** [gdb] Error 2
<br>> > make[2]: *** [all-gdb] Error 2
<br>> > make[1]: *** [gdb_merge] Error 2
<br>> > make: *** [all] Error 2
<br>> >
<br>>
<br>> It's this remnant of the ancient "mcore" dumpfile format handling
code
<br>> in va_server.c:
<br>>
<br>>   int Page_Size = PAGE_SIZE;  /* temporary setting
until disk header is read */
<br>>
<p>that is always annoying because Linux distros have no common file
<br>headers. the problem is that in my Ubuntu box, PAGE_SIZE is defined
as
<br>a function, like this:
<p>#define PAGE_SIZE ((unsigned long)getpagesize())
<p>obviously you guys run FC/Redhat, which has a different file header,
<br>so you have no such a problem.
<br> </blockquote>
<tt>Ah, OK, so I'll fix it like this:</tt><tt></tt>
<p><tt>--- va_server.c.orig    2006-03-22 08:57:36.000000000
-0500</tt>
<br><tt>+++ va_server.c 2006-03-22 08:55:34.000000000 -0500</tt>
<br><tt>@@ -57,13 +57,15 @@ void set_vas_debug(ulong);</tt><tt></tt>
<p><tt> extern int monitor_memory(long *, long *, long *, long *);</tt><tt></tt>
<p><tt>-int Page_Size = PAGE_SIZE;  /* temporary setting until disk
header is read */</tt>
<br><tt>+int Page_Size;</tt>
<br><tt> ulong vas_debug = 0;</tt><tt></tt>
<p><tt> extern void *malloc(size_t);</tt><tt></tt>
<p><tt> int va_server_init(char *crash_file, u_long *start, u_long
*end, u_long *stride)</tt>
<br><tt> {</tt>
<br><tt>+       Page_Size = getpagesize(); 
/* temporary setting until disk header is read */</tt>
<br><tt>+</tt>
<br><tt>        if(read_map(crash_file))
{</tt>
<br><tt>               
if(va_server_init_v1(crash_file, start, end, stride))</tt>
<br><tt>                       
return -1;</tt><tt></tt>
<p><tt>That will keep mcore happy.</tt><tt></tt>
<p><tt>Thanks again,</tt>
<br><tt>  Dave</tt>
<br><tt></tt> 
<blockquote TYPE=CITE> 
<br>thanks,
<br>Quynh
<p>--
<br>Crash-utility mailing list
<br>Crash-utility@redhat.com
<br><a href="https://www.redhat.com/mailman/listinfo/crash-utility">https://www.redhat.com/mailman/listinfo/crash-utility</a></blockquote>
</html>