From 06e1588e5752bc02b40361ca7146331baa0902f4 Mon Sep 17 00:00:00 2001 From: Marie Ramlow Date: Sun, 21 Sep 2025 10:55:06 +0200 Subject: [PATCH] gcc: drop libstdc++ patch This patch was introduced in 2010 to fix mingw compilers. See c548c084bbc009912673f8020298d698d2792e9d It no longer applies to gcc15 and all of our current gccs (13, 14 and 15) build fine without it. Tested the following cross-compilers: ```shell nix-build --expr 'with (import ./. { }).pkgsCross.mingwW64; hello.override { stdenv = gcc13Stdenv; }' \ --expr 'with (import ./. { }).pkgsCross.mingwW64; hello.override { stdenv = gcc14Stdenv; }' \ --expr 'with (import ./. { }).pkgsCross.mingwW64; hello.override { stdenv = gcc15Stdenv; }' \ --expr 'with (import ./. { }).pkgsCross.mingw32; hello.override { stdenv = gcc13Stdenv; }' \ --expr 'with (import ./. { }).pkgsCross.mingw32; hello.override { stdenv = gcc14Stdenv; }' \ --expr 'with (import ./. { }).pkgsCross.mingw32; hello.override { stdenv = gcc15Stdenv; }' ``` --- .../compilers/gcc/patches/default.nix | 5 +-- .../gcc/patches/libstdc++-target.patch | 32 ------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 pkgs/development/compilers/gcc/patches/libstdc++-target.patch diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index c75a960890f1..eb902364dee6 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -52,10 +52,7 @@ in ## 1. Patches relevant on every platform #################################### -[ ] -# Pass the path to a C++ compiler directly in the Makefile.in -++ optional (!lib.systems.equals targetPlatform hostPlatform) ./libstdc++-target.patch -++ optionals noSysDirs ( +optionals noSysDirs ( [ # Do not try looking for binaries and libraries in /lib and /usr/lib ./gcc-12-no-sys-dirs.patch diff --git a/pkgs/development/compilers/gcc/patches/libstdc++-target.patch b/pkgs/development/compilers/gcc/patches/libstdc++-target.patch deleted file mode 100644 index fb622b395806..000000000000 --- a/pkgs/development/compilers/gcc/patches/libstdc++-target.patch +++ /dev/null @@ -1,32 +0,0 @@ -Patch to make the target libraries 'configure' scripts find the proper CPP. -I noticed that building the mingw32 cross compiler. -Looking at the build script for mingw in archlinux, I think that only nixos -needs this patch. I don't know why. -diff --git a/Makefile.in b/Makefile.in -index 93f66b6..d691917 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ -+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ - CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ -@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \ - RAW_CXX_TARGET_EXPORTS = \ - $(BASE_TARGET_EXPORTS) \ - CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ -- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; -+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \ -+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX; - - NORMAL_TARGET_EXPORTS = \ - $(BASE_TARGET_EXPORTS) \ -- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; -+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \ -+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX; - - # Where to find GMP - HOST_GMPLIBS = @gmplibs@