https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104006
--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 52184 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52184&action=edit gcc12-pr104006.patch Fix. I've added $(version_dep) to BUILT_SOURCES because I thought it is a generated file like the others (it is), but missed that in the Solaris case it depends on all those *.lo files, and BUILT_SOURCES is something that should be done before all-am. So, this patch reverts that part of the change and instead cleans the $(version_dep) files in clean-local, so that they are ever removed when make clean/distclean.