[rb-general] Compiling temporary files with gcc (OCaml compilation)

Jeremie Dimino jdimino at janestreet.com
Thu Jun 21 11:58:44 CEST 2018

Yh, I saw about BUILD_PATH_PREFIX_MAP. We added support for it in
OCaml. That seems like a good solution to me.

BTW, I just realised that if you pass -g to gcc, it stores the command
line into the object file, which completely defeat the purpose of
-fdebug-prefix-map :/
On Wed, Jun 20, 2018 at 10:44 PM Vagrant Cascadian <vagrant at debian.org> wrote:
> 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
> _______________________________________________
> rb-general at lists.reproducible-builds.org mailing list
> To change your subscription options, visit https://lists.reproducible-builds.org/listinfo/rb-general.
> To unsubscribe, send an email to rb-general-unsubscribe at lists.reproducible-builds.org.


More information about the rb-general mailing list