Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101487 - alsa-driver-1.0.9b / ipw2200 / software suspend 2 changes definition of 'create_workqueue'
Summary: alsa-driver-1.0.9b / ipw2200 / software suspend 2 changes definition of 'crea...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Henrik Brix Andersen
URL:
Whiteboard:
Keywords:
: 112768 113130 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-05 14:32 UTC by dynamotwain
Modified: 2005-11-21 00:56 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Completely untested patch (alsa-driver-1.0.9b-suspend2.patch,1.43 KB, patch)
2005-10-31 12:12 UTC, Henrik Brix Andersen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dynamotwain 2005-08-05 14:32:22 UTC
Compiling fails on a macro named create_workqueue... GCC says there should be
2 arguments... yet I `grep`ed for create_workqueue... All calling instances
only pass one argument.

In alsa-driver-1.0.9b/include/adriver.h, it is defined as:
#define create_workqueue(name) snd_compat_create_workqueue((name))

Only one argument... yet GCC says there should be two.

  LD [M]  /var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/snd-i2c.o
  CC [M] 
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/ak4114.o
In file included from
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/ak4114.c:1:
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/../../alsa-kernel/i2c/other/ak4114.c:109:49:
macro "create_workqueue" requires 2 arguments, but only 1 given
In file included from
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/ak4114.c:1:
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/../../alsa-kernel/i2c/other/ak4114.c:
In function `snd_ak4114_create':
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/../../alsa-kernel/i2c/other/ak4114.c:109:
error: `create_workqueue' undeclared (first use in this function)
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/../../alsa-kernel/i2c/other/ak4114.c:109:
error: (Each undeclared identifier is reported only once
/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/../../alsa-kernel/i2c/other/ak4114.c:109:
error: for each function it appears in.)
make[5]: ***
[/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other/ak4114.o]
Error 1
make[4]: ***
[/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c/other] Error 2
make[3]: *** [/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b/i2c]
Error 2
make[2]: ***
[_module_/var/tmp/portage/alsa-driver-1.0.9b/work/alsa-driver-1.0.9b] Error 2
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12-gentoo-r6'
make: *** [compile] Error 2


Reproducible: Always
Steps to Reproduce:
1. emerge =sys-devel/gcc-3.4.4
2. emerge =media-sound/alsa-drivers-1.0.9b
3. Wait for it...

Actual Results:  
Compilation errors out

Expected Results:  
I should have sound drivers installed

Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0,
2.6.11.8g1 i686)
=================================================================
System uname: 2.6.11.8g1 i686 Intel(R) Celeron(R) CPU 2.40GHz
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.10
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -march=pentium3 -mtune=pentium-m -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -march=pentium3 -mtune=pentium-m -fomit-frame-pointer
-pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.seren.com/gentoo
http://gentoo.chem.wisc.edu/gentoo/ http://gentoo.ccccom.com"
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="x86 X X509 a52 acpi acpi4linux alsa apm arts avi berkdb bitmap-fonts cddb
crypt cups dlloader dts dv dvd dvdr dvdread emboss encode esd fam fbcon ffmpeg
foomaticdb fortran freetype gd gdbm gif gimpprint glx gnome gpm gtk gtk2 hal
imagemagick imlib ipv6 java javascript jikes joystick jpeg kde libg++ libwww lzo
mad maildir mikmod mjpeg mmx mng motif mp3 mpeg mpeg4 msn music ncurses network
nls nptl nvidia oggvorbis opengl oss pam pda pdflib perl pic png python qt
quicktime readline real rtc samba sdk sdl skey slp spell sse sse2 ssl stroke svg
tcpd theora tiff timidity transcode truetype truetype-fonts type1-fonts usb
userlocales v4l v4l2 vhosts videos vim-with-x win32codecs winbind wmf wxwindows
xinerama xml2 xmms xosd xprint xrandr xv xvid xvmc zlib zvbi userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 dynamotwain 2005-08-05 14:45:56 UTC
I just checked on my other Gentoo install...
It compiles fine for me in gcc-3.4.3-20050110-r2
Comment 2 Mik 2005-08-24 20:43:26 UTC
I am using the hda-intel codec and have the same problem.  I have been able to
track this down to the definition of the __create_workqueue function and the two
macros create_workqueue and create_singlethread_workqueue in the kernel's
include/linux/workqueue.h

In the sys-kernel/gentoo-sources, __create_workqueue requires two parameters. 
The two macros require one parameter and supply the second to __create_workqueue.

In sys-kernel/suspend2-sources, __create_workqueue requires three parameters. 
The two macros require two parameters and supply the third to __create_workqueue.

The two alsa drivers in the suspend2-sources provide both parameters to the
macros.  The drivers in media-sound/alsa-driver do not.  This is what causes the
error message.

As near as I can figure from reading the kernel source, the correct call for
create_workqueue in the hda-codec looks like this:
  create_workqueue("hda_codec", 0);

-- Mik
Comment 3 dynamotwain 2005-08-25 05:29:32 UTC
Well, then...
Unless I want to patch alsa-kernel myself or goto plain vanilla sources,
I guess I'll have to wait for 2.6.13 to come out for working audio on my laptop.
Comment 4 Poggi Jérôme 2005-08-30 02:23:33 UTC
Same problem with net-wireless/ipw2200-1.0.6-r1, sys-devel/gcc-3.4.4-r1 and
sys-kernel/suspend2-sources-2.6.12-r5

>>> md5 src_uri ;-) ipw2200-1.0.6.tgz
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     2.6.12-suspend2-r5acpi-2.1.9.9
 * Checking for suitable kernel configuration options
>>> Unpacking source...
>>> Unpacking ipw2200-1.0.6.tgz to /var/tmp/portage/ipw2200-1.0.6-r1/work
 * Applying ipw2200-1.0.6-hwcrypt-wpa-fix4.patch ...                           
                                                                    [ ok ]
 * Applying ipw2200-1.0.6-suspend2.patch ...                                   
                                                                    [ ok ]
>>> Source unpacked.
 * 
 * You may safely ignore any errors from compilation that contain
 * warnings about undefined references to the ieee80211 subsystem.
 * 
 * Preparing ipw2200 module
mkdir -p /var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/tmp/.tmp_versions
cp /usr/include/*.mod
/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/tmp/.tmp_versions
cp: cannot stat `/usr/include/*.mod': No such file or directory
make: [modules] Error 1 (ignored)
make -C /usr/src/linux M=/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6
MODVERDIR=/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/tmp/.tmp_versions
modules
make[1]: Entering directory `/usr/src/linux-2.6.12-suspend2-r5'
  CC [M]  /var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.o
/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.c:10258:45: macro
"create_workqueue" requires 2 arguments, but only 1 given
/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.c: In function
`ipw_setup_deferred_work':
/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.c:10258: error:
`create_workqueue' undeclared (first use in this function)
/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.c:10258: error:
(Each undeclared identifier is reported only once
/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.c:10258: error: for
each function it appears in.)
make[2]: *** [/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6/ipw2200.o]
Error 1
make[1]: *** [_module_/var/tmp/portage/ipw2200-1.0.6-r1/work/ipw2200-1.0.6] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12-suspend2-r5'
make: *** [modules] Error 2

!!! ERROR: net-wireless/ipw2200-1.0.6-r1 failed.
!!! Function linux-mod_src_compile, Line 460, Exitcode 2
!!! Unable to make                                  KSRC=/usr/src/linux
KSRC_OUTPUT=/usr/src/linux IEEE80211_INC=/usr/include all.
!!! If you need support, post the topmost build error, NOT this status message.
Comment 5 Rumen Yotov 2005-09-14 09:41:49 UTC
Hi,
Also a problem with GCC-3.4.4-r1 and alsa-driver-1.0.9b, but rather different one.
alsa-driver-1.0.9b compiles/installs OK, only later 'alsasound' can't load the
modules, below are the logs from 'dmesg':
...BEGIN...
snd_page_alloc: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd_timer: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd_pcm: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd_ac97_codec: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd_seq_device: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd_rawmidi: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
snd_ens1371: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
'2.6.12-gentoo-r10 preempt K7 gcc-3.3'
...END...
As i have an older GCC-3.3.5 too (emerging 3.3.6 now), compiled alsa-driver with
it, and all works now w/o any other changes.
NOTE: my kernel-2.6.12-r10 is also compiled with 3.3.5 IIRC.
PS: same kind of problem with "nvidia-kernel" module, OK with GCC-3.3.5.
Thanks. Rumen
Comment 6 dynamotwain 2005-09-14 10:03:22 UTC
(In reply to comment #5)
> snd_page_alloc: version magic '2.6.12-gentoo-r10 preempt K7 gcc-3.4' should be
> '2.6.12-gentoo-r10 preempt K7 gcc-3.3'

Your kernel is compiled with gcc-3.3.x and you tried to install a module
compiled with gcc 3.4.y.

> As i have an older GCC-3.3.5 too (emerging 3.3.6 now), compiled alsa-driver with
> it, and all works now w/o any other changes.
> NOTE: my kernel-2.6.12-r10 is also compiled with 3.3.5 IIRC.
> PS: same kind of problem with "nvidia-kernel" module, OK with GCC-3.3.5.
> Thanks. Rumen

The kernel keeps track of which major-version of GCC was used to compile it, and
expects all modules to be compiled by the same major-version. I don't know the
exact reason, but I believe it is a safety thing. GCC has a habbit of changing
the way things work between major versions... 3.4 has pentium-m cpu tuning,
whereas 3.3 did not, register arguments might be passed in a different order, etc.

If you wish, recompile your kernel with GCC 3.4... then all your modules should
compile fine with it... if not, there's another bug involved.
If you don't want to do a kernel recompile, you can use gcc-config to switch
between gcc 3.3 and 3.4 before and after compiling modules, as they are
installed in different slots.

[I've renamed the bug, since it's been confirmed that swsusp2 is the problem,
not gcc.]
Comment 7 Henrik Brix Andersen 2005-10-31 12:12:22 UTC
Created attachment 71813 [details, diff]
Completely untested patch

This change of arguments was removed in >=sys-kernel/suspend2-sources-2.6.13 of
which -r4 was just marked stable on x86.

If you really want to use the external alsa-driver with
<=suspend2-sources-2.6.13 you can try this patch...
Comment 8 Henrik Brix Andersen 2005-11-01 06:40:15 UTC
Closing as WONTFIX.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-11-17 00:54:45 UTC
*** Bug 112768 has been marked as a duplicate of this bug. ***
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2005-11-21 00:56:41 UTC
*** Bug 113130 has been marked as a duplicate of this bug. ***