Re: __FILE__ gets expanded to absolute pathname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux