2009-09-27 09:56:54

by Bernard Pidoux

[permalink] [raw]
Subject: 2.6.31.1 BUG #include <asm/bitsperlong.h>

In kernel 2.6.31.1 the following files in

/usr/src/linux-2.6.31.1/include/asm-generic/

include <asm/bitsperlong.h>

while they should #include <asm-generic/bitsperlong.h>

int-l64.h:#include <asm/bitsperlong.h>
int-ll64.h:#include <asm/bitsperlong.h>
msgbuf.h:#include <asm/bitsperlong.h>
posix_types.h:#include <asm/bitsperlong.h>
sembuf.h:#include <asm/bitsperlong.h>
shmbuf.h:#include <asm/bitsperlong.h>
stat.h:#include <asm/bitsperlong.h>
swab.h:#include <asm/bitsperlong.h>
unistd.h:#include <asm/bitsperlong.h>

Regards,

Bernard Pidoux


2009-09-27 10:22:59

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

On Sun, Sep 27, 2009 at 11:56:47AM +0200, Bernard Pidoux wrote:
> In kernel 2.6.31.1 the following files in
>
> /usr/src/linux-2.6.31.1/include/asm-generic/
>
> include <asm/bitsperlong.h>
>
> while they should #include <asm-generic/bitsperlong.h>

It would be wrong to include the generic version
directly.
We need access to the arch specifics definitions
before we include the generic version.

See how different architectures does various things
in their: arch/$(ARCH)/include/asm/bitsperlong.h

Sam

2009-09-27 11:16:46

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

The problem is that when I compile an application that never
caused any problem before I get an error due to incorrect reference to <asm/bitsperlong>

This was due to int-ll64.h including <asm/bitsperlong.h> which does not exists.

Is the correct solution to replace symbolic link ?

/usr/src/linux/include/asm->asm-x86

by

/usr/src/linux/include/asm->asm-generic

Bernard Pidoux




On Sun, Sep 27, 2009 at 11:56:47AM +0200, Bernard Pidoux wrote:
> In kernel 2.6.31.1 the following files in
>
> /usr/src/linux-2.6.31.1/include/asm-generic/
>
> include <asm/bitsperlong.h>
>
> while they should #include <asm-generic/bitsperlong.h>

It would be wrong to include the generic version
directly.
We need access to the arch specifics definitions
before we include the generic version.

See how different architectures does various things
in their: arch/$(ARCH)/include/asm/bitsperlong.h

Sam

2009-09-27 11:24:08

by Arjan van de Ven

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

On Sun, 27 Sep 2009 13:16:41 +0200
Bernard Pidoux <[email protected]> wrote:

> The problem is that when I compile an application that never
> caused any problem before I get an error due to incorrect reference
> to <asm/bitsperlong>

is this a userspace application? or some kernel module?



--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2009-09-27 11:36:28

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

This is a user space application.

Here is Gcc error message :

gcc -Wall -Wstrict-prototypes -O2 -ggdb2 -funsigned-char -D__LINUX__ -Wformat-security -D_FORTIFY_SOURCE=2 -DPROTOTYPES -I../lib -I/usr/src/linux/include -fstack-check -fstack-protector-all -c listen.c
Dans le fichier inclus à partir de /usr/include/asm/types.h:4,
à partir de /usr/src/linux/include/linux/types.h:4,
à partir de /usr/src/linux/include/linux/if_ether.h:24,
à partir de /usr/include/net/ethernet.h:27,
à partir de listen.c:21:
/usr/src/linux/include/asm-generic/int-ll64.h:11:29: erreur: asm/bitsperlong.h : Aucun fichier ou dossier de ce type
listen.c: In function ‘main’:



On Sun, 27 Sep 2009 13:16:41 +0200
Bernard Pidoux <[email protected]> wrote:

> The problem is that when I compile an application that never
> caused any problem before I get an error due to incorrect reference
> to <asm/bitsperlong>

is this a userspace application? or some kernel module?



--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2009-09-27 11:46:46

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

On Sun, Sep 27, 2009 at 01:16:41PM +0200, Bernard Pidoux wrote:
> The problem is that when I compile an application that never caused any
> problem before I get an error due to incorrect reference to
> <asm/bitsperlong>
>
> This was due to int-ll64.h including <asm/bitsperlong.h> which does not exists.
>
> Is the correct solution to replace symbolic link ?
>
> /usr/src/linux/include/asm->asm-x86
>
> by
>
> /usr/src/linux/include/asm->asm-generic

The correct fix is to include the missing bitsperlong in
the asm-x86 directory.
In other words your kernel headers are broken.

Looking at latest kernel we do export bitsperlong.h.
So see if you can find a fix for your broken kernel headers.

Sam

2009-09-27 11:57:33

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

The only file in asm-x86 directory is asm-offsets.h

This is a Mandriva 2009.1 Spring distro.
I checked that it was the same on two other machines with the same
new installed distro.

I will copy bitsperlong.h into asm-x86 as suggested.

Should other files be present in the above directory ?

Should I send a bug report to Mandriva ?

Thank you all for your help.

Bernard Pidoux


On Sun, Sep 27, 2009 at 01:16:41PM +0200, Bernard Pidoux wrote:
> The problem is that when I compile an application that never caused any
> problem before I get an error due to incorrect reference to
> <asm/bitsperlong>
>
> This was due to int-ll64.h including <asm/bitsperlong.h> which does not exists.
>
> Is the correct solution to replace symbolic link ?
>
> /usr/src/linux/include/asm->asm-x86
>
> by
>
> /usr/src/linux/include/asm->asm-generic

The correct fix is to include the missing bitsperlong in
the asm-x86 directory.
In other words your kernel headers are broken.

Looking at latest kernel we do export bitsperlong.h.
So see if you can find a fix for your broken kernel headers.

Sam

2009-09-27 12:44:23

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

I downloaded again linux-2.6.31.1.tar.bz2 and unpacked it.

ll /usr/src/linux-2.6.31.1/include/
total 128
drwxrwxr-x 3 root root 4096 2009-09-24 17:45 acpi/
lrwxrwxrwx 1 root root 7 2009-09-27 14:34 asm -> asm-x86/
drwxrwxr-x 3 root root 4096 2009-09-24 17:45 asm-generic/
drwxr-xr-x 2 root root 4096 2009-09-27 14:34 asm-x86/

and

ll /usr/src/linux-2.6.31.1/include/asm/
total 8
-rw-r--r-- 1 root root 4890 2009-09-27 14:34 asm-offsets.h

So, I think that the kernel header problem is in the linux package, not in
my system installation.

Bernard Pidoux



On Sun, Sep 27, 2009 at 01:16:41PM +0200, Bernard Pidoux wrote:
> The problem is that when I compile an application that never caused any
> problem before I get an error due to incorrect reference to
> <asm/bitsperlong>
>
> This was due to int-ll64.h including <asm/bitsperlong.h> which does not exists.
>
> Is the correct solution to replace symbolic link ?
>
> /usr/src/linux/include/asm->asm-x86
>
> by
>
> /usr/src/linux/include/asm->asm-generic

The correct fix is to include the missing bitsperlong in
the asm-x86 directory.
In other words your kernel headers are broken.

Looking at latest kernel we do export bitsperlong.h.
So see if you can find a fix for your broken kernel headers.

Sam

2009-09-27 13:19:19

by Arjan van de Ven

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

On Sun, 27 Sep 2009 14:44:17 +0200
Bernard Pidoux <[email protected]> wrote:

> I downloaded again linux-2.6.31.1.tar.bz2 and unpacked it.
>
> ll /usr/src/linux-2.6.31.1/include/
> total 128
> drwxrwxr-x 3 root root 4096 2009-09-24 17:45 acpi/
> lrwxrwxrwx 1 root root 7 2009-09-27 14:34 asm -> asm-x86/
> drwxrwxr-x 3 root root 4096 2009-09-24 17:45 asm-generic/
> drwxr-xr-x 2 root root 4096 2009-09-27 14:34 asm-x86/
>
> and
>
> ll /usr/src/linux-2.6.31.1/include/asm/
> total 8
> -rw-r--r-- 1 root root 4890 2009-09-27 14:34 asm-offsets.h
>
> So, I think that the kernel header problem is in the linux package,
> not in my system installation.

do not count until you have done "make headers_install"... there is
magic there that fixes up a bunch of things.
.


--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2009-09-27 16:29:18

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

If it was supposed to install bitsperlong.h in /asm/ magic did not work.

I am a little bit puzzled for the script writes

INSTALL include/asm (53 files)

and I can still only list one file in that directory.


[root@f6bvp-11 linux-2.6.31.1]# make headers_install
CHK include/linux/version.h
HOSTCC scripts/unifdef
INSTALL include/asm-generic (34 files)
INSTALL include/drm (12 files)
INSTALL include/linux/byteorder (2 files)
INSTALL include/linux/can (4 files)
INSTALL include/linux/dvb (8 files)
INSTALL include/linux/hdlc (1 file)
INSTALL include/linux/isdn (1 file)
INSTALL include/linux/netfilter (58 files)
INSTALL include/linux/netfilter_arp (2 files)
INSTALL include/linux/netfilter_bridge (16 files)
INSTALL include/linux/netfilter_ipv4 (46 files)
INSTALL include/linux/netfilter_ipv6 (21 files)
INSTALL include/linux/nfsd (6 files)
INSTALL include/linux/raid (2 files)
INSTALL include/linux/spi (1 file)
INSTALL include/linux/sunrpc (1 file)
INSTALL include/linux/tc_act (6 files)
INSTALL include/linux/tc_ematch (4 files)
INSTALL include/linux/usb (8 files)
INSTALL include/linux/wimax (1 file)
INSTALL include/linux (353 files)
INSTALL include/mtd (5 files)
INSTALL include/rdma (1 file)
INSTALL include/scsi (4 files)
INSTALL include/sound (9 files)
INSTALL include/video (3 files)
INSTALL include/xen (1 file)
INSTALL include (0 file)
INSTALL include/asm (53 files)
[root@f6bvp-11 linux-2.6.31.1]# ll include/asm/
total 8
-rw-r--r-- 1 root root 4890 2009-09-27 14:34 asm-offsets.h


Arjan van de Ven a ?crit :
> On Sun, 27 Sep 2009 14:44:17 +0200
> Bernard Pidoux <[email protected]> wrote:
>
>> I downloaded again linux-2.6.31.1.tar.bz2 and unpacked it.
>>
>> ll /usr/src/linux-2.6.31.1/include/
>> total 128
>> drwxrwxr-x 3 root root 4096 2009-09-24 17:45 acpi/
>> lrwxrwxrwx 1 root root 7 2009-09-27 14:34 asm -> asm-x86/
>> drwxrwxr-x 3 root root 4096 2009-09-24 17:45 asm-generic/
>> drwxr-xr-x 2 root root 4096 2009-09-27 14:34 asm-x86/
>>
>> and
>>
>> ll /usr/src/linux-2.6.31.1/include/asm/
>> total 8
>> -rw-r--r-- 1 root root 4890 2009-09-27 14:34 asm-offsets.h
>>
>> So, I think that the kernel header problem is in the linux package,
>> not in my system installation.
>
> do not count until you have done "make headers_install"... there is
> magic there that fixes up a bunch of things.
> .
>
>

2009-09-27 16:50:22

by Arjan van de Ven

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

On Sun, 27 Sep 2009 18:29:11 +0200
Bernard Pidoux <[email protected]> wrote:

> If it was supposed to install bitsperlong.h in /asm/ magic did not
> work.
>
> I am a little bit puzzled for the script writes
>
> INSTALL include/asm (53 files)
>
> and I can still only list one file in that directory.


> [root@f6bvp-11 linux-2.6.31.1]# ll include/asm/
> total 8
> -rw-r--r-- 1 root root 4890 2009-09-27 14:34 asm-offsets.h


ls /usr/include/asm

that's where it ends up.

the kernel's "include/asm" is supposed to be empty or near empty.

2009-09-27 16:58:23

by Arnd Bergmann

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

On Sunday 27 September 2009 11:36:22 Bernard Pidoux wrote:
> gcc -Wall -Wstrict-prototypes -O2 -ggdb2 -funsigned-char -D__LINUX__ -Wformat-security -D_FORTIFY_SOURCE=2 -DPROTOTYPES -I../lib -I/usr/src/linux/include -fstack-check -fstack-protector-all -c listen.c
> Dans le fichier inclus à partir de /usr/include/asm/types.h:4,
> à partir de /usr/src/linux/include/linux/types.h:4,
> à partir de /usr/src/linux/include/linux/if_ether.h:24,
> à partir de /usr/include/net/ethernet.h:27,
> à partir de listen.c:21:
> /usr/src/linux/include/asm-generic/int-ll64.h:11:29: erreur: asm/bitsperlong.h : Aucun fichier ou dossier de ce type
> listen.c: In function ‘main’:
>

The problem is the '-I/usr/src/linux/include' part of the gcc command line.
See http://kernelnewbies.org/KernelHeaders for why this is wrong.
You should notify the maintainer of the package to fix this by removing
this option. The headers in /usr/include/ are sufficient to build user
code.

Arnd <><

2009-09-27 17:36:07

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

Here is the difference that made my system crazy :

--- /usr/src/linux-2.6.30.6/include/asm-generic/int-ll64.h 2009-06-10 05:05:27.000000000 +0200
+++ /usr/src/linux-2.6.31/include/asm-generic/int-ll64.h 2009-09-27 11:27:02.577804468 +0200
@@ -8,6 +8,8 @@
#ifndef _ASM_GENERIC_INT_LL64_H
#define _ASM_GENERIC_INT_LL64_H

+#include <asm/bitsperlong.h>
+
#ifndef __ASSEMBLY__
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the

So, where are supposed to be the export routines that did not work ?

Bernard


> The correct fix is to include the missing bitsperlong in
> the asm-x86 directory.
> In other words your kernel headers are broken.
>
> Looking at latest kernel we do export bitsperlong.h.
> So see if you can find a fix for your broken kernel headers.
>
> Sam

2009-09-27 18:33:57

by Bernard Pidoux

[permalink] [raw]
Subject: Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>

Many thanks for the solution to my issue.
As I maintain the application, it was easy to perform the change
to Makefile and it worked fine.

Best regards,

Bernard Pidoux

[email protected] a ?crit :
> On Sunday 27 September 2009 11:36:22 Bernard Pidoux wrote:
>> gcc -Wall -Wstrict-prototypes -O2 -ggdb2 -funsigned-char -D__LINUX__ -Wformat-security -D_FORTIFY_SOURCE=2 -DPROTOTYPES -I../lib -I/usr/src/linux/include -fstack-check -fstack-protector-all -c listen.c
>> Dans le fichier inclus ? partir de /usr/include/asm/types.h:4,
>> ? partir de /usr/src/linux/include/linux/types.h:4,
>> ? partir de /usr/src/linux/include/linux/if_ether.h:24,
>> ? partir de /usr/include/net/ethernet.h:27,
>> ? partir de listen.c:21:
>> /usr/src/linux/include/asm-generic/int-ll64.h:11:29: erreur: asm/bitsperlong.h : Aucun fichier ou dossier de ce type
>> listen.c: In function ?main?:
>>
>
> The problem is the '-I/usr/src/linux/include' part of the gcc command line.
> See http://kernelnewbies.org/KernelHeaders for why this is wrong.
> You should notify the maintainer of the package to fix this by removing
> this option. The headers in /usr/include/ are sufficient to build user
> code.
>
> Arnd <><
>