[LinuxPPS] Confused with ppstest.c on 2.6.31

William S. Brasher billb958 at door.net
Tue Nov 24 18:51:42 CET 2009


On Tue, 24 Nov 2009, 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
> 
> 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
> 


I have seen the same problem trying to compile ppstest.c in linux-2.6.31x.  
The problem is that the file asm/bitsperlong.h is new to this kernel;  you 
can find it as one of the architecture dependent files, such as
arch/x86/include/asm/bitsperlong.h.

When you try to compile ppstest.c using CFLAGS += -I ../../include/ you 
end up mixing include files from the linux source directory and 
/usr/include/{asm,asm-generic,linux}.  Since your libc was probably 
compiled against a different kernel's headers, gcc can't find 
bitsperlong.h.

I find that ppstest can be compiled using the older kernel headers I've 
got installed in /usr/include/{asm,asm-generic,linux} by simply doing:

gcc -Wall -o ppstest ppstest.c


Unfortunately, the include file <scsi/scsi.h> is borked in the 2.6.31 
series, so I am not building a libc using the newer 2.6.31 headers.





More information about the LinuxPPS mailing list