[PATCH] link failur in Linux 2.4.9-ac16 around apm.o and sysrq.o

junio@siamese.dhis.twinsun.com
27 Sep 2001 22:21:24 -0700


2.4.9-ac16 fails to link with CONFIG_APM=y and
CONFIG_MAGIC_SYSRQ=n. This is because apm.c unconditionally
makes calls to functions (__sysrq_lock_table and friends)
defined in sysrq.c.

I can think of a couple of different approaches to work this
around, but is there an established proper way to resolve this
kind of dependency in the kernel code?

I've attached a fix based on (3) below at the end of this message.

(1) In include/linux/sysrq.h, define stubs for
__sysrq_lock_table that does not do anything when
CONFIG_MAGIC_SYSRQ is not set;

(2) Change ''make config'' procedure so that CONFIG_MAGIC_SYSRQ
is always set if CONFIG_APM is defined;

(3) Change drivers/char/Makefile to make sysrq.o to be linked
in if CONFIG_APM is defined (even if CONFIG_MAGIC_SYSRQ is).

--- 2.4.9-ac16.sffix/drivers/char/Makefile Thu Sep 27 12:46:56 2001
+++ 2.4.9-ac16.sffix/drivers/char/Makefile Thu Sep 27 22:08:19 2001
@@ -143,6 +143,7 @@
endif

obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
+obj-$(CONFIG_APM) += sysrq.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
obj-$(CONFIG_ROCKETPORT) += rocket.o
obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/