FS#912 - Cannot load alsa-driver snd.o can't find kernel version

Attached to Project: Arch Linux
Opened by Kevin Piche (kpiche) - Saturday, 15 May 2004, 16:57 GMT
Last edited by Judd Vinet (judd) - Monday, 17 May 2004, 00:33 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

When trying to modprobe snd-maestro3 I get:

# modprobe snd-maestro3
/lib/modules/2.4.26/kernel/sound/acore/snd.o: couldn't find the kernel version the module was compiled for
/lib/modules/2.4.26/kernel/sound/acore/snd.o: insmod /lib/modules/2.4.26/kernel/sound/acore/snd.o failed
/lib/modules/2.4.26/kernel/sound/acore/snd.o: insmod snd-maestro3 failed
#

I have:
# pacman -Q kernel24 alsa-driver
kernel24 2.4.26-3
alsa-driver 1.0.4-4

Last version of alsa-driver that worked was pkgrel=2. If I remove pkgrel=4 and install 2 snd.o works again. If the snd.o modules are compared between the two packages the kernel string is contained in 2 but not 4.

pkgrel=4:
# strings snd.o |grep version
version
Compiled on May 15 2004 for kernel %s (SMP) with versioned symbols.
#

pkgrel=2
# strings snd.o |grep version
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
kernel_version=2.4.26
version
Compiled on Apr 15 2004 for kernel %s (SMP) with versioned symbols.
#
This task depends upon

Closed by  Judd Vinet (judd)
Tuesday, 18 May 2004, 00:06 GMT
Reason for closing:  Fixed
Comment by Kevin Piche (kpiche) - Saturday, 15 May 2004, 17:01 GMT
None of the alsa drivers (*.o) for pkgrel=4 have versions:
# pwd
/lib/modules/2.4.26/kernel/sound
# find -name '*.o' -exec strings {} \; |grep kernel_
snd_pcm_kernel_ioctl_Rsmp_dd6ed611
snd_pcm_kernel_capture_ioctl_Rsmp_3124c0ae
snd_pcm_kernel_playback_ioctl_Rsmp_a07af0f9
snd_rawmidi_kernel_write_Rsmp_8c17d27d
snd_rawmidi_kernel_read_Rsmp_ab112680
snd_rawmidi_kernel_release_Rsmp_e2221f12
snd_rawmidi_kernel_open_Rsmp_0de995ee
snd_seq_kernel_client_write_poll_Rsmp_3a94b9df
snd_seq_kernel_client_ctl_Rsmp_1a724fcc
snd_seq_kernel_client_dispatch_Rsmp_02f65ee4
snd_seq_kernel_client_enqueue_blocking_Rsmp_62a31e85
snd_seq_kernel_client_enqueue_Rsmp_4116c49d
snd_seq_delete_kernel_client_Rsmp_6bb71038
snd_seq_create_kernel_client_Rsmp_b1cf7ca6
#
Comment by Aurélien Gâteau (aurelien.gateau) - Saturday, 15 May 2004, 21:20 GMT
I have the same problem.
Comment by Kevin Piche (kpiche) - Sunday, 16 May 2004, 22:56 GMT
The new version of GCC optimizes out unreferenced static variables so the kernel_version string gets thrown out during the build. Compiling alsa-drivers with -O1 fixed this problem and now the modules work. There may be a way to compile with -O2 and disable a specific optimization.

Modified PKGBUILD build():
build() {
cd $startdir/src/$pkgname-$pkgver
cd utils
sed -i 's|/usr/bin/awk|/bin/awk|g' convert_isapnp_ids
cd ..
./configure --prefix=/usr
# Change optimization.
sed -i 's|\-O2|\-O1|g' Makefile.conf
make || return 1
make DESTDIR=$startdir/pkg install
rm -rf $startdir/pkg/lib/modules/2.4*/modules.*
}
Comment by Kevin Piche (kpiche) - Monday, 17 May 2004, 13:57 GMT
It's the new "unit-at-a-time" optimization that throws out unused statics. So alsa-drivers can be be compiled with -O2 -fno-unit-at-a-time. Here's an updated build():

build() {
cd $startdir/src/$pkgname-$pkgver
cd utils
sed -i 's|/usr/bin/awk|/bin/awk|g' convert_isapnp_ids
cd ..
./configure --prefix=/usr
# Disable gcc3.4 opt that removes kernel version string.
sed -i 's|\-pipe|\-pipe -fno-unit-at-a-time|g' Makefile.conf
make || return 1
make DESTDIR=$startdir/pkg install
rm -rf $startdir/pkg/lib/modules/2.4*/modules.*
}
Comment by Judd Vinet (judd) - Tuesday, 18 May 2004, 00:06 GMT
Thanks, Kevin!

The new alsa-driver package is going up now.

Loading...