Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29965 - ALSA: alsa-driver 0.9.2 ebuild missing kernel 2.4.23-pre compile-fix patch
Summary: ALSA: alsa-driver 0.9.2 ebuild missing kernel 2.4.23-pre compile-fix patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL: http://www.gentoo.org/cgi-bin/viewcvs...
Whiteboard:
Keywords:
: 31045 31050 31337 31733 31815 31853 32677 (view as bug list)
Depends on: 31880
Blocks:
  Show dependency tree
 
Reported: 2003-09-29 17:57 UTC by Phattanon Duangdara
Modified: 2003-11-26 11:09 UTC (History)
18 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phattanon Duangdara 2003-09-29 17:57:15 UTC
Alsa driver 0.9.7 still need kernel 2.4.23-pre compile-fix patch. I have failed 
merge under 2.4.23-pre5.


Reproducible: Always
Steps to Reproduce:
1. use kernel 2.4.23-pre5 sources with /usr/src/linux
2. emerge alsa-driver

Actual Results:  
Compile error about procfs.

Expected Results:  
Finish compile successfully.

As ebuild of 0.9.7 src_unpack() comment there.

src_unpack() {
	unpack ${A}
	cd ${S}
	# The makefile still installs an alsasound initscript,
	# which we REALLY dont want.
	# This patch stops that
	epatch ${FILESDIR}/makefile.patch

	# Looks like the below are not needed as of 0.9.7.
	#epatch ${FILESDIR}/wolk.patch
	#epatch ${FILESDIR}/alsa-compile-fix
}
Comment 1 Hanno Böck gentoo-dev 2003-10-01 05:49:34 UTC
the pre-compile-fix no longer applies to alsa-driver-0.9.7, so it's probably
another bug. Maybe ask the alsa-devs for a patch that fixes compilation for
pre5?
Comment 2 Thomas Weidner 2003-10-02 07:17:45 UTC
i got alsa-driver 0.9.7 with linux 2.4.23-pre5 !
there is the fix.
replace the #if at adriver.h:130 with
#if    ( LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) \
      && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 5, 4) ) \
    || ( LINUX_VERSION_CODE <  KERNEL_VERSION(2, 5, 0) \
      && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 4, 23) ) \
    && !defined(WE_ARE_WOLK)

driver compiles and works. at least for me (-;
Comment 3 Thomas Weidner 2003-10-02 07:18:59 UTC
forgot one thing to consider,maybe this will break compilation on 2.4.23
pre-pre5 kernels.....
Comment 4 Andy Dustman 2003-10-09 20:41:22 UTC
I had the same problem with gs-sources-2.4.23_pre6-r1. I fixed it with this
patch:

--- include/adriver.h.orig      2003-09-30 04:54:47.000000000 -0400
+++ include/adriver.h   2003-10-09 22:44:24.000000000 -0400
@@ -127,7 +127,7 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 3) && !defined(need_resched)
 #define need_resched() (current->need_resched)
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 4) && !defined(WE_ARE_WOLK)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 23) && !defined(WE_ARE_WOLK)
 #include <linux/fs.h>
 static inline struct proc_dir_entry *PDE(const struct inode *inode)
 {

This is a much more brutal version of Thomas' fix; it could break on other
kernel trees/versions (but who cares about early 2.5 any more?). The error
(I don't have the exact error) results from PDE being defined in the kernel
tree and the alsa-driver code redefining it.
Comment 5 Joerg Schaible 2003-10-11 14:35:07 UTC
Although the new alsa-driver-0.9.7-r2.ebuild was released that tries to fix
the compile problem, it is still broken with the current gs-sources-2.4.23_pre6-r1
kernel.
Comment 6 Joerg Schaible 2003-10-11 14:41:47 UTC
See the correlating extract from the config.log:

=== snip ===
configure:4526: checking for PDE
configure:4550: gcc -c -mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer -foptimize-sibling-ca
lls -fprefetch-loop-arrays -falign-functions=32 -Wall -I/usr/src/linux/include
 conftest.c
>&5
configure: In function `main':
configure:4542: warning: implicit declaration of function `PDE'
configure:4553: $? = 0
configure:4556: test -s conftest.o
configure:4559: $? = 0
configure:4561: result: "no"
=== snap ===


and the log from the build itself:


=== snip ===
gcc -D__KERNEL__ -DMODULE=1 -I/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/include
 -I/usr/src/linux/include -O2  -DLINUX -Wall -Wstrict-prototypes -fomit-frame-pointer
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -DALSA_BUILD  -DKBUILD_BASENAME=sgbuf
  -c -o sgbuf.o sgbuf.c
In file included from memalloc.c:27:
/usr/src/linux/include/linux/proc_fs.h:213: redefinition of `PDE'
/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/include/adriver.h:133:
`PDE' previously defined here
make[1]: *** [memalloc.o] Error 1
=== snap ===
Comment 7 Joerg Schaible 2003-10-11 18:32:42 UTC
Additional problem: snd-pcm-oss and snd-mixer-oss modules are not build anymore
independ of the oss flag. And setting the flag, gives another set of compiling
errors:

gcc -D__KERNEL__ -DMODULE=1 -I/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/include
 -I/usr/src/linux/include -O2  -DLINUX -Wall -Wstrict-prototypes -fomit-frame-pointer
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -DALSA_BUILD
-I/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/alsa-kernel/usb
-E -D__GENKSYMS__ usbmidi.c
| /sbin/genksyms -k 2.4.23  >
/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/include/modules/usb__usbmidi.ver.tmp
mv
/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/include/modules/usb__usbmidi.ver.tmp
/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/include/modules/usb__usbmidi.ver
make[2]: Leaving directory `/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b/usb'
make[1]: Leaving directory `/var/tmp/portage/alsa-driver-0.9.7-r2/work/alsa-driver-0.9.7b'

!!! ERROR: media-sound/alsa-driver-0.9.7-r2 failed.
!!! Function src_compile, Line 68, Exitcode 2
!!! Parallel Make Failed
Comment 8 Eddy Mulyono 2003-10-11 19:26:41 UTC
system:
alsa-driver 0.9.7-r2
gs-sources 2.4.23_pre6-r1

problem:
conflict over PDE

possible cause:
ALSA's configure script is not detecting PDE properly. I think this should
considered a typo. Lines 1033 and 1034 are reversed. The section tests for
PDE, but "if-exist" pde_defined=0, and "if-not-exist" pde_defined=1

my fix:
$ ebuild <alsa-driver> unpack
Edit configure.in: Line 1033 should be 1034, vice versa.
$ autoconf
   generate new configure script using autoconf.
$ ebuild <alsa-driver> merge

additional comments:
This might be an ALSA bug instead of a Gentoo bug.
Comment 9 Phattanon Duangdara 2003-10-12 00:50:30 UTC
Are we should wait for 2.4.23 Vanilla kernel to be released. May the next
vanilla kernel likely to have same PDE defined.
Comment 10 Wolfram Schlich (RETIRED) gentoo-dev 2003-10-12 13:36:32 UTC
anyway, the alsa configure script PDE-check simply doesn't work. I've patched
it to include /usr/src/linux/include/linux/proc_fs.h in which the PDE stuff
is included. the configure check still fails.
Comment 11 Eddy Mulyono 2003-10-12 14:53:27 UTC
"anyway, the alsa configure script PDE-check simply doesn't work. I've patched
it to include /usr/src/linux/include/linux/proc_fs.h in which the PDE stuff
is included. the configure check still fails."

I did that too (patch proc_fs.h in). But the problem was in the "decision
tree" of the if-then-else in the script. After analysing the configure.in
(which contains macros expanded by GNU Autoconf to create the "configure"
script), these lines:

configure.in:

1026:AC_TRY_COMPILE([
1027:#define __KERNEL__
1028:#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
1029:#include "$CONFIG_SND_KERNELDIR/include/linux/fs.h"
1030:],[
1031:	PDE(NULL);
1032:],
1033:    AC_MSG_RESULT("no");pde_defined="0",
1034:    AC_MSG_RESULT("yes");pde_defined="1",
1035:    AC_MSG_RESULT("unknown");pde_defined="0"
1036:)

means "try compiling <argument 1> (the .c file); if successful, do <argument
2> (which says PDE is *NOT* detected), else do <argument 3>".

So by switching the lines 1033 and 1034, we can get a correct decision tree:
try compiling the a C source with PDE() function; if it works, then pde_(is_)defined.

I'll try to put a patch for this.

I wanted to tell the ALSA guys, but their mailing-list webfront is just too
messed up with all the spam warnings...

Namarie,

-LuminE (Eddy Mulyono)
Comment 12 Wolfram Schlich (RETIRED) gentoo-dev 2003-10-12 15:00:46 UTC
Great! But it should get through to the ALSA developers. Should I try?
Comment 13 Eddy Mulyono 2003-10-12 23:06:39 UTC
"Great! But it should get through to the ALSA developers. Should I try?"

You should! I'd appreciate it.

Please do tell me which mailing-list (or other channels of communication)
that you utilized to contact them.

Regards,

-LuminE (Eddy Mulyono)

Comment 15 Wolfram Schlich (RETIRED) gentoo-dev 2003-10-13 00:13:07 UTC
Erm whoops... no, they don't know their PDE detection is broken x) Will send
a mail to alsa-devel.
Comment 16 Wolfram Schlich (RETIRED) gentoo-dev 2003-10-13 04:20:00 UTC
Sent the mail, waiting for response.
Comment 17 Tim Yamin (RETIRED) gentoo-dev 2003-10-13 12:35:09 UTC
*** Bug 31045 has been marked as a duplicate of this bug. ***
Comment 18 Tim Yamin (RETIRED) gentoo-dev 2003-10-13 12:35:59 UTC
*** Bug 31050 has been marked as a duplicate of this bug. ***
Comment 19 David Arias 2003-10-15 19:54:49 UTC
Just letting you know, using ~x86: 
alsa-driver : 0.9.7-r3 : maestro3 module
as-sources : 2.4.23_pre6_aa3

Compile error, also gives PDE errors.
Comment 20 Joerg Schaible 2003-10-16 15:21:00 UTC
Still broken for new gs-sources-2.4.23_pre7!
Comment 21 Andy Dustman 2003-10-16 21:11:07 UTC
I did as Eddy suggested and came up with this patch:

--- configure.in.orig   2003-10-12 12:41:43.000000000 -0400
+++ configure.in        2003-10-17 00:01:10.000000000 -0400
@@ -1031,8 +1031,8 @@
 ],[
        PDE(NULL);
 ],
-    AC_MSG_RESULT("no");pde_defined="0",
     AC_MSG_RESULT("yes");pde_defined="1",
+    AC_MSG_RESULT("no");pde_defined="0",
     AC_MSG_RESULT("unknown");pde_defined="0"
 )
 CFLAGS=$ac_save_CFLAGS

Then in the ebuild, you must apply the patch and run autoconf (to remake
configure):

    # Looks like the below are not needed as of 0.9.7.
    #epatch ${FILESDIR}/wolk.patch
    #epatch ${FILESDIR}/alsa-compile-fix
    epatch ${FILESDIR}/fix-PDE-detection
    autoconf
}

This fixes the build for me on 0.9.7-r3.
Comment 22 Wolfram Schlich (RETIRED) gentoo-dev 2003-10-17 00:01:22 UTC
The PDE detection seems to be fixed in 0.9.7c:
http://freshmeat.net/releases/139126/
Someone should try that now ;)
Comment 23 Tim Yamin (RETIRED) gentoo-dev 2003-10-17 08:32:14 UTC
*** Bug 31337 has been marked as a duplicate of this bug. ***
Comment 24 James Doherty 2003-10-17 15:18:29 UTC
Switching the lines like Eddy said fixed the problem with my alsa-driver
ebuild. I'm using 2.4.23-pre7 and alsa-driver-0.9.7c
Comment 25 James 2003-10-20 00:16:09 UTC
This has been fixed in alsa-driver cvs using the following patch: -
--- configure.in.org    2003-10-20 03:09:17.000000000 -0400
+++ configure.in        2003-10-20 03:10:17.000000000 -0400
@@ -1029,10 +1029,11 @@
 #include "$CONFIG_SND_KERNELDIR/include/linux/fs.h"
 #include "$CONFIG_SND_KERNELDIR/include/linux/proc_fs.h"
 ],[
-       PDE(NULL);
+       struct proc_dir_entry * (*func)();
+       func = PDE;
 ],
-    AC_MSG_RESULT("no");pde_defined="0",
     AC_MSG_RESULT("yes");pde_defined="1",
+    AC_MSG_RESULT("no");pde_defined="0",
     AC_MSG_RESULT("unknown");pde_defined="0"
 )
 CFLAGS=$ac_save_CFLAGS
Comment 26 Tony Murray 2003-10-20 14:53:48 UTC
Could you guys put this fix into portage.  I have a how to and it is easier
to say ACCPET_KEYWORDS="~x86" emerge alsa-driver then explaing how to edit
the files mid ebuild then continue the ebuild...

It will be easy to remove once alsa finally fixes the problem...
Comment 27 Tim Yamin (RETIRED) gentoo-dev 2003-10-22 05:16:48 UTC
*** Bug 31733 has been marked as a duplicate of this bug. ***
Comment 28 Martin Holzer (RETIRED) gentoo-dev 2003-10-23 07:08:06 UTC
*** Bug 31815 has been marked as a duplicate of this bug. ***
Comment 29 Martin Holzer (RETIRED) gentoo-dev 2003-10-23 07:33:28 UTC
added 0.9.7-r4 with pde fix
Comment 30 Seemant Kulleen (RETIRED) gentoo-dev 2003-10-23 12:10:37 UTC
-r4 doesn't fix the PDE issue
Comment 31 SpanKY gentoo-dev 2003-10-23 22:04:47 UTC
*** Bug 31871 has been marked as a duplicate of this bug. ***
Comment 32 Martin Holzer (RETIRED) gentoo-dev 2003-10-23 23:31:34 UTC
*** Bug 31853 has been marked as a duplicate of this bug. ***
Comment 33 merwan kashouty 2003-10-24 07:50:59 UTC
echo the r4 doesnt fix the issue
Comment 34 Bardur Arantsson 2003-10-24 08:05:46 UTC
Bumping to ALSA version 0.9.8 fixes the problems for me.
Comment 35 merwan kashouty 2003-10-24 08:29:27 UTC
ok i'm an idiot... forgot ... the reason it doesnt work... is that you need
to rerun autoconf after the source is unpacked... so adding 

src_unpack() {
        unpack ${A}
        cd ${S}
        # The makefile still installs an alsasound initscript,
        # which we REALLY dont want.
        # This patch stops that
        epatch ${FILESDIR}/makefile.patch
                                                                        
       
        #this is not needed after 0.9.7c (Bug #29965)
        epatch ${FILESDIR}/${P}-pde.patch
        # Looks like the below are not needed as of 0.9.7.
        #epatch ${FILESDIR}/wolk.patch
        #epatch ${FILESDIR}/alsa-compile-fix
        autoconf
}

will emerge it just fine
Comment 36 Martin Holzer (RETIRED) gentoo-dev 2003-10-24 09:02:11 UTC
sorry, fixed in cvs

Comment 37 Seemant Kulleen (RETIRED) gentoo-dev 2003-11-03 13:43:57 UTC
this behaviour is happening to 0.9.2 as well, which is currently marked stable
Comment 38 Martin Holzer (RETIRED) gentoo-dev 2003-11-03 14:49:20 UTC
i wanna mark 0.9.8 stable
any comment ?
Comment 39 John Mylchreest (RETIRED) gentoo-dev 2003-11-03 15:03:21 UTC
I strongly agree with bumping 0.9.8 to stable.
Comment 40 Martin Holzer (RETIRED) gentoo-dev 2003-11-03 23:03:39 UTC
*** Bug 32677 has been marked as a duplicate of this bug. ***
Comment 41 Martin Holzer (RETIRED) gentoo-dev 2003-11-26 11:09:26 UTC
0.9.8 is stable