It looks to me like the source is looking for the definition of a spinlock contained in kernel include files. (Which is not present in the newer kernels) Reproducible: Always Steps to Reproduce: 1.emerge -u apmd 2. 3.
*** Bug 29637 has been marked as a duplicate of this bug. ***
emerge gnome Calculating dependencies ...done! >>> emerge (1 of 3) sys-apps/apmd-3.0.2-r3 to / >>> md5 src_uri ;-) apmd-3.0.2.tar.gz >>> Unpacking source... >>> Unpacking apmd-3.0.2.tar.gz to /var/tmp/portage/apmd-3.0.2-r3/work * Applying apmsleep.c.diff... [ ok ]>>> Source unpacked. gcc -c -O3 -march=pentium3 -funroll-loops -pipe -Wall -pipe -I. -I/usr/src/linux/include -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include -DVERSION=\"3.0.2\" -DAPMD_PROXY_NAME=\"/etc/apm/apmd_proxy\" apmlib.c ar rv libapm.a apmlib.o a - apmlib.o ranlib libapm.a gcc -c -O3 -march=pentium3 -funroll-loops -pipe -Wall -pipe -I. -I/usr/src/linux/include -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include -DVERSION=\"3.0.2\" -DAPMD_PROXY_NAME=\"/etc/apm/apmd_proxy\" apm.c apm.c: In function `change_state': apm.c:40: warning: implicit declaration of function `exit' gcc -o apm apm.o -L. -lapm gcc -c -O3 -march=pentium3 -funroll-loops -pipe -Wall -pipe -I. -I/usr/src/linux/include -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include -DVERSION=\"3.0.2\" -DAPMD_PROXY_NAME=\"/etc/apm/apmd_proxy\" apmd.c apmd.c: In function `apmd_call_proxy': apmd.c:245: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:328: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:332: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:357: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:374: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:382: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:394: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:403: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c:408: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `apmd_power_reset': apmd.c:426: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `apmd_suspend': apmd.c:463: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `apmd_standby': apmd.c:497: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `apmd_resume': apmd.c:532: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `apmd_low_battery': apmd.c:593: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `apmd_check_power': apmd.c:612: warning: concatenation of string literals with __FUNCTION__ is deprecated apmd.c: In function `main': apmd.c:959: warning: concatenation of string literals with __FUNCTION__ is deprecated gcc -o apmd apmd.o -L. -lapm gcc -c -O3 -march=pentium3 -funroll-loops -pipe -Wall -pipe -I. -I/usr/src/linux/include -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include -DVERSION=\"3.0.2\" -DAPMD_PROXY_NAME=\"/etc/apm/apmd_proxy\" -DNARROWPROTO xapm.c xapm.c: In function `main': xapm.c:286: warning: implicit declaration of function `exit' gcc -o xapm xapm.o -L. -lapm -L/usr/X11R6/lib -lXaw -lXmu -lXt -lXext -lSM -lICE -lX11 gcc -c -O3 -march=pentium3 -funroll-loops -pipe -Wall -pipe -I. -I/usr/src/linux/include -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include -DVERSION=\"3.0.2\" -DAPMD_PROXY_NAME=\"/etc/apm/apmd_proxy\" apmsleep.c In file included from /usr/src/linux/include/linux/compiler.h:15, from /usr/src/linux/include/linux/spinlock.h:11, from apmsleep.c:49: /usr/src/linux/include/linux/compiler-gcc3.h:19:1: warning: "__attribute_used__" redefined In file included from /usr/include/features.h:291, from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/stdio.h:37, from apmsleep.c:45: /usr/include/sys/cdefs.h:192:1: warning: this is the location of the previous definition In file included from /usr/src/linux/include/linux/compiler.h:15, from /usr/src/linux/include/linux/spinlock.h:11, from apmsleep.c:49: /usr/src/linux/include/linux/compiler-gcc3.h:22:1: warning: "__attribute_pure__" redefined In file included from /usr/include/features.h:291, from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/stdio.h:37, from apmsleep.c:45: /usr/include/sys/cdefs.h:183:1: warning: this is the location of the previous definition In file included from apmsleep.c:49: /usr/src/linux/include/linux/spinlock.h: In function `bit_spin_lock': /usr/src/linux/include/linux/spinlock.h:571: warning: implicit declaration of function `current_thread_info' /usr/src/linux/include/linux/spinlock.h:571: invalid type argument of `->' /usr/src/linux/include/linux/spinlock.h: In function `bit_spin_trylock': /usr/src/linux/include/linux/spinlock.h:594: invalid type argument of `->' /usr/src/linux/include/linux/spinlock.h: In function `bit_spin_unlock': /usr/src/linux/include/linux/spinlock.h:609: invalid type argument of `->' /usr/src/linux/include/linux/spinlock.h:609: warning: implicit declaration of function `test_thread_flag' /usr/src/linux/include/linux/spinlock.h:609: `TIF_NEED_RESCHED' undeclared (first use in this function) /usr/src/linux/include/linux/spinlock.h:609: (Each undeclared identifier is reported only once /usr/src/linux/include/linux/spinlock.h:609: for each function it appears in.) /usr/src/linux/include/linux/spinlock.h: In function `bit_spin_is_locked': /usr/src/linux/include/linux/spinlock.h:620: invalid type argument of `->' apmsleep.c: In function `main': apmsleep.c:120: warning: implicit declaration of function `exit' apmsleep.c: At top level: apmsleep.c:66: warning: `rcsid' defined but not used make: *** [apmsleep.o] Error 1 rm apm.o apmd.o !!! ERROR: sys-apps/apmd-3.0.2-r3 failed. !!! Function src_compile, Line 46, Exitcode 2 !!! compile problem
same kernel by the way -mm sources.
*** Bug 30450 has been marked as a duplicate of this bug. ***
The apmd-3.1.0 ebuild in bugzilla has the same problems.
Created attachment 19184 [details, diff] APMD patch
Try the patch I just wrote [do a manual compile]. If it works, I'll commit this in and fix the ebuild accordingly.
This patch cannot be applied to the version in the portage. However, if I do the changes manually, it compiles without errors.
I know it compiles fine and I know it won't apply against portage, but does apmd work properly as well? I just need to confirm that before adding the patch to CVS.
Sorry, I can't tell you, because I have no APM support in my kernel right now. I just encountered this bug while upgrading gnome - that was the reason why I submitted it. Maybe someone else can tell more...
In CVS. I suppose if it compiles and works on 2.5 it should work fine on 2.6...