Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 467956

Summary: net-wireless/ndiswrapper-1.58 with vanilla-sources-3.9.0 - .../work/ndiswrapper-1.58/driver/loader.c:578:3: error: too few arguments to function ‘add_taint’
Product: Gentoo Linux Reporter: Bob Raitz <pappy_mcfae>
Component: Current packagesAssignee: Christoph Mende (RETIRED) <angelos>
Status: RESOLVED FIXED    
Severity: normal CC: pchrist
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ndiswrapper-1.58-add_taint.patch
Ebuild to go with ndiswrapper-1.58-add_taint.patch

Description Bob Raitz 2013-04-30 07:58:30 UTC
When compiled against linux-3.9.0 (vanilla or gentoo sources), ndiswrapper fails compilation.

OUTPUT:

emerge --nodeps -v ndiswrapper

These are the packages that would be merged, in order:

[ebuild   R    ] net-wireless/ndiswrapper-1.58  USE="-debug -usb" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


>>> Verifying ebuild manifests
>>> Running pre-merge checks for net-wireless/ndiswrapper-1.58
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.9.0/build
 * Found sources for kernel version:
 *     3.9.0
 * Checking for suitable kernel configuration options...                 [ ok ]

>>> Emerging (1 of 1) net-wireless/ndiswrapper-1.58
 * ndiswrapper-1.58.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...          [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.9.0/build
 * Found sources for kernel version:
 *     3.9.0
>>> Unpacking source...
>>> Unpacking ndiswrapper-1.58.tar.gz to /var/tmp/portage/net-wireless/ndiswrapper-1.58/work
>>> Source unpacked in /var/tmp/portage/net-wireless/ndiswrapper-1.58/work
>>> Preparing source in /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58 ...
 * Applying ndiswrapper-1.56-cflags.patch ...                            [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58 ...
make -j1 CC=i686-pc-linux-gnu-gcc 
i686-pc-linux-gnu-gcc -march=prescott -O2 -pipe -Wall -I../driver -Wl,-O1 -Wl,--as-needed -o loadndisdriver loadndisdriver.c
 * Preparing ndiswrapper module
make -j1 HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS= KSRC=/usr/src/linux KVERS=3.9.0 KBUILD=/lib/modules/3.9.0/build DISABLE_USB=1 all 
make -C /lib/modules/3.9.0/build M=/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver
make[1]: Entering directory `/usr/src/linux-3.9.0'
  LD      /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/built-in.o
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/crt_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/hal_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/ndis_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/ntoskernel_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/ntoskernel_io_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/rtl_exports.h
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/crt.o
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/hal.o
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/iw_ndis.o
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/loader.o
/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/loader.c: In function ‘load_user_space_driver’:
/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/loader.c:578:3: error: too few arguments to function ‘add_taint’
include/linux/kernel.h:404:13: note: declared here
make[2]: *** [/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver/loader.o] Error 1
make[1]: *** [_module_/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver] Error 2
make[1]: Leaving directory `/usr/src/linux-3.9.0'
make: *** [modules] Error 2
 * ERROR: net-wireless/ndiswrapper-1.58 failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=net-wireless/ndiswrapper-1.58'`,
 * the complete build log and the output of `emerge -pqv '=net-wireless/ndiswrapper-1.58'`.
 * The complete build log is located at '/var/tmp/portage/net-wireless/ndiswrapper-1.58/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/ndiswrapper-1.58/temp/environment'.
 * Working directory: '/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58/driver'
 * S: '/var/tmp/portage/net-wireless/ndiswrapper-1.58/work/ndiswrapper-1.58'

>>> Failed to emerge net-wireless/ndiswrapper-1.58, Log file:

>>>  '/var/tmp/portage/net-wireless/ndiswrapper-1.58/temp/build.log'

emerge --info:

Portage 2.1.11.62 (default/linux/x86/13.0, gcc-4.6.3, glibc-2.17, 3.8.5 i686)
=================================================================
System uname: Linux-3.8.5-i686-Intel-R-_Celeron-R-_M_CPU_440_@_1.86GHz-with-gentoo-2.2
KiB Mem:     2061876 total,    174916 free
KiB Swap:    2048280 total,   2048280 free
Timestamp of tree: Tue, 30 Apr 2013 06:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:          4.2_p45
dev-lang/python:          2.6.8-r1, 2.7.3-r3, 3.1.5-r1
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3::Local-Portage-Overlay
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.8 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo Local-Portage-Overlay
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x Oracle-BCLA-JavaSE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=prescott -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --quiet-build=n"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.0.105/gentoo-portage"
USE="X a52 aac acl acpi alsa ao apache2 apng aspell audiofile avi bash-completion berkdb bitmap-fonts bzip2 cairo cdr cgi cli consolekit cracklib crypt css cups cxx dbus declarative dlloader dri dts dv dvd dvdr dvdread eds encode fam fbcon ffmpeg fftw flac fontconfig fortran gdbm gif gimp gles2 glib gnutls gpm gsl gtk gudev handboook hwdb iconv icu jpeg kde kdenlive ladspa lame libkms libsamplerate lm_sensors mad mikmod mmx mng modules mp3 mp4 mpeg mudflap mysql nas ncurses nls nptl nptlonly objc ogg opengl openmp oss pam pcre pdf perl php png pyqt4 python qt3support qt4 quicktime readline reflection samba script sdl semantic-desktop session slang slp sndfile spell spl sql sqlite sse sse2 ssl startup-notification svg swat tcpd theora thunar tiff truetype udev unicode upcall usb v4l v4l2 vaapi vhosts vidix vorbis webkit wifi win32codecs wxwindows x264 x86 xcb xine xml xorg xscreensaver xv xvid zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_6 python2_7 python3_1" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Bob Raitz 2013-05-08 06:02:20 UTC
Created attachment 347704 [details, diff]
ndiswrapper-1.58-add_taint.patch

This patch fixes this particular issue when used in conjunction with a modified ebuild that will be attached after this. I may play with this, and see if I can make it kernel version aware. If someone wants to beat me to the punch, that's cool, too. As long as it gets fixed, it matters not from whence the fix arose. The original patch is located here

https://gist.github.com/shimarin/5493086
Comment 2 Bob Raitz 2013-05-08 06:08:18 UTC
Created attachment 347706 [details]
Ebuild to go with ndiswrapper-1.58-add_taint.patch

This is the full ebuild with ndiswrapper-1.58-add_taint.patch included. I am going to experiment to see if I can make an ebuild that is kernel version sensitive. 

Any successes will be posted.

Origin: https://gist.github.com/shimarin/5493086
Comment 3 Thomas Nichols 2013-05-19 00:52:11 UTC
(In reply to comment #2)
> Created attachment 347706 [details]
> Ebuild to go with ndiswrapper-1.58-add_taint.patch

I tested this on a ~x86 box and it allows ndiswrapper to build with gcc 4.5.3-r1, kernel gentoo-sources-3.9.0. A Ralink driver loads successfully with
    `ndiswrapper -i /path/to/rt2870.inf`

The USB wifi device is not fully functional: `ndiswrapper -l` shows the rt2870 driver but no device - but this may be a hardware error. This hardware also fails with the rt2800usb kernel support.

Overlay with this patch is at https://github.com/thomasn/twixbox-overlay if anyone else wants to test.
Thanks,
Thomas
Comment 4 Christoph Mende (RETIRED) gentoo-dev 2013-05-19 16:56:16 UTC
Fixed in CVS. Couldn't use your patch though. For the next patch you post, please ensure that it also works on older versions. Also, please apply ebuild diffs instead of full ebuilds.
Comment 5 Thomas Nichols 2013-05-25 23:17:10 UTC
(In reply to Thomas Nichols from comment #3)
> (In reply to comment #2)
> > Created attachment 347706 [details]
> > Ebuild to go with ndiswrapper-1.58-add_taint.patch
> 
> I tested this on a ~x86 box and it allows ndiswrapper to build with gcc
> 4.5.3-r1, kernel gentoo-sources-3.9.0. A Ralink driver loads successfully
> with
>     `ndiswrapper -i /path/to/rt2870.inf`
> 
> The USB wifi device is not fully functional: `ndiswrapper -l` shows the
> rt2870 driver but no device - but this may be a hardware error. This
> hardware also fails with the rt2800usb kernel support.
> 
> Overlay with this patch is at https://github.com/thomasn/twixbox-overlay if
> anyone else wants to test.
> Thanks,
> Thomas

Confirming that the patched ndiswrapper is working with a known-good USB adapter:

thebe ~ # lsusb | grep WLAN
Bus 004 Device 004: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
thebe ~ # ndiswrapper -l
net8192cu : driver installed
        device (0BDA:8178) present
rt2870 : driver installed
thebe ~ # uname -a
Linux thebe 3.9.0-gentoo #2 SMP Sat May 18 02:28:44 BST 2013 i686 Intel(R) Pentium(R) M processor 1.80GHz GenuineIntel GNU/Linux