[OE-core] [PATCH] gstreamer1.0: Shorten __FILE__ in gst_debug_log output on all platforms.

Peter Urbanec openembedded-devel at urbanec.net
Fri Feb 27 03:28:05 UTC 2015


On 27/02/15 09:00, Otavio Salvador wrote:
> On Thu, Feb 26, 2015 at 6:47 PM, Richard Purdie
> <richard.purdie at linuxfoundation.org> wrote:
>> On Fri, 2015-02-27 at 04:31 +1100, Peter Urbanec wrote:
>>> On WIN32 the file argument to gst_debug_log_valist is shortened to just
>>> the filename. This is useful not only for MSVC, but also with gcc/Linux
>>> when doing cross-compilation builds and out-of-tree builds.
>>
>> Ultimately I think we need to address this issue in gcc itself, probably
>> setting some kind of base path in the environment which it removes from
>> __FILE__ (set to ${S}). There were more complex discussions about using
>> the same mapping code as can be used with the debug symbols code too.
>
> Agreed; this should indeed be a global fix as this affects virtually
> all packages.

I also agree, but this patch can go ahead regardless of what the global 
solution is. The patch enables a mechanism that already exists in 
gstreamer (but is only enabled on WIN32) and solves an immediate need in 
that context. Whatever the global solution is, this patch is very likely 
to continue working correctly.

Having a proper solution at the gcc level will significantly reduce the 
size of the generated files, so there is certainly a win to be had 
there. I had a look at both C99 and C++98 standards and the semantics of 
the __FILE__ macro are implementation defined and do not stipulate any 
particular interpretation. In particular, there's no requirement to have 
path information preserved.

I think a simple patch to gcc to transform a full pathname to basename 
is probably sufficient for oe-core - the less complexity is introduced 
the better.



More information about the Openembedded-core mailing list