Re: linux-2.4.9: atomic_dec_and_lock sometimes used while not defined

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Fri Aug 17 2001 - 05:15:56 EST


>>>>> " " == Adam J Richter <adam@yggdrasil.com> writes:
>> If I try to build a kernel that can do SMP and run on a 386,
>> the linux-2.4.9 NFS client gets compiled with an undefined
>> reference to atomic_dec_and_lock().

Bummer I found the bug. It's not a missing define, but a missing
export...

Cheers,
  Trond

diff -u --recursive --new-file linux-2.4.9.orig/lib/Makefile linux-2.4.9/lib/Makefile
--- linux-2.4.9.orig/lib/Makefile Wed Apr 25 22:31:03 2001
+++ linux-2.4.9/lib/Makefile Fri Aug 17 11:52:35 2001
@@ -16,6 +16,7 @@
 obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
 
 ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
+ export-objs += dec_and_lock.o
   obj-y += dec_and_lock.o
 endif
 
diff -u --recursive --new-file linux-2.4.9.orig/lib/dec_and_lock.c linux-2.4.9/lib/dec_and_lock.c
--- linux-2.4.9.orig/lib/dec_and_lock.c Sat Jul 8 01:22:48 2000
+++ linux-2.4.9/lib/dec_and_lock.c Fri Aug 17 11:55:02 2001
@@ -1,3 +1,4 @@
+#include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
 
@@ -34,4 +35,6 @@
         spin_unlock(lock);
         return 0;
 }
+
+EXPORT_SYMBOL(atomic_dec_and_lock);
 #endif
-
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/



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:22 EST