2004-10-30 12:27:11

by Martin Mokrejs

[permalink] [raw]
Subject: cannot compile 2.4.28-rc1-bk3

Hi,
has someone seen something like this?

gcc -D__KERNEL__ -I/usr/src/linux-2.4.28-rc1-bk3/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=neighbour -c -o neighbour.o neighbour.c
neighbour.c:1901: error: `THIS_MODULE' undeclared here (not in a function)
neighbour.c:1901: error: initializer element is not constant
neighbour.c:1901: error: (near initialization for `neigh_stat_seq_fops.owner')
make[3]: *** [neighbour.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.28-rc1-bk3/net/core'



gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/specs
Configured with: /var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,f77 --enable-threads=posix --enable-long-long --disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext --disable-multilib --enable-__cxa_atexit --enable-clocale=generic
Thread model: posix
gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)


I can provide .config if someone asks. Please Cc: me in replies.
Martin


2004-10-30 13:21:06

by Martin Mokrejs

[permalink] [raw]
Subject: Re: cannot compile 2.4.28-rc1-bk3

Another one:

gcc -D__KERNEL__ -I/usr/src/linux-2.4.28-rc1-bk3/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=arp -c -o arp.o arp.c
arp.c:1342: error: `THIS_MODULE' undeclared here (not in a function)
arp.c:1342: error: initializer element is not constant
arp.c:1342: error: (near initialization for `arp_seq_fops.owner')
make[3]: *** [arp.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.28-rc1-bk3/net/ipv4'



That can be fixed with:

--- net/ipv4/arp.c.orig 2004-10-30 15:18:41.000000000 +0200
+++ net/ipv4/arp.c 2004-10-30 15:18:44.000000000 +0200
@@ -76,6 +76,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/sched.h>
#include <linux/config.h>
#include <linux/socket.h>