laptop tpctl # USE="tpctlir" emerge tpctl Calculating dependencies ...done! >>> emerge (1 of 1) sys-apps/tpctl-4.4-r1 to / >>> md5 src_uri ;-) tpctl_4.4.tar.gz >>> Unpacking source... >>> Unpacking tpctl_4.4.tar.gz to /var/tmp/portage/tpctl-4.4-r1/work >>> Source unpacked. make: Entering directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/lib' gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -I../include -fPIC -DLINUX -o smapidev.o -c smapidev.c ld -shared -lc -soname libsmapidev.so.2 -o libsmapidev.so.2.0 smapidev.o ln -sf libsmapidev.so.2.0 libsmapidev.so.2 ln -sf libsmapidev.so.2 libsmapidev.so make: Leaving directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/lib' make: Entering directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/tpctl' gcc -Wall -Wcast-align -Wstrict-prototypes -Wno-uninitialized -O2 -L../lib -I../include -DLINUX -o tpctl.o -c tpctl.c gcc -Wall -Wcast-align -Wstrict-prototypes -Wno-uninitialized -O2 -L../lib -I../include -DLINUX -o tpctl tpctl.o -lncurses -lsmapidev make: Leaving directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/tpctl' make: Entering directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/ntpctl' gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -L../lib -I../include -DLINUX -o ntpctl.o -c ntpctl.c gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -L../lib -I../include -DLINUX -o event_cond.o -c event_cond.c gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -L../lib -I../include -DLINUX -o pointing_device.o -c pointing_device.c gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -L../lib -I../include -DLINUX -o timer.o -c timer.c gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -L../lib -I../include -DLINUX -o ntpctl ntpctl.o event_cond.o pointing_device.o timer.o -lmenu -lncurses -lsmapidev make: Leaving directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/ntpctl' make: Entering directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/tpctlir' gcc -Wall -Wcast-align -Wstrict-prototypes -O2 -o tpctlir tpctlir.c tpctlir.c: In function `main': tpctlir.c:18: warning: implicit declaration of function `strcmp' /var/tmp/portage/tpctl-4.4-r1/temp/ccR4UyEY.o(.text+0xa1): In function `main': : undefined reference to `__global_cli' /var/tmp/portage/tpctl-4.4-r1/temp/ccR4UyEY.o(.text+0xcc): In function `main': : undefined reference to `__global_sti' collect2: ld returned 1 exit status make: *** [tpctlir] Error 1 make: Leaving directory `/var/tmp/portage/tpctl-4.4-r1/work/tpctl-4.4/tpctlir' !!! ERROR: sys-apps/tpctl-4.4-r1 failed. !!! Function src_compile, Line 32, Exitcode 2 !!! tpctlir make failed This is on a Thinkpad 760EL. so I really need tpctlir. without USE="tpctlir" it compiles fine. if you need additional info: #gentoo: roger55 Reproducible: Always Steps to Reproduce: 1. 2. 3.
This looks you are compiling an SMP module for a non-SMP kernel. In asm.system.h: #ifdef CONFIG_SMP extern void __global_cli(void); extern void __global_sti(void); extern unsigned long __global_save_flags(void); extern void __global_restore_flags(unsigned long); #define cli() __global_cli() #define sti() __global_sti() #define save_flags(x) ((x)=__global_save_flags()) #define restore_flags(x) __global_restore_flags(x)
Added a patch that makes it compile regardless of CONFIG_SMP setting, but I'm not certain it works perfectly anymore. (According to the Linux IO Programming Mini-HOWTO, my new approach is how to do it, but it's probably outdated....)
fix works fine. emerged and works fine. thanks a lot! roger55