]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc: libgdiagnostics DLL for mingw should be for mingw hosts
authorJonathan Yong <10walls@gmail.com>
Thu, 26 Feb 2026 11:24:13 +0000 (11:24 +0000)
committerJonathan Yong <10walls@gmail.com>
Tue, 3 Mar 2026 09:19:32 +0000 (09:19 +0000)
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 <10walls@gmail.com>
gcc/Makefile.in

index 4e0f50357f6fb30566d019cb1e1e0a4635280c5b..b97cc7a0d1330e45a2d8ac75ac3dda4da2048af4 100644 (file)
@@ -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) \