Skip to content

Ccache tries to cache PCH but fails because of -gsplit-dwarf #419

@llunak

Description

@llunak

When LibreOffice build creates a precompiled header, it creates it similarly to how sources are compiled, using (more or less) the same CXX and CXXFLAGS, just with -x c++-header and some adjustments. If ccache is used, it tries to handle such PCH creation as a normal compile, and in normal cases, that works. But if -gsplit-dwarf if used, ccache assumes a .dwo file will be created, which it won't be during PCH creation. See the log file attached.
ccache.txt

There are several problems:

  • As can be seen in the log, the internal ccache error causes each PCH to be generated twice.
  • Ccache doesn't clean up properly and leaves those files in its cache (I'm not sure if they count as being in the cache or they're simply forgotten).
  • And finally, should ccache even cache PCHs? Especially without compression and with GCC they can be huge. Even with Clang, which produces noticeably smaller PCHs, all PCHs for my LibreOffice build total at 1.6GiB uncompressed (with ~10GiB object files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions