Skip to contentSkip to conversation

New: building (e)glibc against 2.6.37-rc1 headers fails

Bugme-new Andrew Morton 4 participants 4 messages Nov 16, 2010 – Nov 17, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 6 lines · On Mon, 15 Nov 2010 00:09:33 GMT [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=22962

           Summary: building (e)glibc against 2.6.37-rc1 headers fails
           Product: Networking
           Version: 2.5
    Kernel Version: 2.6.37-rc1

hm, thanks for picking this up so early. It would have been irritating to let this out in 2.6.37.

Quoted 79 lines

Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Other
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: No

i have problems building eglibc against the linux-2.6.37-rc1 headers:

/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/bin/i686-openelec-linux-gnu-gcc ../sysdeps/unix/sysv/linux/if_index.c -c -std=gnu99 -fgnu89-inline -O3 -Wall

(quoted diff) +0 -24
-Winline -Wwrite-strings -fexcess-precision=fast -fgraphite-identity
-floop-block -floop-interchange -floop-strip-mine -fmerge-all-constants
-fno-stack-protector -fno-unwind-tables -ftree-loop-distribution -g -m32
-march=pentium-m -pipe -s -Wstrict-prototypes -mpreferred-stack-boundary=2
-fomit-frame-pointer -Wa,-mtune=i686    -I../include
-I/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet
-I/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc
-I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686
-I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386
-I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux
-I../nptl/sysdeps/pthread -I../sysdeps/pthread
-I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux
-I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
-I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386
-I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv
-I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386
-I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch
-I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486
-I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386
-I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754
-I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I..
-I../libio -I. -nostdinc -isystem

/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/lib/gcc/i686-openelec-linux-gnu/4.5.1/include -isystem /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/lib/gcc/i686-openelec-linux-gnu/4.5.1/include-fixed -isystem /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include
-D_LIBC_REENTRANT -include ../include/libc-symbols.h -o
/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o
-MD -MP -MF /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o.dt
-MT
/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o
In file included from /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/netdevice.h:28:0,
from
/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/rtnetlink.h:9,

                 from ../sysdeps/unix/sysv/linux/netlinkaccess.h:24,
                 from ../sysdeps/unix/sysv/linux/if_index.c:33:

/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/if.h:135:8:
error: redefinition of 'struct ifmap'
../sysdeps/gnu/net/if.h:112:8: note: originally defined here /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/if.h:169:8:
error: redefinition of 'struct ifreq'
../sysdeps/gnu/net/if.h:127:8: note: originally defined here /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/if.h:218:8:
error: redefinition of 'struct ifconf'
../sysdeps/gnu/net/if.h:177:8: note: originally defined here
make[3]: *** [/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o] Error 1
make[3]: Leaving directory `/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/inet'
make[2]: *** [inet/subdir_lib] Error 2
make[2]: Leaving directory
`/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc'
make: *** [squashfs] Fehler 2

Quoted 6 lines

it seems because of an change in include/linux/rtnetlink.h (commit
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24824a09e35402b8d58dcc5be803a5ad3937bdba)
where linux/netdevice.h will be included now linux/if.h together with net/if.h will be included - see also comments here:
http://www.mail-archive.com/[email protected]/msg2611725.html

Maybe we need some __KERNEL__ guards in if.h.

#2 lore raw

Hi,

Am 16.11.2010 23:33, schrieb Andrew Morton:

Quoted 94 lines

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 6 lines · On Mon, 15 Nov 2010 00:09:33 GMT [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=22962

            Summary: building (e)glibc against 2.6.37-rc1 headers fails
            Product: Networking
            Version: 2.5
     Kernel Version: 2.6.37-rc1

hm, thanks for picking this up so early. It would have been irritating to let this out in 2.6.37.

Quoted 79 lines

Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Other
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: No

i have problems building eglibc against the linux-2.6.37-rc1 headers:

/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/bin/i686-openelec-linux-gnu-gcc ../sysdeps/unix/sysv/linux/if_index.c -c -std=gnu99 -fgnu89-inline -O3 -Wall

(quoted diff) +0 -24
-Winline -Wwrite-strings -fexcess-precision=fast -fgraphite-identity
-floop-block -floop-interchange -floop-strip-mine -fmerge-all-constants
-fno-stack-protector -fno-unwind-tables -ftree-loop-distribution -g -m32
-march=pentium-m -pipe -s -Wstrict-prototypes -mpreferred-stack-boundary=2
-fomit-frame-pointer -Wa,-mtune=i686    -I../include
-I/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet
-I/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc
-I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686
-I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386
-I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux
-I../nptl/sysdeps/pthread -I../sysdeps/pthread
-I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux
-I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
-I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386
-I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv
-I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386
-I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch
-I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486
-I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386
-I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754
-I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I..
-I../libio -I. -nostdinc -isystem

/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/lib/gcc/i686-openelec-linux-gnu/4.5.1/include -isystem /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/lib/gcc/i686-openelec-linux-gnu/4.5.1/include-fixed -isystem /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include
-D_LIBC_REENTRANT -include ../include/libc-symbols.h -o
/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o
-MD -MP -MF /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o.dt
-MT
/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o
In file included from /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/netdevice.h:28:0,
from
/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/rtnetlink.h:9,

                  from ../sysdeps/unix/sysv/linux/netlinkaccess.h:24,
                  from ../sysdeps/unix/sysv/linux/if_index.c:33:

/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/if.h:135:8:
error: redefinition of 'struct ifmap'
../sysdeps/gnu/net/if.h:112:8: note: originally defined here /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/if.h:169:8:
error: redefinition of 'struct ifreq'
../sysdeps/gnu/net/if.h:127:8: note: originally defined here /home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/toolchain/i686-openelec-linux-gnu/sysroot/usr/include/linux/if.h:218:8:
error: redefinition of 'struct ifconf'
../sysdeps/gnu/net/if.h:177:8: note: originally defined here
make[3]: *** [/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc/inet/if_index.o] Error 1
make[3]: Leaving directory `/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/inet'
make[2]: *** [inet/subdir_lib] Error 2
make[2]: Leaving directory
`/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/stephan/projects/openelec/build.OpenELEC-ATV.i386.devel/eglibc-2.12-12025/objdir-eglibc'
make: *** [squashfs] Fehler 2

Quoted 8 lines
Quoted 6 lines

it seems because of an change in include/linux/rtnetlink.h (commit
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24824a09e35402b8d58dcc5be803a5ad3937bdba)
where linux/netdevice.h will be included now linux/if.h together with net/if.h will be included - see also comments here:
http://www.mail-archive.com/[email protected]/msg2611725.html

Maybe we need some __KERNEL__ guards in if.h.

in the meantime i can build with attached patch.

greetings and thanks

Stephan

Signature · 3 lines
              ### OpenELEC.tv ###
The free and open Mediacenter Distribution 4 you
             http://www.openelec.tv
include/linux/rtnetlink.h +1 -1
diff -Naur linux-2.6.37-rc1/include/linux/rtnetlink.h linux-2.6.37-rc1.patch/include/linux/rtnetlink.h
@@ -6,7 +6,6 @@
 #include <linux/if_link.h>
 #include <linux/if_addr.h>
 #include <linux/neighbour.h>
-#include <linux/netdevice.h>
 
 /* rtnetlink families. Values up to 127 are reserved for real address
  * families, values above 128 may be used arbitrarily.
@@ -606,6 +605,7 @@
 #ifdef __KERNEL__
 
 #include <linux/mutex.h>
+#include <linux/netdevice.h>
 
 static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
 {
#3 lore raw
Quoted 8 lines · Stephan Raue

Hi,

Am 16.11.2010 23:33, schrieb Andrew Morton:

Quoted 2 lines

Maybe we need some __KERNEL__ guards in if.h.

in the meantime i can build with attached patch.

I checked the source code of linux/if.h in my Gentoo, and found the conflict structures are renamed with __kernel_ prefix. Some changes in linux/if.h is needed maybe.

Signature · 2 lines
Regards,
Changli Gao([email protected])
maintainer
#4 lore raw
In reply to Andrew Morton

From: Andrew Morton <[email protected]>
Date: Tue, 16 Nov 2010 14:33:49 -0800

Quoted 1 line

Maybe we need some __KERNEL__ guards in if.h.

Already fixed in net-2.6:

From 3b42a96dc7870c53d20b419185737d3b8f7a7b74 Mon Sep 17 00:00:00 2001
From: Andy Whitcroft <[email protected]>
Date: Mon, 15 Nov 2010 06:01:59 +0000
Subject: [PATCH 1/3] net: rtnetlink.h -- only include linux/netdevice.h when used by the kernel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The commit below added a new helper dev_ingress_queue to cleanly obtain the ingress queue pointer. This necessitated including 'linux/netdevice.h':

commit 24824a09e35402b8d58dcc5be803a5ad3937bdba
Author: Eric Dumazet <[email protected]>
Date: Sat Oct 2 06:11:55 2010 +0000

net: dynamic ingress_queue allocation

However this include triggers issues for applications in userspace which use the rtnetlink interfaces. Commonly this requires they include 'net/if.h' and 'linux/rtnetlink.h' leading to a compiler error as below:

In file included from /usr/include/linux/netdevice.h:28:0,

                   from /usr/include/linux/rtnetlink.h:9,
                   from t.c:2:

/usr/include/linux/if.h:135:8: error: redefinition of ‘struct ifmap’ /usr/include/net/if.h:112:8: note: originally defined here /usr/include/linux/if.h:169:8: error: redefinition of ‘struct ifreq’ /usr/include/net/if.h:127:8: note: originally defined here /usr/include/linux/if.h:218:8: error: redefinition of ‘struct ifconf’ /usr/include/net/if.h:177:8: note: originally defined here

The new helper is only defined for the kernel and protected by __KERNEL__ therefore we can simply pull the include down into the same protected section.

---
 include/linux/rtnetlink.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/rtnetlink.h +1 -1
index d42f2744..bbad657 100644
@@ -6,7 +6,6 @@
 #include <linux/if_link.h>
 #include <linux/if_addr.h>
 #include <linux/neighbour.h>
-#include <linux/netdevice.h>
 
 /* rtnetlink families. Values up to 127 are reserved for real address
  * families, values above 128 may be used arbitrarily.
@@ -606,6 +605,7 @@ struct tcamsg {
 #ifdef __KERNEL__
 
 #include <linux/mutex.h>
+#include <linux/netdevice.h>
 
 static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
 {
Signature · 1 line
1.7.3.2