From: Denis Vlasenko <vda@ilport.com.ua>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: __FILE__ gets expanded to absolute pathname
Date: Tue, 25 Apr 2006 15:08:50 +0300 [thread overview]
Message-ID: <200604251508.51028.vda@ilport.com.ua> (raw)
In-Reply-To: <444E0D07.8060309@tls.msk.ru>
On Tuesday 25 April 2006 14:50, Michael Tokarev wrote:
> Denis Vlasenko wrote:
> > Sometime ago I noticed that __FILE__ gets expanded into
> > *absolute* pathname if one builds kernel in separate object directory.
> >
> > I thought a bit about it but failed to arrive at any sensible
> > solution.
> >
> > Any thoughs?
> > --
> > vda
> >
> > # strings vmlinux | grep /usr/src
> > /.share/usr/src2/kernel/linux-2.6.16.via-rhine.src/drivers/net/3c505.c
> > /.share/usr/src2/kernel/linux-2.6.16.via-rhine.src/arch/i386/kernel/time.c
> ....
>
> As far as I remember, this happens when compiling with O=xxx only, ie,
> only when specifying alternative object (or source) directory. Normally
> (when you compile in the source directory) they'll be like drivers/net/3c505.c,
> arch/i386/kernel/time.c etc, ie, relative to the kernel top source dir.
> It's because when you specify O= etc, complete source dir is passed from
> makefiles, instead of relative one.
Yes, of course you are right.
> But it was long time since I switched to symlink-tree + compile instead of
> compiling with O=, and things may had changed since that.
Doable, but it's not a solution, it's more like a workaround.
I'd prefer O=... build to not expand __FILE__ to full pathname.
--
vda
prev parent reply other threads:[~2006-04-25 12:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-25 7:44 Denis Vlasenko
2006-04-25 11:03 ` Alistair John Strachan
2006-04-25 11:50 ` Michael Tokarev
2006-04-25 12:08 ` Denis Vlasenko [this message]
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=200604251508.51028.vda@ilport.com.ua \
--to=vda@ilport.com.ua \
--cc=linux-kernel@vger.kernel.org \
--cc=mjt@tls.msk.ru \
/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
all inboxes | Powered by JetHome®