From: Sam Ravnborg <sam@ravnborg.org>
To: Fred Isaman <iisaman@citi.umich.edu>
Cc: linux-kbuild@vger.kernel.org
Subject: Re: potential linking bug in recursive directory descent
Date: Tue, 24 Feb 2009 22:03:39 +0100 [thread overview]
Message-ID: <20090224210339.GA16943@uranus.ravnborg.org> (raw)
In-Reply-To: <b493f8670902241105l48bd7cdbmb99608e802d2454a@mail.gmail.com>
On Tue, Feb 24, 2009 at 02:05:25PM -0500, Fred Isaman wrote:
> 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.
kbuild only links in libaries if there is any users of siad library.
And your normal config has no users of lib/find_last_bit.c so
it is not linked into the kernel.
The general rule is that if any in tree module uses a library
then the library is always linked in.
And to always link in a library you need to patch the Makefile
as Randy suggest in his mail.
Sam
next prev parent reply other threads:[~2009-02-24 21:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090224210339.GA16943@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=iisaman@citi.umich.edu \
--cc=linux-kbuild@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox