problem with build mcelog

Vladimir Laskov samflanker at gmail.com
Tue Apr 26 14:41:19 UTC 2011


On 02/18/2011 03:11 PM, Sergey Kandaurov wrote:
> On 18 February 2011 14:13, venom<samflanker at gmail.com>  wrote:
>> On 02/11/2011 11:31 PM, John Baldwin wrote:
>>> On Friday, February 11, 2011 7:48:39 am venom wrote:
>>>> Hello.
>>>>
>>>> i am trying build mcelog
>>>>
>>>>
>>>> FreeBSD XXXX 8.1-RELEASE-p2 FreeBSD 8.1-RELEASE-p2 #0: Fri Jan 14
>>>> 04:15:56
>>>> UTC 2011 root at freebsd:/usr/obj/usr/src/sys/GENERIC amd64
>>>>
>>>>
>>>> # fetch
>>>> http://ftp2.pl.freebsd.org/pub/FreeBSD/distfiles/mcelog-1.0pre2.tar.gz
>>>> # tar -xf mcelog-1.0pre2.tar.gz
>>>> # cd mcelog-1.0pre2
>>>> # fetch http://people.freebsd.org/~jhb/mcelog/mcelog.patch
>>>> # fetch http://people.freebsd.org/~jhb/mcelog/memstream.c
>>> Oops, I just updated mcelog.patch and it should work fine now.
>>>
>> |--- //depot/vendor/mcelog/tsc.c    2010-03-05 20:24:22.000000000 0000
>> |+++ //depot/projects/mcelog/tsc.c    2010-03-05 21:09:24.000000000 0000
>> --------------------------
>> Patching file tsc.c using Plan A...
>> Hunk #1 succeeded at 15.
>> Hunk #2 succeeded at 52.
>> Hunk #3 succeeded at 75.
>> Hunk #4 succeeded at 156.
>> done
>> 12:12:46 ~/temp/MCE/mcelog-1.0pre2
>> # gmake FREEBSD=yes
>> Makefile:92: .depend: No such file or directory
>> cc -MM -I. p4.c k8.c mcelog.c dmi.c tsc.c core2.c bitfield.c intel.c
>> nehalem.c dunnington.c tulsa.c config.c memutil.c msg.c eventloop.c
>> leaky-bucket.c memdb.c server.c client.c cache.c rbtree.c memstream.c>
>> .depend.X&&  mv .depend.X .depend
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o mcelog.o mcelog.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o p4.o p4.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o k8.o k8.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o dmi.o dmi.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o tsc.o tsc.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o core2.o core2.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o bitfield.o
>> bitfield.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o intel.o intel.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o nehalem.o nehalem.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o dunnington.o
>> dunnington.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o tulsa.o tulsa.c
>> cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers
>> -Wno-unused-parameter -Wstrict-prototypes -Wformat-security
>> -Wmissing-declarations -Wdeclaration-after-statement  -o config.o config.c
>> config.c:135: error: static declaration of 'getline' follows non-static
>> declaration
>> /usr/include/stdio.h:370: error: previous declaration of 'getline' was here
>> gmake: *** [config.o] Error 1
>>
> A local getline() needs the FreeBSD version check.
>
> %%%
> --- config.c.olg        2011-02-18 14:57:52.000000000 +0300
> +++ config.c    2011-02-18 15:07:59.000000000 +0300
> @@ -18,6 +18,9 @@
>      Author: Andi Kleen
>   */
>   #define _GNU_SOURCE 1
> +#ifdef __FreeBSD__
> +# include<sys/param.h>
> +#endif
>   #include<stdio.h>
>   #include<string.h>
>   #include<ctype.h>
> @@ -126,7 +129,7 @@
>          return s;
>   }
>
> -#ifdef __FreeBSD__
> +#if (defined __FreeBSD__)&&  (__FreeBSD_version<  800067)
>   /*
>    * Newer versions do have getline(), so this should use a version test
>    * at some point.
> %%%
>
thanks
on amd64 it work fine

# gmake FREEBSD=yes
Makefile:92: .depend: No such file or directory
cc -MM -I. p4.c k8.c mcelog.c dmi.c tsc.c core2.c bitfield.c intel.c 
nehalem.c dunnington.c tulsa.c config.c memutil.c msg.c eventloop.c 
leaky-bucket.c memdb.c server.c client.c cache.c rbtree.c memstream.c > 
.depend.X && mv .depend.X .depend
cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wstrict-prototypes -Wformat-security 
-Wmissing-declarations -Wdeclaration-after-statement  -o mcelog.o mcelog.c
***
server.c: In function 'server_ping':
server.c:339: warning: passing argument 2 of 'connect' from incompatible 
pointer type
cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wstrict-prototypes -Wformat-security 
-Wmissing-declarations -Wdeclaration-after-statement  -o client.o client.c
cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wstrict-prototypes -Wformat-security 
-Wmissing-declarations -Wdeclaration-after-statement  -o cache.o cache.c
cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wstrict-prototypes -Wformat-security 
-Wmissing-declarations -Wdeclaration-after-statement  -o rbtree.o rbtree.c
cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wstrict-prototypes -Wformat-security 
-Wmissing-declarations -Wdeclaration-after-statement  -o memstream.o 
memstream.c
memstream.c:111: warning: no previous declaration for 'open_memstream'
cc   mcelog.o p4.o k8.o dmi.o tsc.o core2.o bitfield.o intel.o nehalem.o 
dunnington.o tulsa.o config.o memutil.o msg.o eventloop.o leaky-bucket.o 
memdb.o server.o client.o cache.o rbtree.o memstream.o 
/usr/lib/libkvm.so   -o mcelog
#


have problem for i386
==============================================

# gmake FREEBSD=yes i386=yes
Makefile:92: .depend: No such file or directory
cc -MM -I. p4.c k8.c mcelog.c dmi.c tsc.c core2.c bitfield.c intel.c 
nehalem.c dunnington.c tulsa.c config.c memutil.c msg.c eventloop.c 
leaky-bucket.c memdb.c server.c client.c cache.c rbtree.c memstream.c > 
.depend.X && mv .depend.X .depend
cc -c -g -Os  -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wstrict-prototypes -Wformat-security 
-Wmissing-declarations -Wdeclaration-after-statement  -o mcelog.o mcelog.c
In file included from mcelog.c:52:
mcelog.h:112: error: expected identifier before numeric constant
mcelog.c: In function 'bankname':
mcelog.c:138: error: 'CPU_NEHALEM' undeclared (first use in this function)
mcelog.c:138: error: (Each undeclared identifier is reported only once
mcelog.c:138: error: for each function it appears in.)
mcelog.c:138: error: 'CPU_DUNNINGTON' undeclared (first use in this 
function)
mcelog.c:138: error: 'CPU_TULSA' undeclared (first use in this function)
mcelog.c: In function 'mce_filter':
mcelog.c:163: error: 'CPU_NEHALEM' undeclared (first use in this function)
mcelog.c:163: error: 'CPU_DUNNINGTON' undeclared (first use in this 
function)
mcelog.c:163: error: 'CPU_TULSA' undeclared (first use in this function)
mcelog.c: At top level:
mcelog.c:218: error: 'CPU_NEHALEM' undeclared here (not in a function)
mcelog.c:218: error: array index in initializer not of integer type
mcelog.c:218: error: (near initialization for 'cputype_name')
mcelog.c:219: error: 'CPU_DUNNINGTON' undeclared here (not in a function)
mcelog.c:219: error: array index in initializer not of integer type
mcelog.c:219: error: (near initialization for 'cputype_name')
mcelog.c:220: error: 'CPU_TULSA' undeclared here (not in a function)
mcelog.c:220: error: array index in initializer not of integer type
mcelog.c:220: error: (near initialization for 'cputype_name')
mcelog.c: In function 'decodefatal':
mcelog.c:835: warning: integer constant is too large for 'long' type
mcelog.c:838: warning: integer constant is too large for 'long' type
mcelog.c:921: warning: integer constant is too large for 'long' type
mcelog.c:923: warning: integer constant is too large for 'long' type
gmake: *** [mcelog.o] Error 1



--
Vladimir Laskov



More information about the freebsd-hackers mailing list