https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664
--- Comment #7 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> --- So, to summarise my understanding: - the problem is not specific to darwin, I can fully reproduce on x86_64-linux-gnu - the problem only arises if you configure with a --program-suffix that is equal to the version. Then $(target_noncanonical)-gcc-$(version) is equal to $(GCC_TARGET_INSTALL_NAME) and this triggers the issue. I am not sure if it is the cleanest way to fix things, but I think we can safely remove the temporary file after "mv", in all cases, like this: diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 97e5450ecb5..602c382e86e 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3780,6 +3780,7 @@ install-driver: installdirs xgcc$(exeext) ( cd $(DESTDIR)$(bindir) && \ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \ mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \ + rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \ fi; \ fi I can confirm this fixes the issue.