[LinuxPPS] Confused with ppstest.c on 2.6.31

Hal V. Engel hvengel at astound.net
Sun Dec 6 03:11:11 CET 2009


On Tuesday 24 November 2009 07:46:06 am Luca Bertagnolio wrote:
> Hi all,
> 
> been updating my Gentoo test machines with a 2.6.31-gentoo-r6 kernel with
>  the latest patch from Rodolfo.  Everything compiles nicely, and I get the
>  modules that load OK in the kernel.
> 
> On the other hand, I am running into issue in compiling the silly ppstest.c
> software found in the Documentation directory in the kernel sources.
> 
> Irregardless of whether I include the linux/asm/asm-generic links in
> /usr/include
> I cannot seem to get ppstest.c to compile.
> 
> If I don't have the links this is what I get:
> 
> tix pps # make
> cc -Wall -O2 -D_GNU_SOURCE -I . -I ../../include/ -ggdb    ppstest.c
> -o ppstest
> In file included from /usr/include/asm/types.h:4,
>                  from ../../include/linux/types.h:4,
>                  from ./timepps.h:27,
>                  from ppstest.c:8:
> ../../include/asm-generic/int-ll64.h:11:29: error: asm/bitsperlong.h:
> No such file or directory
> make: *** [ppstest] Error 1
> 
> If I have the links this is what I get, much longer yet still
> meaningless to my eyes:
> 
> tix pps # make
> cc -Wall -O2 -D_GNU_SOURCE -I . -I ../../include/ -ggdb    ppstest.c
> -o ppstest
> In file included from /usr/include/bits/errno.h:25,
>                  from /usr/include/errno.h:36,
>                  from ./timepps.h:24,
>                  from ppstest.c:8:
> ../../include/linux/errno.h:4:23: error: asm/errno.h: No such file or
>  directory In file included from /usr/include/sys/ioctl.h:27,
>                  from ./timepps.h:26,
>                  from ppstest.c:8:
> /usr/include/bits/ioctls.h:24:24: error: asm/ioctls.h: No such file or
>  directory In file included from ./timepps.h:27,
>                  from ppstest.c:8:
> ../../include/linux/types.h:4:23: error: asm/types.h: No such file or
>  directory In file included from ../../include/linux/types.h:14,
>                  from ./timepps.h:27,
>                  from ppstest.c:8:
> ../../include/linux/posix_types.h:47:29: error: asm/posix_types.h: No
> such file or directory
> In file included from ./timepps.h:27,
>                  from ppstest.c:8:
> ../../include/linux/types.h:168: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__le16'
> ../../include/linux/types.h:169: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__be16'
> ../../include/linux/types.h:170: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__le32'
> ../../include/linux/types.h:171: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__be32'
> ../../include/linux/types.h:172: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__le64'
> ../../include/linux/types.h:173: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__be64'
> ../../include/linux/types.h:175: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__sum16'
> ../../include/linux/types.h:176: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__wsum'
> In file included from ./timepps.h:28,
>                  from ppstest.c:8:
> ../../include/linux/pps.h:54: error: expected specifier-qualifier-list
> before '__s64'
> ../../include/linux/pps.h:61: error: expected specifier-qualifier-list
> before '__u32'
> In file included from ../../include/linux/pps.h:117,
>                  from ./timepps.h:28,
>                  from ppstest.c:8:
> ../../include/linux/ioctl.h:4:23: error: asm/ioctl.h: No such file or
>  directory In file included from ppstest.c:8:
> ./timepps.h: In function 'time_pps_create':
> ./timepps.h:91: error: 'EINVAL' undeclared (first use in this function)
> ./timepps.h:91: error: (Each undeclared identifier is reported only once
> ./timepps.h:91: error: for each function it appears in.)
> ./timepps.h:98: warning: implicit declaration of function '_IOR'
> ./timepps.h:98: error: expected expression before 'struct'
> ./timepps.h:100: error: 'EOPNOTSUPP' undeclared (first use in this
>  function) ./timepps.h: In function 'time_pps_getparams':
> ./timepps.h:123: error: expected expression before 'struct'
> ./timepps.h:127: error: 'struct pps_ktime' has no member named 'sec'
> ./timepps.h:128: error: 'struct pps_ktime' has no member named 'nsec'
> ./timepps.h:129: error: 'struct pps_ktime' has no member named 'sec'
> ./timepps.h:130: error: 'struct pps_ktime' has no member named 'nsec'
> ./timepps.h: In function 'time_pps_setparams':
> ./timepps.h:142: error: 'struct pps_ktime' has no member named 'sec'
> ./timepps.h:143: error: 'struct pps_ktime' has no member named 'nsec'
> ./timepps.h:144: error: 'struct pps_ktime' has no member named 'sec'
> ./timepps.h:145: error: 'struct pps_ktime' has no member named 'nsec'
> ./timepps.h:147: warning: implicit declaration of function '_IOW'
> ./timepps.h:147: error: expected expression before 'struct'
> ./timepps.h: In function 'time_pps_getcap':
> ./timepps.h:153: error: expected expression before 'int'
> ./timepps.h: In function 'time_pps_fetch':
> ./timepps.h:165: error: 'EINVAL' undeclared (first use in this function)
> ./timepps.h:170: error: 'struct pps_ktime' has no member named 'sec'
> ./timepps.h:171: error: 'struct pps_ktime' has no member named 'nsec'
> ./timepps.h:172: error: 'struct pps_ktime' has no member named 'flags'
> ./timepps.h:174: error: 'struct pps_ktime' has no member named 'flags'
> ./timepps.h:176: warning: implicit declaration of function '_IOWR'
> ./timepps.h:176: error: expected expression before 'struct'
> ./timepps.h:178: error: 'struct pps_kinfo' has no member named
>  'assert_sequence' ./timepps.h:179: error: 'struct pps_kinfo' has no member
>  named 'clear_sequence' ./timepps.h:180: error: 'struct pps_kinfo' has no
>  member named 'assert_tu' ./timepps.h:181: error: 'struct pps_kinfo' has no
>  member named 'assert_tu' ./timepps.h:182: error: 'struct pps_kinfo' has no
>  member named 'clear_tu' ./timepps.h:183: error: 'struct pps_kinfo' has no
>  member named 'clear_tu' ./timepps.h:184: error: 'struct pps_kinfo' has no
>  member named 'current_mode' ./timepps.h: In function 'time_pps_kcbind':
> ./timepps.h:194: error: 'EOPNOTSUPP' undeclared (first use in this
>  function) ppstest.c: In function 'fetch_source':
> ppstest.c:87: error: 'EINTR' undeclared (first use in this function)
> ppstest.c: In function 'main':
> ppstest.c:140: error: 'ETIMEDOUT' undeclared (first use in this function)
> make: *** [ppstest] Error 1
> 
> Was ppsetest.c tested with the new patches?  Or is this something local to
> my specific setup?
> 
> I am using glibc 2.10.1 with timex.h patched to add NANO and TAI, though
> I don't believe that there is much relationship here, with the apparently
> simple compilation of ppstest.c...
> 
> Any hints for me?
> 
> Thanks, Luca

Luca,

I don't know if you figured this out or not but in case you didn't I ran into 
the same thing today while working with the 2.6.32 patch set.  The missing 
header (bitsperlong.h) is located in the kernel tree at

   /usr/src/linux/arch/<you arch>/include/asm

where <your arch> is x86 for most of us.  This needs to be available in 

   /usr/include/asm

for the build to work.  This header file was added recently to the kernel tree.  
I suspect this happened with the 2.6.31 cycle but I have not checked to see if 
this is the case.  The newest linux-headers package in Gentoo is 2.6.30 and it 
is missing this file.

Hal



More information about the LinuxPPS mailing list