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

Bug 342159

Summary: net-wireless/ndiswrapper-1.56 fails compilation under 2.6.36
Product: Gentoo Linux Reporter: Bob Raitz <pappy_mcfae>
Component: Current packagesAssignee: Christoph Mende (RETIRED) <angelos>
Status: RESOLVED FIXED    
Severity: normal CC: b.brachaczek, lozza.mario, melser_regs, mobile+disabled, octavsly
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Change ioctl to unlocked_ioctl ops
ndiswrapper ebuild using the SVN trunk

Description Bob Raitz 2010-10-22 09:28:57 UTC
Attempts to compile ndiswrapper against 2.6.36 result in failure.

Reproducible: Always

Steps to Reproduce:
1. compile net-wireless/ndiswrapper-1.56 against linux-2.6.36
2. compilation fails
3.




emerge --info

Portage 2.2_rc99 (default/linux/x86/10.0, gcc-4.3.2, glibc-2.12.1-r1, 2.6.36 i686)
=================================================================
System uname: Linux-2.6.36-i686-Intel-R-_Celeron-R-_M_CPU_440_@_1.86GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 22 Oct 2010 07:00:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.6.3, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.2::Local Portage Overlay
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.82
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
Repositories: gentoo x11 kde-sunset Local-Portage-Overlay Layman_overlays
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA Broadcom dlj-1.1 AdobeFlash-10.1"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=prescott -O2 -pipe"
DISTDIR="/mnt/auto/storage/distfiles"
FEATURES="assume-digests binpkg-logs distcc distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/x11 /var/lib/layman/kde-sunset /usr/local/portage /var/lib/layman"
SYNC="rsync://192.168.0.130/gentoo-portage"
USE="X a52 aac acl acpi alsa ao apache2 aspell audiofile avi bash-completion berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt css cups cxx dbus dlloader dri dts dv dvd dvdr dvdread eds encode fam fbcon ffmpeg fftw flac fontconfig foomaticdb fortran gdbm gif gimp glib gnutls gpm gsl gtk hal iconv jpeg kde ladspa lame libsamplerate mad mikmod mmx modules mp3 mpeg mudflap mysql nas ncurses nls nptl nptlonly objc ogg opengl openmp oss pam pdf perl php png pppd python qt3 qt3support quicktime readline reflection samba sdl session slang slp sndfile spell spl sqlite sse sse2 ssl svg swat sysfs tcpd theora tiff truetype udev unicode usb v4l v4l2 vhosts vidix vorbis wifi win32codecs wxwindows x264 x86 xine xml xorg xscreensaver xv xvid zlib" 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 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" 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" LINGUAS="en" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel v4l" 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, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Bob Raitz 2010-10-22 09:30:45 UTC
compilation results

Calculating dependencies  ... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) net-wireless/ndiswrapper-1.56 from Local-Portage-Overlay
 * ndiswrapper-1.56.tar.gz RMD160 SHA1 SHA256 size ;-) ...               [ ok ]
 * checking ebuild checksums ;-) ...                                     [ ok ]
 * checking auxfile checksums ;-) ...                                    [ ok ]
 * checking miscfile checksums ;-) ...                                   [ ok ]
 * Package:    net-wireless/ndiswrapper-1.56
 * Repository: Local-Portage-Overlay
 * Maintainer: peper@gentoo.org mobile@gentoo.org
 * USE:  elibc_glibc kernel_linux userland_GNU x86

 * See http://www.gentoo.org/doc/en/gentoo-kernel.xml
 * for a list of supported kernels.

 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/2.6.36/build
 * Found sources for kernel version:
 *     2.6.36
 * Checking for suitable kernel configuration options...
 [ ok ]
>>> Unpacking source...
>>> Unpacking ndiswrapper-1.56.tar.gz to /var/tmp/portage/net-wireless/ndiswrapper-1.56/work
>>> Source unpacked in /var/tmp/portage/net-wireless/ndiswrapper-1.56/work
>>> Preparing source in /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56 ...
 * Applying ndiswrapper-1.56-ldflags.patch ...
 [ ok ]
 * Applying ndiswrapper-1.56-2.6.35.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56 ...
make -j1 CC=i686-pc-linux-gnu-gcc 
i686-pc-linux-gnu-gcc -g -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=2.6.36 KBUILD=/lib/modules/2.6.36/build DISABLE_USB=1 all 
make -C /lib/modules/2.6.36/build M=/var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver
make[1]: Entering directory `/usr/src/linux-2.6.36'
  LD      /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/built-in.o
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/crt_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/hal_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/ndis_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/ntoskernel_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/ntoskernel_io_exports.h
  MKEXPORT /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/rtl_exports.h
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/crt.o
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/hal.o
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/iw_ndis.o
  CC [M]  /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/loader.o
/var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/loader.c:834: error: unknown field ‘ioctl’ specified in initializer
/var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/loader.c:834: warning: initialization from incompatible pointer type
make[2]: *** [/var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/loader.o] Error 1
make[1]: *** [_module_/var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.36'
make: *** [modules] Error 2
emake failed
 * ERROR: net-wireless/ndiswrapper-1.56 failed:
 *   Unable to emake HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS=  KSRC=/usr/src/linux KVERS=2.6.36 KBUILD='/lib/modules/2.6.36/build'  DISABLE_USB=1 all
 * 
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 3686:  Called linux-mod_src_compile
 *   environment, line 2813:  Called die
 * The specific snippet of code:
 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" 						CROSS_COMPILE=${CHOST}- 						LDFLAGS=\"$(get_abi_LDFLAGS)\" 						${BUILD_FIXES} 						${BUILD_PARAMS} 						${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";
 * 
 * If you need support, post the output of 'emerge --info =net-wireless/ndiswrapper-1.56',
 * the complete build log and the output of 'emerge -pqv =net-wireless/ndiswrapper-1.56'.
 * This ebuild is from an overlay named 'Local-Portage-Overlay': '/usr/local/portage/'
 * The complete build log is located at '/var/tmp/portage/net-wireless/ndiswrapper-1.56/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/ndiswrapper-1.56/temp/environment'.
 * S: '/var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56'

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

>>>  '/var/tmp/portage/net-wireless/ndiswrapper-1.56/temp/build.log'
Comment 2 Mario Lozza 2010-10-24 10:41:30 UTC
> /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/loader.c:834:
> error: unknown field ‘ioctl’ specified in initializer
> /var/tmp/portage/net-wireless/ndiswrapper-1.56/work/ndiswrapper-1.56/driver/loader.c:834:
> warning: initialization from incompatible pointer type

The problem is that the ioctl ops in struct file_operations is deprecated on 2.6.36. I should be converted to unlocked_ioctl ops.

I created a quick patch to make it working, simply converting ioctl to unlocked_ioctl, a little bit of test would be welcome.
Comment 3 Mario Lozza 2010-10-24 10:44:09 UTC
Created attachment 251791 [details, diff]
Change ioctl to unlocked_ioctl ops
Comment 4 Bob Raitz 2010-10-25 21:05:56 UTC
(In reply to comment #3)
> Created an attachment (id=251791) [details]
> Change ioctl to unlocked_ioctl ops
> 

The patch definitely works. The proof is I'm sending this via ndiswrapper. Thanks.
Comment 5 Bartosz Brachaczek 2010-10-27 23:25:37 UTC
I think there is no need for writing custom patches, as it is already fixed upstream for some time. See http://ndiswrapper.svn.sourceforge.net/viewvc/ndiswrapper?view=revision&revision=2726. I can confirm that the upstream patch works well.
Comment 6 Octavian 2010-11-18 15:36:23 UTC
Created attachment 254727 [details]
ndiswrapper ebuild using the SVN trunk 

I can also confirm that the upstream fix works with kernel 2.6.36.

I have attached a ndiswrapper build taking the SVN source. To be used until a proper ebuild appears in official tree.

Due to my limited ebuild knowledge I cannot judge if the ebuild is properly written. It is based on the ebuild from the offcial tree.
Comment 7 Christoph Mende (RETIRED) gentoo-dev 2010-12-14 18:49:49 UTC
+  14 Dec 2010; Christoph Mende <angelos@gentoo.org> ndiswrapper-1.56.ebuild,
+  +files/ndiswrapper-1.56-2.6.36.patch:
+  Imported upstream patch for 2.6.36 (bug 342159)