[cfe-dev] Relocatable modules?

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Fri Aug 17 19:18:49 PDT 2018


On Fri, 17 Aug 2018 at 18:15, Andrew Gallagher via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> I was looking into getting a build system to cache/share module files
> (i.e. *.pcm files) between different users to speed up builds.  One problem
> is that it appears clang is embedding absolute paths into the module file,
> which causes issues when users build from different locations (e.g. their
> home directories).  From the output of `clang -fmodule-file-info ...` it
> looks like this absolute path is the location of the various
> `module.modulemap` files the build uses.  Anyone know of a way to get clang
> to these absolute path (e.g. using relative paths instead, or something
> similar to `$ORIGIN`)?
>

The paths to module.modulemap files found implicitly by clang will be based
on the -I / -isystem paths that Clang is using: if those paths are
relative, Clang should use relative paths to the module map files, and if
those paths are absolute, Clang will use absolute paths to the module map.
(The paths to module.modulemap files found by explicit -fmodule-map-file=
arguments should match the form used in said argument.)

You can also diff the output of "llvm-bcanalyzer -dump" to investigate how
modules built on different machines differ.


> Thanks!
> Andrew
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180817/61ac2ab3/attachment.html>


More information about the cfe-dev mailing list