https://gcc.gnu.org/g:823c96905429dbac1dffbdaace8f2d215d507a84
commit r16-7862-g823c96905429dbac1dffbdaace8f2d215d507a84 Author: Jonathan Yong <[email protected]> Date: Thu Feb 26 11:24:13 2026 +0000 gcc: libgdiagnostics DLL for mingw should be for mingw hosts Fixed incorrect attempts to build a libgdiagnostics by naming it as a DLL when gcc is configured as a cross compiler that targets mingw but hosted on non-Windows systems. gcc/ChangeLog: * Makefile.in: the libgdiagnostics shared object for mingw should be based on host name, not target name. Signed-off-by: Jonathan Yong <[email protected]> Diff: --- gcc/Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 4e0f50357f6f..b97cc7a0d133 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1133,7 +1133,7 @@ ALL_LINKERFLAGS = $(ALL_CXXFLAGS) $(LD_PICFLAG) # Use the "pic" build of libiberty if --enable-host-shared or --enable-host-pie, # unless we are building for mingw. -LIBIBERTY_PICDIR=$(if $(findstring mingw,$(target)),,pic) +LIBIBERTY_PICDIR=$(if $(findstring mingw,$(host)),,pic) ifneq ($(enable_host_shared)$(enable_host_pie),) LIBIBERTY = ../libiberty/$(LIBIBERTY_PICDIR)/libiberty.a else @@ -2374,7 +2374,7 @@ LIBGDIAGNOSTICS_VERSION_NUM = 0 LIBGDIAGNOSTICS_MINOR_NUM = 0 LIBGDIAGNOSTICS_RELEASE_NUM = 1 -ifneq (,$(findstring mingw,$(target))) +ifneq (,$(findstring mingw,$(host))) LIBGDIAGNOSTICS_FILENAME = libgdiagnostics-$(LIBGDIAGNOSTICS_VERSION_NUM).dll LIBGDIAGNOSTICS_IMPORT_LIB = libgdiagnostics.dll.a @@ -2447,7 +2447,7 @@ libgdiagnostics.serial = $(LIBGDIAGNOSTICS_FILENAME) # Tell GNU make to ignore these if they exist. .PHONY: libgdiagnostics -ifneq (,$(findstring mingw,$(target))) +ifneq (,$(findstring mingw,$(host))) # Create import library LIBGDIAGNOSTICS_EXTRA_OPTS = -Wl,--out-implib,$(LIBGDIAGNOSTICS_IMPORT_LIB) else @@ -2475,7 +2475,7 @@ $(LIBGDIAGNOSTICS_FILENAME): $(libgdiagnostics_OBJS) $(CPPLIB) $(EXTRA_GCC_LIBS) @$(call LINK_PROGRESS,$(INDEX.libgdiagnostics),end) # Create symlinks when not building for Windows -ifeq (,$(findstring mingw,$(target))) +ifeq (,$(findstring mingw,$(host))) ifeq (,$(findstring darwin,$(host))) # but only one level for Darwin, version info is embedded. @@ -4294,7 +4294,7 @@ libgdiagnostics.install-headers: installdirs $(INSTALL_DATA) $(srcdir)/libgdiagnostics++.h \ $(DESTDIR)$(includedir)/libgdiagnostics++.h -ifneq (,$(findstring mingw,$(target))) +ifneq (,$(findstring mingw,$(host))) libgdiagnostics.install-common: installdirs libgdiagnostics.install-headers # Install import library $(INSTALL_PROGRAM) $(LIBGDIAGNOSTICS_IMPORT_LIB) \
