Bug 42522 - svgalib-1.9.18 cant build kernel module with linux 2.6 and without sandbox violations
Bug#: 42522 Product:  Gentoo Linux Version: 1.4 Platform: All
OS/Version: All Status: RESOLVED Severity: blocker Priority: P1
Resolution: FIXED Assigned To: vapier@gentoo.org Reported By: tratz@xs4all.nl
Component: Ebuilds
URL: 
Summary: svgalib-1.9.18 cant build kernel module with linux 2.6 and without sandbox violations
Keywords:  
Status Whiteboard: 
Opened: 2004-02-22 15:46 0000
Description:   Opened: 2004-02-22 15:46 0000
This is a normal gentoo bleeding-edge system without changes that need to be
mentioned.

The following occurs while emerging this version of svgalib:

(,,normal output purged..)
make: Entering directory
`/mnt/pardisk/vartmp/portage/svgalib-1.9.18/work/svgalib-1.9.18/threeDKit'
rm -f lib3dkit.a
ar rcs lib3dkit.a 
make: Leaving directory
`/mnt/pardisk/vartmp/portage/svgalib-1.9.18/work/svgalib-1.9.18/threeDKit'
make: Entering directory `/usr/src/linux-2.6.3-gentoo-r1'
  CLEAN   arch/i386/boot/compressed
ACCESS DENIED  unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/vmlinux
rm: cannot remove `arch/i386/boot/compressed/vmlinux': Permission denied
ACCESS DENIED  unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/vmlinux.bin
rm: cannot remove `arch/i386/boot/compressed/vmlinux.bin': Permission denied
ACCESS DENIED  unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/vmlinux.bin.gz
rm: cannot remove `arch/i386/boot/compressed/vmlinux.bin.gz': Permission denied
ACCESS DENIED  unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/head.o
rm: cannot remove `arch/i386/boot/compressed/head.o': Permission denied
ACCESS DENIED  unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/misc.o
rm: cannot remove `arch/i386/boot/compressed/misc.o': Permission denied
ACCESS DENIED  unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/piggy.o
rm: cannot remove `arch/i386/boot/compressed/piggy.o': Permission denied
make[2]: *** [__clean] Error 1
make[1]: *** [arch/i386/boot/compressed] Error 2
make: *** [archclean] Error 2
make: Leaving directory `/usr/src/linux-2.6.3-gentoo-r1'

!!! ERROR: media-libs/svgalib-1.9.18 failed.
!!! Function src_compile, Line 66, Exitcode 2
!!! Failed to build kernel module!

--------------------------- ACCESS VIOLATION SUMMARY
---------------------------
LOG FILE = "/tmp/sandbox-media-libs_-_svgalib-1.9.18-13951.log"

unlink:    /usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/vmlinux
unlink:    /usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/vmlinux.bin
unlink:   
/usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/vmlinux.bin.gz
unlink:    /usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/head.o
unlink:    /usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/misc.o
unlink:    /usr/src/linux-2.6.3-gentoo-r1/arch/i386/boot/compressed/piggy.o
--------------------------------------------------------------------------------

root #

------- Comment #1 From Jonathan Heaney 2004-02-22 17:02:46 0000 -------
Getting the same Access Violation here with 2.6.3-mm2.

------- Comment #2 From Octavio Ruiz (Ta^3) 2004-02-22 18:37:07 0000 -------
Same Access Violation Problem on 2.4.5 (Vanilla):

make[1]: Entering directory `/usr/src/linux-2.4.25/arch/i386/boot'
rm -f tools/build
ACCESS DENIED  unlink:    /usr/src/linux-2.4.25/arch/i386/boot/tools/build
rm: cannot remove `tools/build': Permission denied
make[1]: *** [clean] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.25/arch/i386/boot'
make: *** [archclean] Error 2
make: Leaving directory `/usr/src/linux-2.4.25'

!!! ERROR: media-libs/svgalib-1.9.18 failed.
!!! Function src_compile, Line 66, Exitcode 2
!!! Failed to build kernel module!

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-media-libs_-_svgalib-1.9.18-10563.log"

unlink:    /usr/src/linux-2.4.25/arch/i386/boot/tools/build
--------------------------------------------------------------------------------

------- Comment #3 From aent 2004-02-22 19:26:58 0000 -------
same with 2.6.3-r1

------- Comment #4 From Hinrik Örn Sigurðsson 2004-02-22 19:32:14 0000 -------
Same here with vanilla 2.6.3. :/

------- Comment #5 From Joe Khoobyar 2004-02-22 19:36:02 0000 -------
Same here with gentoo-dev-sources-2.6.3_rc3, gentoo-dev-sources-2.6.3_rc4,
gentoo-dev-sources-2.6.3, and gentoo-dev-sources-2.6.3-r1.

[shameless-plug]  check out <a href="http://vim4j.sf.net">vim4j.sf.net</a>. 
Vim4J already provides a Java AWT GUI for Vim, and soon will be embeddable into
to your favourite Java-based open-source IDE.  [/shameless-plug]

Whew, got that out of my system!  ;)

------- Comment #6 From Yi Quang (RETIRED) 2004-02-22 21:19:29 0000 -------
Confirmed, same here. 

------- Comment #7 From Barry Salter 2004-02-22 21:27:17 0000 -------
Adding the "build" USE flag in /etc/make.conf overcomes this bug, but still
results in a build failure, the relevant part of the log for which is attached
as a new comment.

emerge info

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0,
2.6.3-gentoo-r1)
=================================================================
System uname: 2.6.3-gentoo-r1 i686 AMD Athlon(TM) XP 1700+
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=athlon-xp -march=athlon-xp -fomit-frame-pointer
-funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/lib/mozilla/defaults/pref /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/env.d"
CXXFLAGS="-O2 -mcpu=athlon-xp -march=athlon-xp -fomit-frame-pointer
-funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs build buildpkg ccache sandbox"
GENTOO_MIRRORS="http://212.219.247.13/sites/www.ibiblio.org/gentoo/
http://212.219.247.11/sites/www.ibiblio.org/gentoo/
http://212.219.247.10/sites/www.ibiblio.org/gentoo/
http://212.219.247.18/sites/www.ibiblio.org/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X acpi acpi4linux alsa amd apache2 apm arts autofs avi berkdb build
cdr cgi chroot crypt cups curl directfb dvd encode esd fastcgi fbcon fbdev
foomaticdb freetype fs gatos gdbm gif gimpprint glut gnome gpm gtk gtk2 gtkhtml
guile idea imagemagick imap imlib imlib2 ipv6 java javascript jikes jpeg kde
kerberos lcms ldap lesstif libg++ libwww mad maildir mbox md5sum mikmod mlkmod
mmx motif mozilla mpeg ncurses nls odbc oggvorbis opengl openssh oss pam pdflib
perl plotutils png ppds python qt quicktime radeon readline samba scanner sdl
slang slp spell sse ssl svga tcltk tcpd tetex tiff truetype unicode usb
video_cards_radeon videos x86 xml xml2 xmms xv zlib"

------- Comment #8 From Barry Salter 2004-02-22 21:33:32 0000 -------
Created an attachment (id=26138) [details]
abridged svgalib 1.9.18 build log (See comment #7)

Abridged svgalib 1.9.18 build log, as per comment #7

------- Comment #9 From Andrej Kacian (RETIRED) 2004-02-23 00:40:51 0000 -------
There is absolutely no point in posting "me too" comments for bugs like this,
dealing with sandbox access violations, as this is all-or-noone kind of bug in
the ebuild.

------- Comment #10 From SpanKY 2004-02-23 00:48:06 0000 -------
it's just a matter of converting the kernel building to using the new
kernel-mod.eclass ... i should be able to get to it tomorrow if martin doesnt
do it first

and yes, a quick workaround is to just `env USE=build emerge svgalib`, but DO
NOT put that into your make.conf

------- Comment #11 From Kathy Wills 2004-02-23 01:48:59 0000 -------
I'm using the gentoo-dev-sources 2.6.3-r1. Using the quick work around
mentioned by SpanKY, I then get the following errors:

/usr/include/asm/pgtable.h:302: error: `ptep' undeclared (first use in this
function)
/usr/include/asm/pgtable.h: At top level:
/usr/include/asm/pgtable.h:314: error: syntax error before "pte_modify"
/usr/include/asm/pgtable.h:314: error: syntax error before "pte"
/usr/include/asm/pgtable.h: In function `pte_modify':
/usr/include/asm/pgtable.h:316: error: `pte' undeclared (first use in this
function)
/usr/include/asm/pgtable.h:316: error: `PTE_MASK' undeclared (first use in this
function)
/usr/include/asm/pgtable.h:317: error: `newprot' undeclared (first use in this
function)
/usr/include/asm/pgtable.h: At top level:
/usr/include/asm/pgtable.h:359: error: syntax error before "pgprot_t"
In file included from main.c:39:
interrupt.h:1: warning: `struct sh_pci_device' declared inside parameter list
interrupt.h:2: warning: `struct sh_pci_device' declared inside parameter list
interrupt.h:3: warning: `struct sh_pci_device' declared inside parameter list
interrupt.h:4: warning: `struct sh_pci_device' declared inside parameter list
main.c:48: error: `MAX_NR_DEVICES' undeclared here (not in a function)
main.c:50: error: `MAX_NR_DEVICES' undeclared here (not in a function)
main.c:89: error: syntax error before "vsync_wait"
main.c:89: warning: type defaults to `int' in declaration of `vsync_wait'
main.c:89: warning: data definition has no type or storage class
main.c: In function `vsync_interrupt':
main.c:96: warning: passing arg 1 of `vga_test_vsync' from incompatible pointer
type
main.c:99: warning: passing arg 1 of `vga_ack_vsync' from incompatible pointer
type
main.c:101: error: dereferencing pointer to incomplete type
main.c:104: error: dereferencing pointer to incomplete type
main.c:108: warning: implicit declaration of function `wake_up_interruptible'
main.c: At top level:
main.c:114: warning: `struct file' declared inside parameter list
main.c: In function `svgalib_helper_ioctl':
main.c:118: error: dereferencing pointer to incomplete type
main.c:122: error: `u8' undeclared (first use in this function)
main.c:122: error: syntax error before "pb"
main.c:123: error: `u16' undeclared (first use in this function)
main.c:124: error: `u32' undeclared (first use in this function)
main.c:139: warning: implicit declaration of function `kmalloc'
main.c:139: error: `GFP_KERNEL' undeclared (first use in this function)
main.c:139: warning: assignment makes pointer from integer without a cast
main.c:144: warning: implicit declaration of function `kfree'
main.c:194: warning: implicit declaration of function `writeb'
main.c:199: warning: implicit declaration of function `writew'
main.c:204: warning: implicit declaration of function `writel'
main.c:209: warning: implicit declaration of function `readb'
main.c:215: warning: implicit declaration of function `readw'
main.c:221: warning: implicit declaration of function `readl'
main.c:229: warning: implicit declaration of function `pci_read_config_byte'
main.c:229: error: `pb' undeclared (first use in this function)
main.c:238: warning: implicit declaration of function `pci_read_config_word'
main.c:238: error: `pw' undeclared (first use in this function)
main.c:247: warning: implicit declaration of function `pci_read_config_dword'
main.c:247: error: `pl' undeclared (first use in this function)
main.c:265: warning: implicit declaration of function `pci_write_config_byte'
main.c:273: warning: implicit declaration of function `pci_write_config_word'
main.c:281: warning: implicit declaration of function `pci_write_config_dword'
main.c:310: warning: implicit declaration of function `request_irq'
main.c:310: error: `SA_SHIRQ' undeclared (first use in this function)
main.c:323: warning: implicit declaration of function `interruptible_sleep_on'
main.c:327: warning: implicit declaration of function `free_irq'
main.c:335: error: `ERESTARTSYS' undeclared (first use in this function)
main.c: At top level:
main.c:359: warning: `struct file' declared inside parameter list
main.c: In function `svgalib_helper_open':
main.c:361: error: dereferencing pointer to incomplete type
main.c: At top level:
main.c:374: warning: `struct file' declared inside parameter list
main.c:384: warning: `struct vm_area_struct' declared inside parameter list
main.c: In function `remap_cache':
main.c:386: error: dereferencing pointer to incomplete type
main.c:388: error: dereferencing pointer to incomplete type
main.c:388: error: `VM_IO' undeclared (first use in this function)
main.c:413: error: dereferencing pointer to incomplete type
main.c:413: error: invalid lvalue in assignment
main.c:427: warning: implicit declaration of function `remap_page_range'
main.c:427: error: dereferencing pointer to incomplete type
main.c:427: error: dereferencing pointer to incomplete type
main.c:427: error: dereferencing pointer to incomplete type
main.c:427: error: dereferencing pointer to incomplete type
main.c: At top level:
main.c:474: warning: `struct vm_area_struct' declared inside parameter list
main.c:474: warning: `struct file' declared inside parameter list
main.c: In function `svgalib_helper_mmap':
main.c:475: error: dereferencing pointer to incomplete type
main.c:476: error: dereferencing pointer to incomplete type
main.c:477: error: dereferencing pointer to incomplete type
main.c:479: error: dereferencing pointer to incomplete type
main.c:485: warning: passing arg 1 of `remap_cache' from incompatible pointer
type
main.c: At top level:
main.c:489: error: variable `svgalib_helper_fops' has initializer but
incomplete type
main.c:491: error: unknown field `owner' specified in initializer
main.c:491: warning: excess elements in struct initializer
main.c:491: warning: (near initialization for `svgalib_helper_fops')
main.c:493: error: unknown field `ioctl' specified in initializer
main.c:493: warning: excess elements in struct initializer
main.c:493: warning: (near initialization for `svgalib_helper_fops')
main.c:494: error: unknown field `mmap' specified in initializer
main.c:494: warning: excess elements in struct initializer
main.c:494: warning: (near initialization for `svgalib_helper_fops')
main.c:495: error: unknown field `open' specified in initializer
main.c:495: warning: excess elements in struct initializer
main.c:495: warning: (near initialization for `svgalib_helper_fops')
main.c:496: error: unknown field `release' specified in initializer
main.c:496: warning: excess elements in struct initializer
main.c:496: warning: (near initialization for `svgalib_helper_fops')
main.c: In function `init_module':
main.c:519: error: `KERN_INFO' undeclared (first use in this function)
main.c:519: error: syntax error before string constant
main.c:521: error: `SVGALIB_HELPER_MAJOR' undeclared (first use in this
function)
main.c:524: error: `KERN_WARNING' undeclared (first use in this function)
main.c:524: error: syntax error before string constant
main.c:528: error: invalid application of `sizeof' to an incomplete type
main.c:528: error: `GFP_KERNEL' undeclared (first use in this function)
main.c:532: error: invalid application of `sizeof' to an incomplete type
main.c:534: error: `MAX_NR_DEVICES' undeclared (first use in this function)
main.c:557: warning: implicit declaration of function `pci_present'
main.c:559: warning: implicit declaration of function `pci_find_device'
main.c:559: error: `PCI_ANY_ID' undeclared (first use in this function)
main.c:560: warning: implicit declaration of function `pci_find_class'
main.c:560: warning: assignment makes pointer from integer without a cast
main.c:562: error: invalid application of `sizeof' to an incomplete type
main.c:565: error: invalid application of `sizeof' to an incomplete type
main.c:570: error: `KERN_DEBUG' undeclared (first use in this function)
main.c:570: error: syntax error before string constant
main.c:586: error: syntax error before string constant
main.c:593: warning: implicit declaration of function `sprintf'
main.c:612: warning: implicit declaration of function `init_waitqueue_head'
main.c: In function `cleanup_module':
main.c:639: error: `MAX_NR_DEVICES' undeclared (first use in this function)
main.c:660: error: `SVGALIB_HELPER_MAJOR' undeclared (first use in this
function)
main.c: At top level:
main.c:48: error: storage size of `sh_pci_devs' isn't known
main.c:50: error: storage size of `irqs' isn't known
main.c:489: error: storage size of `svgalib_helper_fops' isn't known
../../src/vgaversion.h:2: warning: `versionstr' defined but not used
main.c:48: warning: `sh_pci_devs' defined but not used
main.c:50: warning: `irqs' defined but not used
make[1]: *** [main.o] Error 1
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.18/work/svgalib-1.9.18/kernel/svgalib_helper'
make: *** [installmodule] Error 2

!!! ERROR: media-libs/svgalib-1.9.18 failed.
!!! Function src_install, Line 85, Exitcode 2
!!! Failed to install svgalib!

------- Comment #12 From Marcus J. van Dijk, Jr. 2004-02-23 06:18:32 0000 -------
Kathy,

just wait until this bug is resolved, if it still occurs afterwards, please file a new bugreport. This obviously is not the same issue.
And next time, make sure to file an output that big to an attachment instead of putting it as a comment. The latter really is rediculous if i may say so.

------- Comment #13 From Colin Tinker 2004-02-23 13:01:08 0000 -------
Same here with 2.6.2-r2

make: Entering directory `/var/tmp/portage/svgalib-1.9.18/work/svgalib-1.9.18/threeDKit'
rm -f lib3dkit.a
ar rcs lib3dkit.a
make: Leaving directory `/var/tmp/portage/svgalib-1.9.18/work/svgalib-1.9.18/threeDKit'
make: Entering directory `/usr/src/linux-2.6.3-gentoo-r2'
  CLEAN   arch/i386/boot/compressed
rm: cannot remove `arch/i386/boot/compressed/vmlinux': Permission denied
rm: cannot remove `arch/i386/boot/compressed/vmlinux.bin': Permission denied
rm: cannot remove `arch/i386/boot/compressed/vmlinux.bin.gz': Permission denied
rm: cannot remove `arch/i386/boot/compressed/head.o': Permission denied
rm: cannot remove `arch/i386/boot/compressed/misc.o': Permission denied
rm: cannot remove `arch/i386/boot/compressed/piggy.o': Permission denied
make[2]: *** [__clean] Error 1
make[1]: *** [arch/i386/boot/compressed] Error 2
make: *** [archclean] Error 2
make: Leaving directory `/usr/src/linux-2.6.3-gentoo-r2'

!!! ERROR: media-libs/svgalib-1.9.18 failed.
!!! Function src_compile, Line 67, Exitcode 2
!!! Failed to build kernel module!

emerge info
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.3-gentoo-r2)
=================================================================
System uname: 2.6.3-gentoo-r2 i686 AMD Athlon(tm) processor
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-tbird -O3 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon-tbird -O3 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache clean cvs distcc fixpackages sandbox userpriv usersandbox"
GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X aalib acpi acpi4linux alsa apm arts avi berkdb bonobo cdr chroot crypt cups curl dga directfb dvd encode esd ethereal faad fam fbcon flac foomaticdb freetype gdbm gif gnome gphoto2 gpm gtk gtk2 imagemagick imlib ipv6 java jpeg kde ldap libg++ libwww mad mikmod mmx motif mozilla mpeg mpeg4 mysql ncurses nls oggvorbis opengl oss pam pcap pdflib perl pic png postgres prelink python qt quicktime readline scanner sdl slang sox speedo spell ssl svga t1lib tcpd tiff transcode truetype usb v4l vanilla vim-with-x x86 xfs xml2 xmms xv xvid zlib zvbi"

------- Comment #14 From SpanKY 2004-02-23 14:10:15 0000 -------
*** Bug 42600 has been marked as a duplicate of this bug. ***

------- Comment #15 From SpanKY 2004-02-23 14:10:27 0000 -------
*** Bug 42577 has been marked as a duplicate of this bug. ***

------- Comment #16 From SpanKY 2004-02-23 14:10:41 0000 -------
*** Bug 42573 has been marked as a duplicate of this bug. ***

------- Comment #17 From SpanKY 2004-02-23 22:28:44 0000 -------
i've disabled the building of the kernel module for now until we can figure out
hth to build it against 2.6 without this crap

------- Comment #18 From SpanKY 2004-02-24 09:53:14 0000 -------
*** Bug 42710 has been marked as a duplicate of this bug. ***

------- Comment #19 From Martin Wegner 2004-02-24 09:59:40 0000 -------
I have the same problem like Kathy Wills with vanilla-sources-2.4.25

------- Comment #20 From Martin Schlemmer (RETIRED) 2004-02-24 12:38:51 0000 -------
Please try -r1.

------- Comment #21 From SpanKY 2004-02-24 14:24:32 0000 -------
*** Bug 42728 has been marked as a duplicate of this bug. ***

------- Comment #22 From Lesley van Zijl 2004-02-24 14:26:25 0000 -------
fixed: vanilla 2.6.3 

thank you

------- Comment #23 From Marcus J. van Dijk, Jr. 2004-02-24 14:33:47 0000 -------
fix confirmed (gentoo-dev-sources).