The object and dependency rules named ../makeflags as a prerequisite but
not ../localconf, even though localconf is -include'd right after it and
overrides the same variables -- CC, CXX and CCFLAGS. Editing localconf
therefore recompiled nothing.
Objects record nothing about the compiler that produced them, so a
toolchain switch made in localconf leaves the tree holding a mix of two
compilers' output. Under -flto that surfaces at link time as "plugin
needed to handle lto object", which names neither localconf nor the
compilers, and is a poor clue to what actually happened.
Add localconf to the prerequisites via BUILD_CONF. It is optional and
has no rule to create it, so $(wildcard) names it only when it exists; an
unconditional prerequisite would make its absence an error on a clean
checkout, which is presumably why it was left out to begin with.
Include the .dep rules, which previously depended on neither file.
Generated dependencies name the compiler's own header paths, and they are
pulled in with `include' rather than `-include', so a dep left pointing
at a header the new toolchain does not ship does not merely miss a
rebuild: it stops the build with "No rule to make target".