public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* potential linking bug in recursive directory descent
@ 2009-02-24 19:05 Fred Isaman
  2009-02-24 19:19 ` Randy Dunlap
  2009-02-24 21:03 ` Sam Ravnborg
  0 siblings, 2 replies; 8+ messages in thread
From: Fred Isaman @ 2009-02-24 19:05 UTC (permalink / raw)
  To: linux-kbuild

The pnfs tree base of of 2.6.29-rc5 uses the new find_last_bit
function (defined in
lib/find_last_bit.c) in a file in the fs/nfs directory.  Myself and
another developer (though no one else so far) get the following error
during compile:

   Kernel: arch/x86/boot/bzImage is ready  (#5)
     Building modules, stage 2.
     MODPOST 515 modules
   ERROR: "find_last_bit" [fs/nfs/nfs.ko] undefined!
   make[2]: *** [__modpost] Error 1
   make[1]: *** [modules] Error 2
   make: *** [sub-make] Error 2


Note that find_last_bit() is not used in any file in the fs directory.
If I add it to any function that is EXPORT_SYMBOL'ed
from the fs directory, suddenly the compile errors go away.  (See the
below patch for a more concrete example.)

I am not sure what is going on, and why it only affects some
developers, but it looks a lot like the kbuild system
is deciding that the library does not need to be included at the fs
directory level, so isn't including it in fs/nfs where
it is needed.

Thanks for any help.
Fred

From 4bd89543983640ab01c9b704d427f83dad3aa455 Mon Sep 17 00:00:00 2001
From: Fred Isaman <iisaman@citi.umich.edu>
Date: Fri, 20 Feb 2009 11:58:52 -0500
Subject: [PATCH 1/1] DEBUG: Need this to compile - what the heck?

This looks suspiciously like a bug in the kbuild system, where
the library include is not passed down to fs/nfs unless it is
used by fs.  Without this, I get the following error during linking:

Kernel: arch/x86/boot/bzImage is ready  (#5)
 Building modules, stage 2.
 MODPOST 515 modules
ERROR: "find_last_bit" [fs/nfs/nfs.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make: *** [sub-make] Error 2

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
---
 fs/inode.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index 306faef..a4e29b3 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -226,6 +226,7 @@ EXPORT_SYMBOL(destroy_inode);
 */
 void inode_init_once(struct inode *inode)
 {
+       find_last_bit((unsigned long *) inode, 5);
       memset(inode, 0, sizeof(*inode));
       INIT_HLIST_NODE(&inode->i_hash);
       INIT_LIST_HEAD(&inode->i_dentry);
--
1.6.0.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-02-25  1:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24 19:05 potential linking bug in recursive directory descent Fred Isaman
2009-02-24 19:19 ` Randy Dunlap
2009-02-24 20:19   ` Fred Isaman
2009-02-24 21:03 ` Sam Ravnborg
2009-02-24 21:20   ` Fred Isaman
2009-02-24 21:28     ` Randy Dunlap
2009-02-25  1:04       ` Fred Isaman
2009-02-24 21:46     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox