{gdc,gdmd}: drop

GDC 11 was the last version that could bootstrap without a D compiler,
and GDC don’t offer their own binaries any more. GCC 11 is now
end‐of‐life and being removed (as is GCC 12, even).

It’s possible that we could use another distribution’s binary
packages to bootstrap this, or go via our DMD package (it’s
apparently not possible to bootstrap GDC with LDC, but I’m not sure
about DMD), but as nobody has worked on it in the three years since
GCC 12 came out, it seems like interest is limited, and it’s more
of a yak shave than I’m up for right now.

A full from‐source bootstrap chain would of course be nice, but is
more the realm of the minimal bootstrap work than something we’d
want to keep GCC 11 around in the main package set indefinitely for.

Emily b5a4a0a6 53767843

+11 -233
+1 -1
doc/languages-frameworks/dlang.section.md
··· 1 1 # D (Dlang) {#dlang} 2 2 3 - Nixpkgs provides multiple D compilers such as `ldc`, `dmd` and `gdc`. 3 + Nixpkgs provides multiple D compilers such as `ldc` and `dmd`. 4 4 These can be used like any other package during build time. 5 5 6 6 However, Nixpkgs provides a build helper for compiling packages using the `dub` package manager.
+3 -15
pkgs/build-support/cc-wrapper/default.nix
··· 15 15 bintools, 16 16 coreutils ? null, 17 17 apple-sdk ? null, 18 - zlib ? null, 19 18 nativeTools, 20 19 noLibc ? false, 21 20 nativeLibc, ··· 534 533 ln -sf ${cc} $out/nix-support/gprconfig-gnat-unwrapped 535 534 '' 536 535 537 - + optionalString cc.langD or false '' 538 - wrap ${targetPrefix}gdc $wrapper $ccPath/${targetPrefix}gdc 539 - '' 540 - 541 536 + optionalString cc.langFortran or false '' 542 537 wrap ${targetPrefix}gfortran $wrapper $ccPath/${targetPrefix}gfortran 543 538 ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}g77 ··· 554 549 propagatedBuildInputs = [ 555 550 bintools 556 551 ] 557 - ++ extraTools 558 - ++ optionals cc.langD or false [ zlib ]; 552 + ++ extraTools; 559 553 depsTargetTargetPropagated = optional (libcxx != null) libcxx ++ extraPackages; 560 554 561 555 setupHooks = [ ··· 668 662 + optionalString (!isArocc) '' 669 663 echo "-B${libc_lib}${libc.libdir or "/lib/"}" >> $out/nix-support/libc-crt1-cflags 670 664 '' 671 - + optionalString (!(cc.langD or false)) '' 665 + + '' 672 666 echo "-${ 673 667 if isArocc then "I" else "idirafter" 674 668 } ${libc_dev}${libc.incdir or "/include"}" >> $out/nix-support/libc-cflags 675 669 '' 676 - + optionalString (isGNU && (!(cc.langD or false))) '' 670 + + optionalString isGNU '' 677 671 for dir in "${cc}"/lib/gcc/*/*/include-fixed; do 678 672 echo '-idirafter' ''${dir} >> $out/nix-support/libc-cflags 679 673 done ··· 792 786 ln -s ${cc.man} $man 793 787 ln -s ${cc.info} $info 794 788 '' 795 - + optionalString (cc.langD or false && !isArocc) '' 796 - echo "-B${zlib}${zlib.libdir or "/lib/"}" >> $out/nix-support/libc-cflags 797 - '' 798 789 799 790 ## 800 791 ## Hardening support ··· 852 843 '' 853 844 + optionalString cc.langAda or false '' 854 845 hardening_unsupported_flags+=" format stackprotector strictoverflow" 855 - '' 856 - + optionalString cc.langD or false '' 857 - hardening_unsupported_flags+=" format" 858 846 '' 859 847 + optionalString cc.langFortran or false '' 860 848 hardening_unsupported_flags+=" format"
-11
pkgs/by-name/gd/gdmd/0001-gdc-store-path.diff
··· 1 - --- a/dmd-script 2 - +++ b/dmd-script 3 - @@ -72,7 +72,7 @@ my @run_args; 4 - # for the target prefix. 5 - basename($0) =~ m/^(.*-)?g?dmd(-.*)?$/; 6 - my $target_prefix = $1?$1:""; 7 - -my $gdc_dir = abs_path(dirname($0)); 8 - +my $gdc_dir = "@gdc_dir@"; 9 - my $gdc = File::Spec->catfile( $gdc_dir, $target_prefix . "gdc" . ($2?$2:"")); 10 - 11 - sub osHasEXE() {
-48
pkgs/by-name/gd/gdmd/package.nix
··· 1 - { 2 - lib, 3 - stdenvNoCC, 4 - fetchFromGitHub, 5 - replaceVars, 6 - gdc, 7 - perl, 8 - }: 9 - stdenvNoCC.mkDerivation { 10 - pname = "gdmd"; 11 - version = "0.1.0-unstable-2024-05-30"; 12 - 13 - src = fetchFromGitHub { 14 - owner = "D-Programming-GDC"; 15 - repo = "gdmd"; 16 - rev = "dc0ad9f739795f3ce5c69825efcd5d1d586bb013"; 17 - hash = "sha256-Sw8ExEPDvGqGKcM9VKnOI6MGgXW0tAu51A90Wi4qrRE="; 18 - }; 19 - 20 - patches = [ 21 - (replaceVars ./0001-gdc-store-path.diff { 22 - gdc_dir = "${gdc}/bin"; 23 - }) 24 - ]; 25 - 26 - buildInputs = [ 27 - gdc 28 - perl 29 - ]; 30 - 31 - installFlags = [ 32 - "DESTDIR=$(out)" 33 - "prefix=" 34 - ]; 35 - 36 - preInstall = '' 37 - install -d $out/bin $out/share/man/man1 38 - ''; 39 - 40 - meta = { 41 - description = "Wrapper for GDC that emulates DMD's command line"; 42 - homepage = "https://gdcproject.org"; 43 - license = lib.licenses.gpl3Plus; 44 - platforms = lib.platforms.all; 45 - maintainers = with lib.maintainers; [ jtbx ]; 46 - mainProgram = "gdmd"; 47 - }; 48 - }
+1 -1
pkgs/by-name/ru/rund/package.nix
··· 21 21 22 22 buildInputs = [ dcompiler ]; 23 23 buildPhase = '' 24 - for candidate in dmd ldmd2 gdmd; do 24 + for candidate in dmd ldmd2; do 25 25 echo Checking for DCompiler $candidate ... 26 26 dc=$(type -P $candidate || echo "") 27 27 if [ ! "$dc" == "" ]; then
-5
pkgs/development/compilers/gcc/common/configure-flags.nix
··· 23 23 24 24 langC, 25 25 langCC, 26 - langD ? false, 27 26 langFortran, 28 27 langAda ? false, 29 28 langGo, ··· 207 206 lib.concatStringsSep "," ( 208 207 lib.optional langC "c" 209 208 ++ lib.optional langCC "c++" 210 - ++ lib.optional langD "d" 211 209 ++ lib.optional langFortran "fortran" 212 210 ++ lib.optional langAda "ada" 213 211 ++ lib.optional langGo "go" ··· 286 284 ] 287 285 ++ lib.optionals langJit [ 288 286 "--enable-host-shared" 289 - ] 290 - ++ lib.optionals (langD) [ 291 - "--with-target-system-zlib=yes" 292 287 ] 293 288 # On mips64-unknown-linux-gnu libsanitizer defines collide with 294 289 # glibc's definitions and fail the build. It was fixed in gcc-13+.
+3 -5
pkgs/development/compilers/gcc/common/extra-target-flags.nix
··· 2 2 lib, 3 3 stdenv, 4 4 withoutTargetLibc, 5 - langD ? false, 6 5 libcCross, 7 6 threadsCross, 8 7 }: ··· 18 17 EXTRA_FLAGS_FOR_TARGET = 19 18 let 20 19 mkFlags = 21 - dep: langD: 22 - lib.optionals ((!lib.systems.equals targetPlatform hostPlatform) && dep != null && !langD) ( 20 + dep: 21 + lib.optionals ((!lib.systems.equals targetPlatform hostPlatform) && dep != null) ( 23 22 [ 24 23 "-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}" 25 24 ] ··· 28 27 ] 29 28 ); 30 29 in 31 - mkFlags libcCross langD 32 - ++ lib.optionals (!withoutTargetLibc) (mkFlags (threadsCross.package or null) langD); 30 + mkFlags libcCross ++ lib.optionals (!withoutTargetLibc) (mkFlags (threadsCross.package or null)); 33 31 34 32 EXTRA_LDFLAGS_FOR_TARGET = 35 33 let
-7
pkgs/development/compilers/gcc/default.nix
··· 11 11 langAda ? false, 12 12 langObjC ? stdenv.targetPlatform.isDarwin, 13 13 langObjCpp ? stdenv.targetPlatform.isDarwin, 14 - langD ? false, 15 14 langGo ? false, 16 15 reproducibleBuild ? true, 17 16 profiledCompiler ? false, ··· 154 153 langAda 155 154 langC 156 155 langCC 157 - langD 158 156 langFortran 159 157 langGo 160 158 langJit ··· 194 192 # The go frontend is written in c++ 195 193 assert langGo -> langCC; 196 194 assert langAda -> gnat-bootstrap != null; 197 - 198 - # TODO: fixup D bootstrapping, probably by using gdc11 (and maybe other changes). 199 - # error: GDC is required to build d 200 - assert atLeast12 -> !langD; 201 195 202 196 # threadsCross is just for MinGW 203 197 assert threadsCross != { } -> stdenv.targetPlatform.isWindows; ··· 409 403 langAda 410 404 langFortran 411 405 langGo 412 - langD 413 406 version 414 407 ; 415 408 isGNU = true;
-2
pkgs/development/compilers/gcc/ng/common/gcc/default.nix
··· 8 8 langAda ? false, 9 9 langC ? true, 10 10 langCC ? true, 11 - langD ? false, 12 11 langFortran ? false, 13 12 langGo ? false, 14 13 langJava ? false, ··· 176 175 lib.intersperse "," ( 177 176 lib.optional langC "c" 178 177 ++ lib.optional langCC "c++" 179 - ++ lib.optional langD "d" 180 178 ++ lib.optional langFortran "fortran" 181 179 ++ lib.optional langJava "java" 182 180 ++ lib.optional langAda "ada"
-6
pkgs/development/compilers/gcc/patches/default.nix
··· 5 5 langAda, 6 6 langObjC, 7 7 langObjCpp, 8 - langD, 9 8 langFortran, 10 9 langGo, 11 10 reproducibleBuild, ··· 109 108 # Do not pass a default include dir on PowerPC+Musl 110 109 # See https://github.com/NixOS/nixpkgs/pull/45340/commits/d6bb7d45162ac93e017cc9b665ae4836f6410710 111 110 ++ [ ./ppc-musl.patch ] 112 - # Patches for libphobos, the standard library of the D language 113 - # - Forces libphobos to be built with -j1, as libtool misbehaves in parallel 114 - # - Gets rid of -idirafter flags added by our gcc wrappers, as gdc does not understand them 115 - # See https://github.com/NixOS/nixpkgs/pull/69144#issuecomment-535176453 116 - ++ optional langD ./libphobos.patch 117 111 # Moves the .cfi_starproc instruction to after the function label 118 112 # Needed to build llvm-18 and later 119 113 # See https://github.com/NixOS/nixpkgs/pull/354107/commits/2de1b4b14e17f42ba8b4bf43a29347c91511e008
-119
pkgs/development/compilers/gcc/patches/libphobos.patch
··· 1 - diff --git a/Makefile.in b/Makefile.in 2 - index a375471..83c5ecb 100644 3 - --- a/Makefile.in 4 - +++ b/Makefile.in 5 - @@ -804,7 +804,7 @@ BASE_FLAGS_TO_PASS = \ 6 - "STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \ 7 - "GNATBIND=$(GNATBIND)" \ 8 - "GNATMAKE=$(GNATMAKE)" \ 9 - - "GDC=$(GDC)" \ 10 - + "`echo 'GDC=$(GDC)' | sed -e 's/-idirafter [^ ]*//g'`" \ 11 - "GDCFLAGS=$(GDCFLAGS)" \ 12 - "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ 13 - "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ 14 - @@ -817,7 +817,7 @@ BASE_FLAGS_TO_PASS = \ 15 - "GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \ 16 - "GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \ 17 - "GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \ 18 - - "GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \ 19 - + "`echo 'GDC_FOR_TARGET=$(GDC_FOR_TARGET)' | sed -e 's/-idirafter [^ ]*//g'`" \ 20 - "GDCFLAGS_FOR_TARGET=$(GDCFLAGS_FOR_TARGET)" \ 21 - "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ 22 - "LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \ 23 - @@ -890,7 +890,7 @@ EXTRA_HOST_FLAGS = \ 24 - 'DLLTOOL=$(DLLTOOL)' \ 25 - 'GFORTRAN=$(GFORTRAN)' \ 26 - 'GOC=$(GOC)' \ 27 - - 'GDC=$(GDC)' \ 28 - + "`echo 'GDC=$(GDC)' | sed -e 's/-idirafter [^ ]*//g'`" \ 29 - 'LD=$(LD)' \ 30 - 'LIPO=$(LIPO)' \ 31 - 'NM=$(NM)' \ 32 - @@ -966,8 +966,11 @@ EXTRA_TARGET_FLAGS = \ 33 - 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \ 34 - 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \ 35 - "TFLAGS=$$TFLAGS" 36 - +EXTRA_TARGET_FLAGS_D = \ 37 - + "`echo $(EXTRA_TARGET_FLAGS) | sed -e 's/-idirafter [^ ]*//g'`" 38 - 39 - TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 40 - +TARGET_FLAGS_TO_PASS_D = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS_D) 41 - 42 - # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it 43 - # unfortunately needs the native compiler and the target ar and 44 - @@ -47285,7 +47288,7 @@ check-target-libphobos: 45 - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ 46 - $(NORMAL_TARGET_EXPORTS) \ 47 - (cd $(TARGET_SUBDIR)/libphobos && \ 48 - - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) 49 - + $(MAKE) $(TARGET_FLAGS_TO_PASS_D) check) 50 - 51 - @endif target-libphobos 52 - 53 - @@ -47300,7 +47303,7 @@ install-target-libphobos: installdirs 54 - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ 55 - $(NORMAL_TARGET_EXPORTS) \ 56 - (cd $(TARGET_SUBDIR)/libphobos && \ 57 - - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) 58 - + $(MAKE) $(TARGET_FLAGS_TO_PASS_D) install) 59 - 60 - @endif target-libphobos 61 - 62 - @@ -47315,7 +47318,7 @@ install-strip-target-libphobos: installdirs 63 - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ 64 - $(NORMAL_TARGET_EXPORTS) \ 65 - (cd $(TARGET_SUBDIR)/libphobos && \ 66 - - $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) 67 - + $(MAKE) $(TARGET_FLAGS_TO_PASS_D) install-strip) 68 - 69 - @endif target-libphobos 70 - 71 - diff --git a/Makefile.tpl b/Makefile.tpl 72 - index 41cae58..b3d32e7 100644 73 - --- a/Makefile.tpl 74 - +++ b/Makefile.tpl 75 - @@ -721,8 +721,11 @@ EXTRA_TARGET_FLAGS = \ 76 - 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \ 77 - 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \ 78 - "TFLAGS=$$TFLAGS" 79 - +EXTRA_TARGET_FLAGS_D = \ 80 - + "`echo $(EXTRA_TARGET_FLAGS) | sed -e 's/-idirafter [^ ]*//g'`" 81 - 82 - TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 83 - +TARGET_FLAGS_TO_PASS_D = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS_D) 84 - 85 - # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it 86 - # unfortunately needs the native compiler and the target ar and 87 - diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in 88 - index e894417..2d18dcb 100644 89 - --- a/libphobos/Makefile.in 90 - +++ b/libphobos/Makefile.in 91 - @@ -365,6 +365,7 @@ AM_MAKEFLAGS = \ 92 - "LIBCFLAGS=$(LIBCFLAGS)" \ 93 - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ 94 - "MAKE=$(MAKE)" \ 95 - + "`echo 'MAKEFLAGS=$(MAKEFLAGS)' | sed -e 's/-j[0-9]+/-j1/'`" \ 96 - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ 97 - "PICFLAG=$(PICFLAG)" \ 98 - "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ 99 - @@ -694,6 +695,8 @@ uninstall-am: 100 - 101 - .PRECIOUS: Makefile 102 - 103 - +.NOTPARALLEL: 104 - + 105 - # GNU Make needs to see an explicit $(MAKE) variable in the command it 106 - # runs to enable its job server during parallel builds. Hence the 107 - # comments below. 108 - diff --git a/libphobos/configure b/libphobos/configure 109 - index b3cb5f3..25adf2b 100755 110 - --- a/libphobos/configure 111 - +++ b/libphobos/configure 112 - @@ -5122,6 +5122,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 113 - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 114 - ac_compiler_gnu=$ac_cv_c_compiler_gnu 115 - 116 - +GDC=`$as_echo "$GDC" | sed -e 's/-idirafter [^ ]*//g'` 117 - 118 - ac_ext=d 119 - ac_compile='$GDC -c $GDCFLAGS conftest.$ac_ext >&5'
+3
pkgs/top-level/aliases.nix
··· 963 963 gcj = gcj6; # Added 2024-09-13 964 964 gcj6 = throw "gcj6 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13 965 965 gcolor2 = throw "'gcolor2' has been removed due to lack of maintenance upstream and depending on gtk2. Consider using 'gcolor3' or 'eyedropper' instead"; # Added 2024-09-15 966 + gdc = throw "gdc has been removed from Nixpkgs, as recent versions require complex bootstrapping"; # Added 2025-08-08 967 + gdc11 = throw "gdc11 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08 968 + gdmd = throw "gdmd has been removed from Nixpkgs, as it depends on GDC which was removed"; # Added 2025-08-08 966 969 gdome2 = throw "'gdome2' has been removed from nixpkgs, as it is umaintained and obsolete"; # Added 2024-12-29 967 970 geocode-glib = throw "throw 'geocode-glib' has been removed, as it was unused and used outdated libraries"; # Added 2025-04-16 968 971 geos_3_11 = throw "geos_3_11 has been removed from nixpgks. Please use a more recent 'geos' instead.";
-13
pkgs/top-level/all-packages.nix
··· 5251 5251 5252 5252 gcc-arm-embedded = gcc-arm-embedded-14; 5253 5253 5254 - # It would be better to match the default gcc so that there are no linking errors 5255 - # when using C/C++ libraries in D packages, but right now versions >= 12 are broken. 5256 - gdc = gdc11; 5257 - gdc11 = wrapCC ( 5258 - gcc11.cc.override { 5259 - name = "gdc"; 5260 - langCC = false; 5261 - langC = false; 5262 - langD = true; 5263 - profiledCompiler = false; 5264 - } 5265 - ); 5266 - 5267 5254 # Haskell and GHC 5268 5255 5269 5256 haskell = callPackage ./haskell-packages.nix { };