How do I fix compile errors due to "coverage-mismatch"?

I am not completely sure but I think this only shows up in “release” mode, in other words when configure has been run like this:

./configure --enable-optimizations --with-lto

Some source code changes appear to cause this compiler error to show up.

Rebuilding with profile guided optimizations:
Python/bltinmodule.c: In function ‘_PyBuiltin_Init’:
Python/bltinmodule.c:3170:1: error: source locations for function ‘_PyBuiltin_Init’ have changed, the profile data may be out of date [-Werror=coverage-mismatch]
 3170 | _PyBuiltin_Init(PyInterpreterState *interp)
      | ^~~~~~~~~~~~~~~

Is there a convenient way to fix it?

So far all I have been able to do is do perform a make clean followed by re-running the configure step.

I am guess based on the error message.

You have not generated the profile data that matches the code you have compiled it seems.

That sounds sensible. How can I re-generate the profile data?

Sorry I do not know. Suggest you investigate how LTO with profile data works.
Also you may find that the default python package for your OS implements the build steps and you could copy those steps.