[poky] Odd log messages for apps using autotools and __FILE__
Khem Raj
raj.khem at gmail.com
Sat Aug 8 12:19:15 PDT 2015
> On Aug 8, 2015, at 9:30 AM, Richard Purdie <richard.purdie at linuxfoundation.org> wrote:
>
> On Fri, 2015-08-07 at 20:26 +0200, Holger Freyther wrote:
>> Hi,
>>
>> in the Osmocom software and rauc and probably many applications that use __FILE__ in a
>> log statement the log output is now:
>>
>> /home/hfreyther/images/poky/build/tmp/work/sysmobts_v2-poky-linux-gnueabi/rauc/0+gitAUTOINC+d44adb0079-r4/git/src/install.c:811 I will unmount /mnt/rauc/rootfs.0
>>
>> where it used to be:
>>
>> install.c:811 I will unmount /mnt/rauc/rootfs.0
>>
>>
>> I know I can use __BASE_FILE__ in gcc to get back to install.c
__BASE_FILE__ is a gnu extension, just be aware of that if you target portability
>> but I wonder where this is
>> coming from? Is this a side-effect of using B!=S? Is there another config that was made to
>> pass the full path to the compiler?
>
> I can confirm that this is from the B != S change.
>
> We've kept meaning to go and look at how gcc generates these paths to
> maybe try and add the option to remove a prefix for example. The .debug
> src paths have a rewrite mechanism and we could use this for other paths
> too?
__FILE__ is one of standard pre-processing macros that are computed by cpp and its supposed to contain the path and name by which cpp opens the current input file and naturally when B != S then you are referring to source file more commonly with absolute path, one could use relative paths w.r.t build dir but thats up to components build system and may not be even possible in all cases. I don’t think there is any thing to fix there in compiler unless we want to violate the standard. .debug rewrite might be a different thing someone tried a stab at it see
https://sourceware.org/ml/gdb-patches/2011-06/msg00385.html but didn’t move very far since there were alternative ways.
>
> Cheers,
>
> Richard
>
> --
> _______________________________________________
> poky mailing list
> poky at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.yoctoproject.org/pipermail/poky/attachments/20150808/f5fc49fa/attachment.pgp>
More information about the poky
mailing list