Skip to content

Enabling C++20 modules in GCC breaks precompiled_header #141

@overlord624

Description

@overlord624

Passing the "-fmodules-ts" compiler option in GCC results in an implicitly appended .gch extension to the output of a precompiled_header directive. When this build step is then passed to an executable directive via the pch argument, the generated compiler instruction will not have the implicit extension added, which results in a "file not found" error.

Attached is a sample which triggers the issue, invoke as such:

CXX=g++-11 bfg9000 configure build --toolchain=toolchain.bfg
cd build
make

No error occurs if the toolchain argument is omitted or "-fmodules-ts" is removed from the toolchain definition file.
Note that modules were added in GCC 11 and this compiler option does not exist in earlier versions.

pch_module_sample.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions