1. The ebuild will (silently) fail on the svgalib_helper line in the ebuild This is caught again later during the install process when make will bomb out trying to recompile to meet dependencies. example: make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/doc' (cd kernel/svgalib_helper ; make modules_install ) make[1]: Entering directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper' cc -D__KERNEL__ -DMODULE -Wall -O2 -I/usr/src/linux/include -DSVGALIB_HELPER_MAJOR=209 -c -o main.o main.c main.c:18:40: missing binary operator before '(' In file included from main.c:27: /usr/src/linux/include/asm/irq.h:16:25: irq_vectors.h: No such file or directory main.c: In function `svgalib_helper_ioctl': main.c:295: warning: implicit declaration of function `request_irq' main.c:312: warning: implicit declaration of function `free_irq' main.c:115: warning: `i' might be used uninitialized in this function main.c:400:41: missing binary operator before '(' main.c: In function `svgalib_helper_mmap': main.c:403: structure has no member named `vm_offset' main.c:412:41: missing binary operator before '(' main.c:421:41: missing binary operator before '(' main.c: In function `__initfn': main.c:439: warning: implicit declaration of function `devfs_register_chrdev' main.c:519: warning: implicit declaration of function `devfs_unregister_chrdev' make[1]: *** [main.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper' make: *** [installmodule] Error 2 !!! ERROR: media-libs/svgalib-1.9.16 failed. !!! Function src_install, Line 48, Exitcode 2 !!! (no error message) 2. svga helper does not build at least with 2.5.4X kernels ===/usr/src/linux/include/asm/irq.h: #include <linux/config.h> #include <linux/sched.h> /* include comes from machine specific directory */ #include "irq_vectors.h" ^^^--- in this case this is /usr/src/linux/arch/i386/mach-generic (on my machine) This hack to src_compile() will fix it (line 88 or so) make INCLUDEDIR="/usr/src/linux/include -I/usr/src/linux/arch/i386/mach-generic" \ -C kernel/svgalib_helper || die 3. svga_helper will still fail ;) FIX: need to add #include <linux/version.h> to kernel/svga_helper/main.c edit ebuild and add: cd ${S}; epatch ${FILESDIR}/${P}-m.diff to src_unpack(), and then add this small patch to the files directory root@nipplehead svgalib # more files/svgalib-1.9.16-m.diff --- svgalib-1.9.16/kernel/svgalib_helper/main.c 2002-07-26 13:58:31.000000000 +0000 +++ svgalib-1.9.16/kernel/svgalib_helper/main.c 2002-11-22 18:12:44.000000000 +0000 @@ -15,6 +15,7 @@ #include <linux/sched.h> #include <linux/wait.h> +#include <linux/version.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "kernel25compat.h" #endif
what kernel are you running also, please check your /usr/src/linux/ to make sure everything is setup
Kernel is either dev-sources 2.5.48, or fresh bitkeeper and yes /usr/src/linux is setup. This is a 2.5 issues, so im mostly just posting so people know what to expect.
I had first committed svgalib-1.9.16.ebuild to bugzilla with the kernel module's installation removed. This is a personal preference, i.e. I don't like kernel modules to be bundled within ebuilds, since I usually have more than one kernel to boot from, and/or update it regularly. This seems to be the case for you, pee, too. I just remembered this now and came to bugzilla to post the modified ebuild. Fortunately, Martin Schlemmer, who finally committed the ebuild to the official portage tree, added the kernel module back before doing so. Thanks Martin for noticing it and pee for the fix to compile the module on development kernels. Also, what do you think about the option to isolate the kernel modules from standard ebuilds? What I do now is having a folder in /usr/src where I keep a copy of all the kernel module's sources which come with different ebuilds, e.g. mplayer, svgalib, ... In addition I comment out the module installation in the corresponding ebuild. This way, I can emerge/unmerge those packages without deleting the module from the kernel tree and at the same time I can have various kernels with their own modules, which I have to build manually whenever I compile a new kernel. Probably, some other approach, to do it more elegantly might be interesting to add. Comments, ideas, flames?
Hi! the svgalib-1.9.16 fails for me too. I'm running gentoo-sources 2.4.19-r9, an 1.4rc machine with all the latest packages (well, almost), and ACCEPT_KEYWORDS="~x86" the build fails... And grepping through the output i get the following interesting points. [output] make[1]: Entering directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/sharedlib' ln: `../src/svgalib_helper.h': File exists make[1]: *** [.depend.src] Error 1 make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/sharedlib' [more output] make: Entering directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper' cc -D__KERNEL__ -DMODULE -Wall -O2 -I/usr/src/linux/include -DSVGALIB_HELPER_MAJOR=209 -M *.c > .depend In file included from /usr/src/linux/include/linux/sched.h:30, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from /usr/src/linux/include/asm/pci.h:32, from /usr/src/linux/include/linux/pci.h:614, from interrupt.c:1: /usr/src/linux/include/linux/grsecurity.h:12:26: linux/grdefs.h: No such file or directory /usr/src/linux/include/linux/grsecurity.h:43:25: linux/grmsg.h: No such file or directory In file included from /usr/src/linux/include/linux/sched.h:30, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/src/linux/include/linux/grsecurity.h:12:26: linux/grdefs.h: No such file or directory /usr/src/linux/include/linux/grsecurity.h:43:25: linux/grmsg.h: No such file or directory In file included from main.c:19: kernel25compat.h:1:1: warning: "minor" redefined In file included from /usr/src/linux/include/linux/fs.h:16, from /usr/src/linux/include/linux/capability.h:17, from /usr/src/linux/include/linux/binfmts.h:6, from /usr/src/linux/include/linux/sched.h:10, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/include/linux/kdev_t.h:81:1: warning: this is the location of the previous definition make: *** [.depend] Error 1 make: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper' [more output] cc -Wall -Wstrict-prototypes -march=athlon-tbird -O3 -pipe -I/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/inclu de -I/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/gl -c -o mkcur.o mkcur.c cc -o buildcsr mkcur.o -lvgagl -lvga mkcur.o(.text+0x244): In function `main': : undefined reference to `vga_setcursorimage' mkcur.o(.text+0x250): In function `main': : undefined reference to `vga_selectcursor' mkcur.o(.text+0x3fb): In function `main': : undefined reference to `vga_setcursorposition' mkcur.o(.text+0x407): In function `main': : undefined reference to `vga_showcursor' mkcur.o(.text+0x41e): In function `main': : undefined reference to `vga_showcursor' mkcur.o(.text+0x49e): In function `main': : undefined reference to `vga_showcursor' mkcur.o(.text+0x591): In function `main': : undefined reference to `vga_setcursorimage' mkcur.o(.text+0x59d): In function `main': : undefined reference to `vga_selectcursor' mkcur.o(.text+0x605): In function `main': : undefined reference to `vga_initcursor' mkcur.o(.text+0x63f): In function `main': : undefined reference to `vga_setcursorimage' mkcur.o(.text+0x64b): In function `main': : undefined reference to `vga_selectcursor' mkcur.o(.text+0x6c6): In function `main': : undefined reference to `vga_setcursorimage' mkcur.o(.text+0x836): In function `main': : undefined reference to `vga_initcursor' mkcur.o(.text+0x8ec): In function `setcursor': : undefined reference to `vga_setcursorimage' mkcur.o(.text+0x90b): In function `setcursor': : undefined reference to `vga_setcursorimage' mkcur.o(.text+0x913): In function `setcursor': : undefined reference to `vga_selectcursor' mkcur.o(.text+0x972): In function `setcursor': : undefined reference to `vga_initcursor' collect2: ld returned 1 exit status make[1]: *** [buildcsr] Error 1 make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/demos' [more output] (cd kernel/svgalib_helper ; make modules_install ) make[1]: Entering directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper' cc -D__KERNEL__ -DMODULE -Wall -O2 -I/usr/src/linux/include -DSVGALIB_HELPER_MAJOR=209 -c -o main.o main.c In file included from /usr/src/linux/include/linux/sched.h:29, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/include/linux/fs_struct.h: In function `set_fs_root': /usr/include/linux/fs_struct.h:34: `current' undeclared (first use in this function) /usr/include/linux/fs_struct.h:34: (Each undeclared identifier is reported only once /usr/include/linux/fs_struct.h:34: for each function it appears in.) In file included from /usr/src/linux/include/linux/sched.h:29, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/include/linux/fs_struct.h: In function `set_fs_pwd': /usr/include/linux/fs_struct.h:57: `current' undeclared (first use in this function) In file included from /usr/src/linux/include/linux/sched.h:30, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/src/linux/include/linux/grsecurity.h:12:26: linux/grdefs.h: No such file or directory /usr/src/linux/include/linux/grsecurity.h:43:25: linux/grmsg.h: No such file or directory In file included from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/src/linux/include/linux/sched.h: At top level: /usr/src/linux/include/linux/sched.h:171: warning: type mismatch with previous implicit declaration /usr/include/linux/fs_struct.h:62: warning: previous implicit declaration of `preempt_schedule' /usr/src/linux/include/linux/sched.h:171: warning: `preempt_schedule' was previously implicitly declared to return `in t' In file included from main.c:19: kernel25compat.h:1:1: warning: "minor" redefined In file included from /usr/src/linux/include/linux/fs.h:16, from /usr/src/linux/include/linux/capability.h:17, from /usr/src/linux/include/linux/binfmts.h:6, from /usr/src/linux/include/linux/sched.h:10, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/include/linux/kdev_t.h:81:1: warning: this is the location of the previous definition make[1]: *** [main.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper' make: *** [installmodule] Error 2 !!! ERROR: media-libs/svgalib-1.9.16 failed. !!! Function src_install, Line 48, Exitcode 2 !!! (no error message) The funny thing is, that I have no grsecurity compiled in at all!
Could be an option to disable the module support, as myself have had a few issues to get it to work with some boxes. I however left it as is to check user responce (it is after all marked unstable).
Javier, I dont have the time, so cant really test it, but is it possible for 1.9.16 to work without the kernel module ?
I see that they still did not have that included in svgalib-1.9.17, although relevant bits have now moved to kernel/svgalib_helper/kernel25compat.h itself. Is this still an issue for 1.9.17 ?
*** Bug 12788 has been marked as a duplicate of this bug. ***
Ok, svgalib-1.9.17-r1 should work fine with kernel 2.5.
gunzipping manpages in man8 make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/doc' (cd kernel/svgalib_helper ; make modules_install ) /bin/sh: line 1: [: /usr/src/linux/include: binary operator expected grep: invalid option -- / Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. make[1]: Entering directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper' Makefile:6: *** commands commence before first target. Stop. make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper' make: *** [installmodule] Error 2 !!! ERROR: media-libs/svgalib-1.9.17-r1 failed. !!! Function src_install, Line 96, Exitcode 2 !!! (no error message)
Ok, I should not be so lazy, patched the Makefile and removed the hack. Here is the ChangeLog entry: ------------------------------- 31 Dec 2002; Martin Schlemmer <azarah@gentoo.org> svgalib-1.9.17-r1.ebuild : Ok, I should not be lazy, patch Makefile in svga_helper module, as my previous hack seems to fail for some people ... (bug #11092).
Solved for me.
make: Entering directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper' cc -O2 -DLINUX -Dlinux -D__KERNEL__ -DMODULE -Wall -I/usr/src/linux/include -DSVGALIB_HELPER_MAJOR=209 -M *.c > .depend In file included from /usr/src/linux/include/linux/fs.h:334, from /usr/src/linux/include/linux/capability.h:17, from /usr/src/linux/include/linux/binfmts.h:5, from /usr/src/linux/include/linux/sched.h:9, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from /usr/src/linux/include/asm/pci.h:32, from /usr/src/linux/include/linux/pci.h:610, from interrupt.c:1: /usr/src/linux/include/linux/xfs_fs_i.h:39: linux/vnode.h: No such file or directory In file included from /usr/src/linux/include/linux/fs.h:385, from /usr/src/linux/include/linux/capability.h:17, from /usr/src/linux/include/linux/binfmts.h:5, from /usr/src/linux/include/linux/sched.h:9, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from /usr/src/linux/include/asm/pci.h:32, from /usr/src/linux/include/linux/pci.h:610, from interrupt.c:1: /usr/src/linux/include/linux/quota.h:138: linux/dqblk_v1.h: No such file or directory In file included from /usr/src/linux/include/linux/fs.h:334, from /usr/src/linux/include/linux/capability.h:17, from /usr/src/linux/include/linux/binfmts.h:5, from /usr/src/linux/include/linux/sched.h:9, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/src/linux/include/linux/xfs_fs_i.h:39: linux/vnode.h: No such file or directory In file included from /usr/src/linux/include/linux/fs.h:385, from /usr/src/linux/include/linux/capability.h:17, from /usr/src/linux/include/linux/binfmts.h:5, from /usr/src/linux/include/linux/sched.h:9, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from main.c:4: /usr/src/linux/include/linux/quota.h:138: linux/dqblk_v1.h: No such file or directory make: *** [.depend] Error 1 make: Leaving directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper' !!! ERROR: media-libs/svgalib-1.9.17-r1 failed. !!! Function src_compile, Line 41, Exitcode 2 !!! Failed to build kernel module!
Would help if we knew what kernel version ...
Stand by. It looks like I may have done an emerge -u on my kernel sources, and /usr/src/linux is still pointing to the old (patched) version, which portage decided to clean out. Doh! Mikki
Yup, that was it. Works fine for me now... Sorry about that.
Found the same problem with svgalib-1.9.17-r1. Problem solved once /usr/src/linux is linked to latest kernel and run make menu/x/config and saved kernel Henti
Again a kernel version issue. --- Linux nuovo.casa.it 2.5.47-ac5 #3 Fri Nov 15 23:36:40 CET 2002 i686 Pentium II (Klamath) GenuineIntel GNU/Linux !!! ERROR: media-libs/svgalib-1.9.17-r1 failed. !!! Function check_kernel, Line 54, Exitcode 1 !!! Cannot find kernel includes! --- check_kernel is looking for /usr/src/linux/include/asm/mach-{default|generic} but in kenerl 2.5.47 there is none of them. Probably they are just in newer kernels. The point is that I've tried also with the stable 2.4.20 includes, but check_kernel checks the major.minor version of the running kernel instead of getting it from version.h That is to compile svgalib I should reboot the computer with 2.4.20 otherwise I can't. Should this be considered a bug?
Its changes to the api, not missing dirs. If you look, you do have a include/asm/mach-default with 2.5.58 and later i think. ---------------------------------------- nosferatu root # ls /usr/src/linux/include/asm/mach-default/ -ld drwxrwxr-x 2 1046 101 4096 Feb 24 21:06 /usr/src/linux/include/asm/mach-default/ nosferatu root # uname -r 2.5.63bk2 nosferatu root # ---------------------------------------- The actual error: ---------------------------------------- gcc -O2 -DLINUX -Dlinux -D__KERNEL__ -DMODULE -Wall -I/usr/src/linux/include -I/usr/src/linux/include/asm/mach-default -DSVGALIB_HELPER_MAJOR=209 -c -o main.o main.c main.c: In function `svgalib_helper_ioctl': main.c:298: warning: implicit declaration of function `request_irq' main.c:315: warning: implicit declaration of function `free_irq' main.c:109: warning: `i' might be used uninitialized in this function main.c: In function `svgalib_helper_open': main.c:338: warning: `_MOD_INC_USE_COUNT' is deprecated (declared at /usr/src/linux/include/linux/module.h:462) main.c: In function `svgalib_helper_release': main.c:344: warning: `__MOD_DEC_USE_COUNT' is deprecated (declared at /usr/src/linux/include/linux/module.h:437) main.c: In function `init_module': main.c:442: warning: implicit declaration of function `devfs_register_chrdev' main.c:457: warning: implicit declaration of function `devfs_register_series' main.c:461: warning: implicit declaration of function `devfs_auto_unregister' main.c:515: `EXPORT_NO_SYMBOLS' undeclared (first use in this function) main.c:515: (Each undeclared identifier is reported only once main.c:515: for each function it appears in.) main.c:522: warning: implicit declaration of function `devfs_unregister_chrdev' make: *** [main.o] Error 1 ----------------------------------------- Like I said, API changes ...
I know, and what about checking the installed kernel sources instead of the running kernel? At least people running kernel 2.5 can compile it installing a 2.4 without needing a 2.4 kernel running. Here's the patch. --- svgalib-1.9.17-r1.ebuild 2003-03-03 20:57:48.000000000 +0100 +++ new/svgalib-1.9.17-r1.ebuild 2003-03-03 21:23:54.000000000 +0100 @@ -35,8 +35,8 @@ check_kernel() { - local KV_MAJOR="`uname -r | cut -d. -f1`" - local KV_MINOR="`uname -r | cut -d. -f2`" + local KV_MAJOR="`sed -n -e 's/^VERSION = \([0-9]*\)$/\1/p' /usr/src/linux/Makefile`" + local KV_MINOR="`sed -n -e 's/^PATCHLEVEL = \([0-9]*\)$/\1/p' /usr/src/linux/Makefile`" export INCLUDEDIR="/usr/src/linux/include" # Are we running kernel 2.5 ? ----
Ok, so how is going to get it compiled, but not being able to load the module anyhow going to help you ?
Good point. Now there is just one check if the running kernel is a 2.4 or a 2.5 and if it's a 2.5, the INCLUDEDIR is set for kernels >=2.5.58 (assuming that the include dir asm/mach-* is there with those versions). But there is NO check if the /usr/src/linux/ is the one of the running kernel. So my patch didn't change things so much. If you like more I can just add the check of the sublevel for 2.5.* like that: ---- --- svgalib-1.9.17-r1.ebuild 2003-03-03 20:57:48.000000000 +0100 +++ new2/svgalib-1.9.17-r1.ebuild 2003-03-06 00:13:36.000000000 +0100 @@ -37,10 +37,11 @@ local KV_MAJOR="`uname -r | cut -d. -f1`" local KV_MINOR="`uname -r | cut -d. -f2`" + local KV_SUBLEVEL="`uname -r|sed -n -e 's/[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/p'`" export INCLUDEDIR="/usr/src/linux/include" - # Are we running kernel 2.5 ? - if [ "${KV_MAJOR}${KV_MINOR}" -gt "24" ] + # Are we running kernel 2.5 > 2.5.57 ? + if [ "${KV_MAJOR}${KV_MINOR}" -gt "24" -a $(KV_SUBLEVEL) -gt "57" ] then # Setup the proper mach include directory ... if [ -d ${INCLUDEDIR}/asm/mach-default ] ---- This way it works also for my 2.5.47, but there is still no check if the module is built for the running kernel. In my opinion it makes no sense to set the include path of the installed kernel according to the one that is currently running without knowing if they are the same.
Here is a dumb patch for svgalib_helper (seems to work...)
Created attachment 10577 [details, diff] svgalib_helper patch This is a dumb patch, but seems to work.
Bedeox, your patch work wonderfully for the devfs stuff, but it fails with what looks like an improper usage of grep: make: Entering directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/threeDKit' rm -f lib3dkit.a ar rcs lib3dkit.a make: Leaving directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/threeDKit' /bin/sh: line 1: [: /usr/src/linux/include: binary operator expected grep: invalid option -- / Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. make: Entering directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper' Makefile:6: *** commands commence before first target. Stop. make: Leaving directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper' !!! ERROR: media-libs/svgalib-1.9.17-r1 failed. !!! Function src_compile, Line 77, Exitcode 2 !!! Failed to build kernel module!
I'm getting same error as well, using development-souces with latest kernel patch from linuxhq.com Get same error: !!! ERROR: media-libs/svgalib-1.9.17-r1 failed. !!! Function src_compile, Line 77, Exitcode 2 !!! Failed to build kernel module!
svgalib-1.9.17-r2 should fix all these (note only for 2.6 kernel).
2.6.11-r6 kernel 2005.0 new install (emerge w/ no options used) fails on emerge of lib3d kit topmost error looks like ... install -c-m 755 -o root -g bin so.lib3dkit.1.9.19 /var/tmp/portage/svgalib-1.9.19-r3/image//usr/lib/lib3dkit.so.1.9.19 install: invalid option -- - == this error seem to have been around a while? How do I get past it within the realm of gentoo? -Walt