I've done an "emerge --clean rsync" and then an "emerge apmd" and I get this: root@wlan-3 root # emerge apmd Calculating dependencies ...done! >>> emerge sys-apps/apmd-3.0.2-r1 to / >>> Unpacking source... >>> Unpacking apmd-3.0.2.tar.gz >>> Source unpacked. gcc -c -O2 -mcpu=i686 -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 -O2 -mcpu=i686 -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 gcc -o apm apm.o -L. -lapm gcc -c -O2 -mcpu=i686 -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 gcc -o apmd apmd.o -L. -lapm gcc -c -O2 -mcpu=i686 -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 apmsleep.c:49: /usr/src/linux/include/asm/spinlock.h: In function `spin_lock': /usr/src/linux/include/asm/spinlock.h:137: parse error before `LOCK_SECTION_START' /usr/src/linux/include/asm/spinlock.h: In function `read_lock': /usr/src/linux/include/asm/spinlock.h:188: parse error before `LOCK_SECTION_START' /usr/src/linux/include/asm/spinlock.h:188: warning: implicit declaration of function `LOCK_SECTION_START' /usr/src/linux/include/asm/spinlock.h:188: parse error before string constant /usr/src/linux/include/asm/spinlock.h: In function `write_lock': /usr/src/linux/include/asm/spinlock.h:197: parse error before `LOCK_SECTION_START' /usr/src/linux/include/asm/spinlock.h:197: parse error before string constant apmsleep.c: At top level: apmsleep.c:64: warning: `rcsid' defined but not used make: *** [apmsleep.o] Error 1 rm apm.o apmd.o !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line 2, Exitcode 2 !!! compile problem !!! emerge aborting on /usr/portage/sys-apps/apmd/apmd-3.0.2-r1.ebuild .
I get the exact same problem. Kernel is 2.4.19 with apm section configured as follows: CONFIG_PM=y # CONFIG_ACPI is not set CONFIG_APM=y # CONFIG_APM_IGNORE_USER_SUSPEND is not set CONFIG_APM_DO_ENABLE=y CONFIG_APM_CPU_IDLE=y CONFIG_APM_DISPLAY_BLANK=y # CONFIG_APM_RTC_IS_GMT is not set CONFIG_APM_ALLOW_INTS=y # CONFIG_APM_REAL_MODE_POWER_OFF is not set
Try updating your linux *headers* to 2.4.19, and this problem should go away.
This still occurs with 1.1a: sys-kernel/linux-sources-2.4.19 sys-kernel/linux-headers-2.4.19 and 2.4.19-r1 (from 1.1 install) and sys-kernel/linux-sources-2.4.19-r1 sys-kernel/linux-headers-2.4.18 which appear to be the latest unmasked combination
I also have the exact same apmd error on a IBM Thinkpad 600e for which I have gotten apmd working under different distros. both my kernel source and kernel headers appear to be 2.4.19-r1 according to emerge -s linux. however the kernel-headers still list 2.4.18 as the newest available while 2.4.19-r1 is listed as installed. My system as a whole is 1.1a or newer.
It seems like the linux-gentoo-2.4.19-r1.patch is adding the spinlock code into the kernel source and that the spinlock code has some sort of bug going on. Having the 2.4.18 headers package and the 2.4.19-r1 should not be a problem as long as the 2.4.19-r1 is installed later, since the kernel source contains all headers. I am no kernel guru, so maybe someone familiar with the spinlock code can take a look...
*** This bug has been marked as a duplicate of 1472 ***