[rb-general] Compiling temporary files with gcc (OCaml compilation)
Vagrant Cascadian
vagrant at debian.org
Wed Jun 20 23:43:57 CEST 2018
On 2018-06-20, Sylvain wrote:
> On 20/06/2018 16:41, Chris Lamb wrote:
>>> We just found -fdebug-prefix-map which seems to do what we want for
>>> both gcc and clang.
>> Indeed! For others following along, you can find the (NB. *draft*)
>> specification here:
>>
>> https://reproducible-builds.org/specs/build-path-prefix-map/
>
> I believe those two are different. The above document starts by
> criticizing -fdebug-prefix-map.
It's true; having to pass -fdebug-prefix-map on the commandline can
result in the build-paths you want stripped from the binaries ending up
in binaries in which the build system embeds the commandline.
So it's not as complete. There may also be some additional flexibility
lost in the mapping syntax for the proposed build-path-prefix-map
specification.
It doesn't seem likely we'll be able to get support for a
BUILD_PATH_PREFIX_MAP environment variable into gcc any time soon, as
there's resistance to the idea of using an environment variable for this
purpose... perhaps other compilers and toolchains will see things
differently?
There is also -ffile-prefix-map and -fmacro-prefix-map which seems to be
in gcc 8:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
Which addresses embedding build paths in the __FILE__, __BASE_FILE__,
and __builtin_FILE() macros similarly to -fdebug-prefix-map. It still
has the issue of requiring it be passed via the commandline, and all the
unfortunate consequences of that.
There are a fair number of cases which do not embed the commandline, and
so this is at least progress in the right direction, to some degree.
live well,
vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.reproducible-builds.org/pipermail/rb-general/attachments/20180620/b7b10375/attachment.sig>
More information about the rb-general
mailing list