[poky] GCC patch Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch

Richard Purdie richard.purdie at linuxfoundation.org
Wed Sep 21 06:27:47 PDT 2016


On Wed, 2016-09-21 at 14:20 +0200, Tomasz Meresinski wrote:
> Hi
> I found some difficulties when compiling some of our internal 
> applications because of gcc patch called 
> "Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch"
> As far as I can see it makes __FILE__ macro to point to Yocto source 
> file location not build system's.
> 
> Now let me describe that problem:
> 1) CMake script gets source directory (so it's build system path)
> 2) CMake calculates its length and adds it as a define to
> application 
> (call it LEN)
> 3) A simple way to get a filename from __FILE__ macro is to compute 
> __FILE__ + LEN
> 4) Crash
> 
> Is this patch really a big deal?

Without it, build paths get encoded into the binaries. This means the
binaries differ depending on where they're built, it also means those
paths can be exposed to end users which can be confusing and doesn't
match the debug source locations used on target.

If you don't care about those things, its not a big deal. Personally, I
do believe that reproducible binaries are important though. I think
cmake is making some assumptions here it shouldn't.

Cheers,

Richard





More information about the poky mailing list