On Fri, Sep 21, 2007 at 01:06:21AM +0200, Indan Zupancic wrote:Thats a bit unavoidable as the build system works. __FILE__ is passed the filename supplied as argument to gcc. Try: echo "char *s = __FILE__;" > sam.c gcc -E sam.c This gives you: # 1 "sam.c" # 1 "<built-in>" # 1 "<command line>" # 1 "sam.c" char *s="sam.c"; gcc -E ~/sam.c This gives you: # 1 "/home/sam/sam.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/home/sam/sam.c" char *s="/home/sam/sam.c"; So __FILE__ expand differently depending on the path on the gcc command line. I once posted a patch to fix up on this, especialy for BUG_ON and friends. The solution was to let kbuild generate the filename and to use this define in the source code. But a quick grep for __FILE__ in the kernel source made me chicken out. Simply too much chrunch at that time to justify it. Googeling a bit I found it here: http://lkml.org/lkml/2006/7/8/22 The better approach would be to use at least the patch inside the kernel. This patch should be easy to update to latest kernel if anyone is up to play with it. I recall that there was some problems with the path used. But I cannot remember the details. Andrew had some inputs from his testing IIRC and google should be able to tell the full story. Sam -
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 006/196] Chinese: add translation of oops-tracing.txt |
| Eric Sandeen | Re: [RFC] Heads up on sys_fallocate() |
| YOSHIFUJI Hideaki / | request_module: runaway loop modprobe net-pf-1 (is Re: Linux 2.6.21-rc1) |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Ben Greear | Re: MACVLANs really best solution? How about a bridge with multiple bridge virtual... |
| Rafael J. Wysocki | 2.6.29-rc8: Reported regressions from 2.6.28 |
