---emerge info--- Portage 2.0.51-r8 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.9-nitro4 i686) ================================================================= System uname: 2.6.9-nitro4 i686 Mobile Intel(R) Pentium(R) 4 CPU 3.06GHz Gentoo Base System version 1.6.8 Python: dev-lang/python-2.3.4 [2.3.4 (#1, Nov 29 2004, 02:03:22)] dev-lang/python: 2.3.4 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.8.5-r2, 1.6.3, 1.9.3, 1.5, 1.7.9 sys-devel/binutils: 2.15.92.0.2-r2 sys-devel/libtool: 1.5.10-r2 virtual/os-headers: 2.6.8.1-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=pentium4m -pipe -O2 -fomit-frame-pointer -fforce-addr -frename-registers -fprefetch-loop-arrays -falign-functions=64" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4m -pipe -O2 -fomit-frame-pointer -fforce-addr -frename-registers -fprefetch-loop-arrays -falign-functions=64" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms" GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ http://gentoo.mirrors.pair.com/ ftp://gentoo.mirrors.pair.com/ http://gentoo.ccccom.com ftp://gentoo.ccccom.com http://lug.mtu.edu/gentoo/ ftp://lug.mtu.edu/gentoo/source" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups encode esd f77 fam flac foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imagemagick imlib java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl snmp spell ssl svga tcpd tiff truetype x86 xml2 xmms xv zlib" --emerge info--- I'm getting the following error when attempting to compile net-wireless/ndiswrapper-0.12: ---snip--- >>> emerge (1 of 1) net-wireless/ndiswrapper-0.12 to / >>> md5 src_uri ;-) ndiswrapper-0.12.tar.gz >>> Unpacking source... * /usr/src/linux is a symbolic link * Determining the real directory of the Linux kernel source code * Building for Linux 2.6.9-nitro4 found in /usr/src/linux >>> Unpacking ndiswrapper-0.12.tar.gz to /var/tmp/portage/ndiswrapper-0.12/work >>> Source unpacked. make -C driver make[1]: Entering directory `/var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver' make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. make -C //usr/src/linux M=/var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver \ NDISWRAPPER_VERSION=0.12 \ EXTRA_VERSION= modules make[2]: Entering directory `/usr/src/linux-2.6.9-nitro4' CC [M] /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/wrapper.o CC [M] /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.o /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c: In function `wpa_set_key': /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c:1365: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c:1367: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c:1370: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c:1373: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c: In function `wpa_associate': /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c:1522: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/iw_ndis.c:1524: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result CC [M] /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/pe_loader.o CC [M] /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ndis.o CC [M] /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.o /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.c:747:24: macro "kthread_run" requires 5 arguments, but only 3 given /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.c: In function `PsCreateSystemThread': /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.c:743: error: `kthread_run' undeclared (first usein this function) /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.c:743: error: (Each undeclared identifier is reported only once /var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.c:743: error: for each function it appears in.) make[3]: *** [/var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver/ntoskernel.o] Error 1 make[2]: *** [_module_/var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver] Error 2 make[2]: Leaving directory `/usr/src/linux-2.6.9-nitro4' make[1]: *** [default] Error 2 make[1]: Leaving directory `/var/tmp/portage/ndiswrapper-0.12/work/ndiswrapper-0.12/driver' make: *** [all] Error 2 ---snip---
The problem results in patches from software suspend, which apparently are applied by your non-standard kernel patch set. The problem is basically that the software suspend patch modifies the kthread_run macro. There is an #ifdef statement there to handle the situation when the patch is applied and enabled. However if you didn't enable software suspend, then we can't apply the fix. So basically you have a patch that you're not using in your kernel which is causing an issue. This is why non-standard kernels are not supported. Now kthread_run is a variable length macro but in a standard kernel requires 3 arguments and in a modified kernel requires 5 (but defaults one). If anyone can think of a graceful way handling the situation that'd be nice. Right now the graceful situation I'm thinking is to detect if Software Suspend was added to the kernel with an ugly grep of /usr/src/linux/.config and failing with a msg. Since ndiswrapper doesn't work when software suspend is enabled either so fixing it, so it compiles does us no good.
I was kind enough to add a test for your situation and report back with an error msg pointing you to this bug. Go ahead and test to new ebuild. It'll validate my theory.
Same problem with vanilla kernel (development-sources) 2.6.11-rc3 and software suspend added as a module (maybe also statically) I solved this by modifing the ebuild, adding a patch to change the #ifdef CONFIG_SOFTWARE_SUSPEND ... #endif with the #define KTHREAD_RUN(a,b,c) kthread_run(a,b,0) ebuild and patch follow as attachments
Created attachment 50861 [details] ndiswrapper 1.0 ebuild which patches ntoskernel.h
Created attachment 50862 [details, diff] patch to ntoskernel.h for ndiswrapper 1.0