Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 369095 - media-libs/svgalib-1.9.25-r1 svgalib_helper module build failure: linux/smp_lock.h: No such file or directory
Summary: media-libs/svgalib-1.9.25-r1 svgalib_helper module build failure: linux/smp_l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-28 20:52 UTC by Ed Catmur
Modified: 2012-02-10 01:05 UTC (History)
5 users (show)

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


Attachments
no-smp-lock.h (no-smp-lock.h,337 bytes, patch)
2011-05-28 21:22 UTC, Ed Catmur
Details | Diff
svgalib-1.9.25-linux2.6.39.patch (svgalib-1.9.25-linux2.6.39.patch,420 bytes, text/plain)
2011-08-23 07:52 UTC, Roger
Details
svgalib-1.9.25-r1.ebuild (svgalib-1.9.25-r1.ebuild,3.89 KB, text/plain)
2011-08-23 07:54 UTC, Roger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2011-05-28 20:52:47 UTC
* Preparing svgalib_helper module
make -j5 HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS= KDIR=/lib/modules/2.6.39-gentoo/build default 
make -C /lib/modules/2.6.39-gentoo/build SUBDIRS=/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper CLASS_CFLAGS= modules
make[1]: Entering directory `/usr/src/linux-2.6.39-gentoo'
  CC [M]  /var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/main.o
  CC [M]  /var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/i810.o
  CC [M]  /var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/virtual.o
  CC [M]  /var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/interrupt.o
  CC [M]  /var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/displaystart.o
/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/main.c:27:28: fatal error: linux/smp_lock.h: No such file or directory
compilation terminated.
make[2]: *** [/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/main.o] Error 1
Comment 1 Ed Catmur 2011-05-28 20:53:37 UTC
This happened just after upgrading to gentoo-sources 2.6.39, obviously :)
Comment 2 Ed Catmur 2011-05-28 21:22:15 UTC
Created attachment 274947 [details, diff]
no-smp-lock.h

Remove reference to smp_lock.h.  Appears to build and link successfully.
Comment 3 Robert Cabrera 2011-07-17 03:22:48 UTC
I've got the exact same issue on my ~x86 laptop.

The build dies with the following:
make[1]: Leaving directory `/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/threeDKit'
 * Preparing svgalib_helper module
make -j2 -s HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS= KDIR=/lib/modules/2.6.39-pf4/build default 
/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/main.c:27:28: fatal error: linux/smp_lock.h: No such file or directory
compilation terminated.
make[2]: *** [/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper] Error 2
make: *** [default] Error 2
emake failed
 * ERROR: media-libs/svgalib-1.9.25-r1 failed (compile phase):
 *   Unable to emake HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS=  KDIR=/lib/modules/2.6.39-pf4/build default
 * 
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 3768:  Called linux-mod_src_compile
 *   environment, line 2877:  Called die
 * The specific snippet of code:
 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" 					CROSS_COMPILE=${CHOST}- 						LDFLAGS=\"$(get_abi_LDFLAGS)\" 						${BUILD_FIXES} 					${BUILD_PARAMS} 						${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

My emerge --info:
Portage 2.2.0_alpha45 (default/linux/x86/10.0/desktop/kde, gcc-4.5.2, glibc-2.13-r4, 2.6.39-pf4 i686)
=================================================================
System uname: Linux-2.6.39-pf4-i686-Intel-R-_Core-TM-2_CPU_T7200_@_2.00GHz-with-gentoo-2.0.3
Timestamp of tree: Sun, 17 Jul 2011 01:45:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2, 3.1.4, 3.2
dev-util/cmake:           2.8.5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21.1
sys-devel/gcc:            4.5.2
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo portage
Installed sets: 
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/config/kdm /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/skel /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.netnitco.net http://gentoo.osuosl.org/ http://gentoo.mirrors.tds.net/gentoo http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://gentoo.wetzlmayr.com/ http://osmirrors.cerias.purdue.edu/pub/gentoo/ http://www.cyberuse.com/gentoo/ http://gentoo.mirrors.hoobly.com/ ftp://gentoo.imj.fr/pub/gentoo/ http://130.59.10.35/ftp/mirror/gentoo/"
LANG="en_US.utf8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
LINGUAS="en en_US"
MAKEOPTS="-j2 -s"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="S3TC X a52 aac aacs aalib acl acpi addressbook alsa amr apm archive audiofile autoipd avahi bash-completion berkdb binfilter bittorrent bluetooth bluray bonjour branding bzip2 cairo cdda cdinstall cdr chm cleartype cli clucene connection-sharing consolekit contrast cracklib crypt cups custom-cflags custom-optimization cxx dbus dc1394 declarative dell designer-plugin desktopglobe dga dhcpcd dirac djvu dri drm dts dv dvb dvd dvdr ebook editor eix embedded emboss emovix enca encode exif extensions faac faad fam fat fbcon fbcondecor fbsplash ffmpeg firefox fits flac flash fortran ftp fuse gcrypt gd gdbm gdu geolocation ggi gif gimp git glib glibc-omitfp gmm gmp gnutls gphoto2 gpm graphviz groupwise gsm gtk handbook httpd hyperestraier iconv id3tag ieee1394 imagemagick imlib indi inotify ipod ipv6 jabber jack java javascript jbig jce jingle joystick jpeg jpeg2k kate kde kerberos kig-scripting kipi konqueror ladspa lame laptop lastfm latex lcms ldap libass libcaca libnotify libproxy libsamplerate libtiger live lm_sensors lua lzma lzo mad matroska md5sum meanwhile mjpeg mmx mng modplug modules mozilla mp3 mp3tunes mp4 mpeg mplayer msn mtp mudflap musepack musicbrainz ncurses network networkmanager nls nova npp nptl nptlonly nsplugin ntfs nut nvidia offensive ogg openal openexr opengl openmp optimization optimized-qmake oscar otr pam pango pch pcmcia pcre pdf perl plasma pm-utils pmu png pnm policykit ppds ppp pppd pvr python python3 qalculate qt-faststart qt3support qt4 quicktime qwt rar raw rdp readline remote-access reports resolvconf rle rss rtmp rtsp samba sasl scanner schroedinger sdl sdl-image secure-delete semantic-desktop session shout shutdown skins skype slp smbclient smp sms sndfile solver sox speex spell sse sse2 ssl ssse3 stable startup-notification stream strong-optimization subversion svg symlink sysfs system-sqlite taglib tcl tcpd teamarena templates tga themedesigner theora threads thumbnail tidy tiff timidity tremor truetype twolame udev unicode upnp usb vaapi vcd vcdx video vidix vlc vlm vnc vorbis vpx watchdog wavpack webpresence wicd wifi win32codecs windeco winpopup wireshark wmf wpd wps wv2 wxwidgets x264 x86 xanim xattr xcb xcomposite xine xinerama xml xorg xosd xscreensaver xulrunner xv xvid xvmc yahoo yv12 zeroconf zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse synaptics joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" RUBY_TARGETS="ruby18" SANE_BACKENDS="epson epson2" USERLAND="GNU" VIDEO_CARDS="nvidia nv" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Robert Cabrera 2011-07-17 03:25:23 UTC
I'm not a programmer.... How do I make and apply a patch to the ebuild that removes the reference to smp_lock.h so I too can get this to build? TIA
Comment 5 email200202 2011-08-09 01:51:48 UTC
I have the same problem.

My workaround:

# touch /usr/src/linux-2.6.39-gentoo-r3/include/linux/smp_lock.h
# emerge -av1 svgalib

It compiles successfully.
Comment 6 Navid Zamani 2011-08-20 19:00:50 UTC
This is horrible. It’s been a bug for ages (just search for “ALL svgalib-1.9.25”) and there are so many duplicate/similar bugs, that I’m not sure it’s still maintained…

The workaround below looks like a kernel oops hazard on multi-core machines.

So what can we do? Any real fix?
Comment 7 Navid Zamani 2011-08-20 19:03:13 UTC
(In reply to comment #6)
Correction: The duplicates are properly tagged as such or not duplicates. So I take that back. :)
Comment 8 Andrew Savchenko gentoo-dev 2011-08-20 20:34:16 UTC
(In reply to comment #6)
> The workaround below looks like a kernel oops hazard on multi-core machines.

Why? BKL is gone.

> So what can we do? Any real fix?

Do you have any real problems with this fix?
Comment 9 Navid Zamani 2011-08-20 20:45:51 UTC
(In reply to comment #8)
> Why? BKL is gone.

If that is the only purpose of that file, then OK, I didn’t know that.


> Do you have any real problems with this fix?

Do you mean apart from including a file that svgalib expects for a reason, but that does nothing?

Yeah. The fact that maybe svgalib should be properly fixed instead of tricking it with a hack.

Any further questions? :P
Comment 10 Roger 2011-08-23 06:47:33 UTC
The source of svgalib pulls in smp_lock.h here:

# fgrep /var/tmp/portage/media-libs/svgalib-1.9.25-r1/* -r -e "smp_lock.h"

/var/tmp/portage/media-libs/svgalib-1.9.25-r1/work/svgalib-1.9.25/kernel/svgalib_helper/main.c:#include <linux/smp_lock.h>


Suppose one could comment out the smp_lock.h include, but that would be just a hack too!  This needs a code fix since header file smp_lock.h has been removed, or likely has been moved into another file or now substituted with another function.
Comment 11 Roger 2011-08-23 07:50:07 UTC
Did some searching on Google and found smp_lock.h was required for BKL (ioctl?).  Supposedly, removing/commenting-out smp_lock.h header file should work if the BKL has also been removed.

Currently, I don't see anything during compile time dragging in any functions from smp_lock.h, and as such is compiling fine without errors.

I'm attaching a patch file and a new ebuild, which include an if/then to determine kernel version greater then equals 2.6.39.
Comment 12 Roger 2011-08-23 07:52:49 UTC
Created attachment 284311 [details]
svgalib-1.9.25-linux2.6.39.patch

Comments-out smp_lock.h header file as this file has been removed from kernel versions greater then and equal to 2.6.39.
Comment 13 Roger 2011-08-23 07:54:39 UTC
Created attachment 284313 [details]
svgalib-1.9.25-r1.ebuild

New ebuild to bring in patch svgalib-1.9.25-linux2.6.39.patch if kernel version is greater then or equal to 2.6.39.

(Tested only on kernel version 3.0.3 here and seems to compile fine.  Just needs testing.)
Comment 14 Roger 2011-08-23 08:21:18 UTC
I've tested this on my 2x750P3 with 1G RAM box here using the following:

=sys-kernel/gentoo-sources-3.0.3 - Using nouveau framebuffer & X.

=media-video/mplayer-1.0_rc4_p20101114 - Tested playing video in framebuffer console.

=www-client/links-2.3_pre1-r1 - Using www.google.com & images.google.com in framebuffer console -- links for sure depends on svgalib_helper.ko module.


It looks like you can mark this as fixed now, but would be nice to hear a successful build report on linux-2.6.39!
Comment 15 Navid Zamani 2011-08-23 08:56:54 UTC
(In reply to comment #11)
> Currently, I don't see anything during compile time dragging in any functions
> from smp_lock.h, and as such is compiling fine without errors.

I wonder though, why it was pulled in in the first place, if it wasn’t used. did smp_lock.h do some magic, like replace key functions via macro magic or something?
The point is: Unless we’re sure it did nothing, we can’t be sure it won’t cause trouble. And if it really did nothing, then why was it imported at all? I don’t think any coder would write an import statement unless he needs it, and the compiler would warn if you imported something you don’t use, no?

Seriously, I just don’t trust this thing because of that…

Then again, maybe it was a coder error, including something that one may need but then not using it, and the compiler being dumb trying to build something not used. ^^
Comment 16 Andrew Savchenko gentoo-dev 2011-08-23 09:04:30 UTC
(In reply to comment #9)
> Do you mean apart from including a file that svgalib expects for a reason, but
> that does nothing?

There is NO reason now. If you'll remove a required header, program will fail to compile. Point and no other options in C. Every change where only headers are removed without compilation problems is safe.

Well, there is a negligibly small possibility that some #define macro was undefined in linux/smp_lock.h and redefined anew, but analysis of this header and inherited ones shows no such undefs as of linux-2.6.37.4.

There was a reason earlier, however. Some function call or definition required this header earlier with an older kernel.
 
> Yeah. The fact that maybe svgalib should be properly fixed instead of tricking
> it with a hack.

This is not a hack, this is a proper solution.
If you have any problems with SMP, please open a bug or at least post them here.
If you do not understand how the C code works, just keep quiet.
Comment 17 Navid Zamani 2011-08-23 09:24:12 UTC
(In reply to comment #16)
> There is NO reason now.
> …
> If you do not understand how the C code works, just keep quiet.

Can you please not feel so attacked / be so hostile, and stay professional? Thank you. :)

> Well, there is a negligibly small possibility that some #define macro was
> undefined in linux/smp_lock.h and redefined anew, but analysis of this header
> and inherited ones shows no such undefs as of linux-2.6.37.4.

It is not negligible. It had to be checked. That was my point. What kind of programmer just ignores something and doesn’t even check because it’s unlikely?
Glad you did.

> There was a reason earlier, however. Some function call or definition required
> this header earlier with an older kernel.

See, that is a good answer to our problem. So there is a #ifdef or something alike in the code, yeah? And for older kernels that activates code that actually uses stuff from smp_lock.h?

Alright, then the solution is simple: We can remove the parts of the svgalib code that are in that are only compiled in for older kernels. Remove the part inside the #ifdef that uses smp_lock.h. Simple.

See, if you hadn’t been so hostile, I would have an easier time believing this explanation. I will believe you… But you should know that this way you only very barely managed to stay credible. Now that wasn’t necessary, when one had as good of a point as you had, was it? ^^
Comment 18 Roger 2011-08-23 15:11:56 UTC
FYI: I am on a SMP system with a SMP enabled CPU.  So if there were #ifdefs during compile, my build should have failed.

We could also change this bugs status to CONFIRMED.
Comment 19 Navid Zamani 2011-08-23 15:28:20 UTC
(In reply to comment #18)
> FYI: I am on a SMP system with a SMP enabled CPU.  So if there were #ifdefs
> during compile, my build should have failed.

#ifdefs regarding to the kernel version. Or to if there is such a thing as a BKL in the kernel it’s compiled against.
Not to if it’s SMP.
Obviously.
Comment 20 Mr. Bones. (RETIRED) gentoo-dev 2011-10-03 17:01:51 UTC
fixed.
Comment 21 Roger 2011-10-03 22:48:31 UTC
Thanks Mr. Bones
Comment 22 Pacho Ramos gentoo-dev 2012-02-09 12:30:13 UTC
*** Bug 341393 has been marked as a duplicate of this bug. ***
Comment 23 Andrew Savchenko gentoo-dev 2012-02-09 13:10:36 UTC
(In reply to comment #22)
> *** Bug 341393 has been marked as a duplicate of this bug. ***

Why you marked #341393 as a duplicate of this bug?

Have you ever read bug 341393 carefully? This is a completely different issue: module itself builds well, what fails to build are applications using this module
because of svgalib_helper.h is explicitly and mistakenly removed from sources
in the ebuild.
Comment 24 Roger 2012-02-10 00:29:23 UTC
Currently, "=media-libs/svgalib-1.9.25-r1 (kernel-helper kernel_linux -build) 01/17/2012" seems to be building fine here, along with www-client/links and media-video/mplayer packages.
Comment 25 Navid Zamani 2012-02-10 01:05:04 UTC
I’m confirming that now everything compiles fine here too.