2.4.10 build failure - atomic_dec_and_lock export

From: Ian Grant (Ian.Grant@cl.cam.ac.uk)
Date: Tue Oct 02 2001 - 10:18:40 EST


Trond,

2.4.10 won't link with CONFIG_SMP and i386 CPU selected. I believe the problem
lies in in the #ifndef atomic_dec_and_lock in lib/dec_and_lock.c. As far as I
can see this symbol is always defined because it's exported.

The following patch works for me, but I barely understand the kernel build
machinery(*) so please don't use this without checking it carefully.

Ian

* e.g. I cannot understand why this symbol isn't versioned in the object file.

--- linux/lib/dec_and_lock.c.orig Tue Oct 2 15:47:44 2001
+++ linux/lib/dec_and_lock.c Tue Oct 2 16:07:01 2001
@@ -1,3 +1,4 @@
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
@@ -26,7 +27,8 @@
  * store-conditional approach, for example.
  */
 
-#ifndef atomic_dec_and_lock
+#ifdef CONFIG_SMP
+#ifndef CONFIG_HAVE_DEC_LOCK
 int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
 {
         spin_lock(lock);
@@ -37,4 +39,5 @@
 }
 
 EXPORT_SYMBOL(atomic_dec_and_lock);
+#endif
 #endif

-- 
Ian Grant, Computer Lab., William Gates Building, JJ Thomson Ave., Cambridge
Phone: +44 1223 334420

- 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 : Sun Oct 07 2001 - 21:00:22 EST