[rb-general] [PATCH] gcc: read -fdebug-prefix-map OLD from environment (improved reproducibility)
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Fri Dec 11 17:49:19 CET 2015
On Thu 2015-12-10 19:12:57 -0500, Daniel Kahn Gillmor wrote:
> On Thu 2015-12-10 18:59:33 -0500, Joseph Myers wrote:
>> On Thu, 10 Dec 2015, Daniel Kahn Gillmor wrote:
>>
>>> Specifically, if the first character of the "old" argument is a
>>> literal $, then gcc will treat it as an environment variable name, and
>>> use the value of the env var for prefix mapping.
>>
>> I don't think a literal $ in option arguments is a good idea; it's far too
>> hard to pass through a sequence of shells and makefiles that you typically
>> get in recursive make. You end up with things like
>> '-Wl,-rpath,'\''\\\$$\$$\\\$$\$$ORIGIN'\''/../' (part of a process for
>> using $ORIGIN when linking GDB) if you try.
>
> yow, that's truly monstrous!
>
> Is there a different symbol or string you'd be OK using instead for the
> same approach? What about looking for an "ENV:" prefix?
>
> so something like:
>
> -fdebug-prefix-map=ENV:SOURCE_BUILD_DIR=/usr/src
>
> wdyt? I could rework the patch pretty easily if that seems acceptable.
I've re-rolled the patch (attached below, here) to use the ENV: prefix
instead of the $.
I've also updated the patch on
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68848 to match this
approach.
Thanks for the input, Joseph.
Regards,
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-gcc-read-fdebug-prefix-map-OLD-from-environment-i.patch
Type: text/x-diff
Size: 4436 bytes
Desc: not available
URL: <http://lists.reproducible-builds.org/pipermail/rb-general/attachments/20151211/8b7f896b/attachment.patch>
More information about the rb-general
mailing list