Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 35671 - lirc failes to compile with gentoo-sources-2.4.22-r1
Summary: lirc failes to compile with gentoo-sources-2.4.22-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Heinrich Wendel (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-12 10:55 UTC by Michael Prager
Modified: 2004-01-19 03:40 UTC (History)
2 users (show)

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


Attachments
Diff to get lirc working (lirc.diff,1.32 KB, patch)
2004-01-03 15:18 UTC, Chris Beauchamp
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Prager 2003-12-12 10:55:18 UTC
After updating to the new gentoo kernel I've tried to re-emerge lirc to get the needed kernel module for my infrared remote control. This is what I'm getting when executing "LIRC_OPTS=--with-driver=hauppauge && emerge lirc":

------------------------------------------------------
gcc -D__KERNEL__ -I/usr/src/linux-2.4.22-gentoo-r1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -finline-limit=2000 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=pentium3 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.22-gentoo-r1/include/linux/modversions.h -DHAVE_CONFIG_H -I. -I. -I../.. -nostdinc -iwithprefix include -DKBUILD_BASENAME=lirc_i2c  -c -o lirc_i2c.o lirc_i2c.c
lirc_i2c.c: In function `set_use_inc':
lirc_i2c.c:275: structure has no member named `inc_use'
lirc_i2c.c:276: structure has no member named `inc_use'
lirc_i2c.c: In function `set_use_dec':
lirc_i2c.c:286: structure has no member named `dec_use'
lirc_i2c.c:287: structure has no member named `dec_use'
lirc_i2c.c: In function `ir_attach':
lirc_i2c.c:384: structure has no member named `inc_use'
lirc_i2c.c:385: structure has no member named `inc_use'
lirc_i2c.c: In function `ir_detach':
lirc_i2c.c:395: structure has no member named `dec_use'
lirc_i2c.c:396: structure has no member named `dec_use'
make[5]: *** [lirc_i2c.o] Fehler 1
make[5]: Leaving directory `/var/tmp/portage/lirc-0.7.0_pre2/work/lirc-0.7.0pre2/drivers/lirc_i2c'
make[4]: *** [_mod_/var/tmp/portage/lirc-0.7.0_pre2/work/lirc-0.7.0pre2/drivers/lirc_i2c] Fehler 2
make[4]: Leaving directory `/usr/src/linux-2.4.22-gentoo-r1'
make[3]: *** [lirc_i2c.o] Fehler 2
make[3]: Leaving directory `/var/tmp/portage/lirc-0.7.0_pre2/work/lirc-0.7.0pre2/drivers/lirc_i2c'
make[2]: *** [all-recursive] Fehler 1
make[2]: Leaving directory `/var/tmp/portage/lirc-0.7.0_pre2/work/lirc-0.7.0pre2/drivers'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/var/tmp/portage/lirc-0.7.0_pre2/work/lirc-0.7.0pre2'
make: *** [all] Fehler 2

!!! ERROR: app-misc/lirc-0.7.0_pre2 failed.
!!! Function src_compile, Line 89, Exitcode 2
!!! (no error message)
------------------------------------------------------


Here is my gentoo info:

Portage 2.0.49-r18 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r9, 2.4.22-gentoo-r1)
=================================================================
System uname: 2.4.22-gentoo-r1 i686 AMD Athlon(tm) XP 1700+
Gentoo Base System version 1.4.3.12
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /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="-mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib acl acpi alsa apache2 apm arts avi berkdb cdr crypt cups curl dga directfb doc dvb dvd encode esd fbcon flash foomaticdb gd gdbm gif gnome gphoto2 gpm gtk gtk2 gtkhtml imlib ipv6 java jpeg kde libg++ libwww mad maildir mbox mcal mikmod mmx motif mozilla mpeg mpi mysql nas ncurses nls oggvorbis opengl oss pam pda pdflib perl plotutils png python qt quicktime readline samba scanner sdl slang slp snmp spell sse ssl svga tcltk tcpd tetex tiff truetype usb wmf x86 xface xinerama xml xml2 xmms xv zlib"

Reproducible: Always
Steps to Reproduce:
1. emerge gentoo-sources-2.4.22-r1
2. LIRC_OPTS=--with-driver=hauppauge && emerge lirc
3.
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-12-14 11:09:32 UTC
could you try it with vanilla source ?

if it works there, x86-kernel team has to fix this issue
Comment 2 Matt Keadle 2003-12-16 21:25:33 UTC
I can confirm the same problem here.

After snooping around a few quick seconds, the evidence shows itself in the patchset applied to gentoo-sources. The following is a snippit of the section of the patch as applied to include/linux/i2c.h from that patchset beginning at line 438195:


        int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
-
-       /* These two are mainly used for bookkeeping & dynamic unloading of
-        * kernel modules. inc_use tells the driver that a client is being
-        * used by another module & that it should increase its ref. counter.
-        * dec_use is the inverse operation.
-        * NB: Make sure you have no circular dependencies, or else you get a
-        * deadlock when trying to unload the modules.
-       * You should use the i2c_{inc,dec}_use_client functions instead of
-       * calling this function directly.
-        */
-       void (*inc_use)(struct i2c_client *client);
-       void (*dec_use)(struct i2c_client *client);
 };


Also, at line 51 in Documentation/i2c/writing-clients (after the kernel is installed) you find:

"There use to be two additional fields in this structure, inc_use et dec_use,
for module usage count, but these fields were obsoleted and removed."


So it looks like it could potentially be lirc to blame, as the previous code mentions "You should use the i2c_{inc,dec}_use_client functions instead of calling this function directly" and it appears they haven't done so. All signs show that there would be no problem building against a vanilla 2.4.22 kernel, since the old methods still exist. Examining the source tree on a machine with gs-sources-2.4.22_pre2 shows it does /not/ have that patch applied, so it should not fail in this area with that kernel. Since the patches applied are in a single huge patchset, the ChangeLog for gentoo-sources doesn't make any detailed reference to the patches applied, and I don't have a machine handy with a 2.4.23 kernel, I can't tell if this was a basic change to the vanilla 2.4.23 tree. If so, it shouldn't be considered the kernels fault but lirc's. In that case it should be fairly easy to patch lirc to use the correct methods (which I will try when I'm less tired).
Comment 3 Matt Keadle 2003-12-17 06:39:30 UTC
I've tried some code hacks to kernel/lirc/both and still haven't been able to compile successfully. Interestingly, the lm_sensors package (another big i2c user) depends on the sys-apps/i2c package which has the correct methods needed to build lirc. sys-apps/i2c installs it's own header into /usr/include/linux. Looking at the lm_sensors ebuild, it's copying /usr/include/linux/i2c-* to its workdir and then using those to build against. I'm reaching the end of my abilities on this and mostly beginning to wonder if I'm going down the wrong road.
Comment 4 Chris Beauchamp 2004-01-03 15:18:30 UTC
Created attachment 23109 [details, diff]
Diff to get lirc working

This attachment makes lirc work with gentoo-sources-2.4.22-r2. GS has i2c 2.8.0
patched into it, which has deprecated the inc_use and dec_use methods (?) and
therefore just removing them makes them work.

Have tested it using my Hauppauge PVR350 remote control and lirc responds to
the remote control OK.

Haven't tested any more thoroughly than that.

However I got the patch basis from:

http://www.gossamer-threads.com/archive/MythTV_C2/Users_F11/lirc_compile_problem_P76338/
Comment 5 Michael Prager 2004-01-03 20:18:20 UTC
The patch works for me. Thx a lot!
Comment 6 Christian Jiresjö 2004-01-04 12:38:03 UTC
LM_Sensors guys also have a patch available at http://www.ensicaen.ismra.fr/~delvare/devel/i2c/#solution which is also referenced through there ticketsystem (http://www2.lm-sensors.nu/~lm78/readticket.cgi?ticket=1366). This should be fixed because i2c 2.8.0 is the one in 2.6.
Comment 7 Heinrich Wendel (RETIRED) gentoo-dev 2004-01-19 03:40:42 UTC
sorry, i thought the kernel guys had to fix it, added the patch to 0.7.0_pre2