]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc: check if target install name equals the full driver name
authorXinhui Yang <cyan@cyano.uk>
Tue, 11 Nov 2025 02:19:35 +0000 (10:19 +0800)
committerXi Ruoyao <xry111@xry111.site>
Thu, 20 Nov 2025 10:41:55 +0000 (18:41 +0800)
When a major version program suffix is specified, along with
--with-gcc-major-version-only, GCC tries to install $TRIPLE-gcc-tmp into
the destination BINDIR and link it to TRIPLE-gcc-SUFFIX. However this
executable is installed in the previous step, thus leaving the gcc-tmp
unmodified.

This is because when --program-suffix=15 (any major version) and
--with-gcc-major-version-only, $(version) will be the major version
number, thus making FULL_DRIVER_NAME and GCC_TARGET_INSTALL_NAME
identical to each other. We check if these two is identical and skip the
latter step if they are.

gcc/
PR bootstrap/105664
* Makefile.in (install-driver): detect name collision when
installing the driver program.

Signed-off-by: Xinhui Yang <cyan@cyano.uk>
gcc/Makefile.in

index d05e15e2b6ce1a17094fbe0e516147cd2f1442ea..02cc38ce57e06cde4f174604f4f275405ea5cb28 100644 (file)
@@ -4253,7 +4253,8 @@ install-driver: installdirs xgcc$(exeext)
              $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \
          fi; \
          if [ ! -f gcc-cross$(exeext) ] \
-             && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
+             && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ] \
+             && [ "$(GCC_TARGET_INSTALL_NAME)$(exeext)" != "$(FULL_DRIVER_NAME)" ] ; then \
            rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
            ( cd $(DESTDIR)$(bindir) && \
              $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \