{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

Changed files
+11 -233
doc
languages-frameworks
pkgs
build-support
cc-wrapper
by-name
development
top-level
+1 -1
doc/languages-frameworks/dlang.section.md
···
# D (Dlang) {#dlang}
-
Nixpkgs provides multiple D compilers such as `ldc`, `dmd` and `gdc`.
+
Nixpkgs provides multiple D compilers such as `ldc` and `dmd`.
These can be used like any other package during build time.
However, Nixpkgs provides a build helper for compiling packages using the `dub` package manager.
+3 -15
pkgs/build-support/cc-wrapper/default.nix
···
bintools,
coreutils ? null,
apple-sdk ? null,
-
zlib ? null,
nativeTools,
noLibc ? false,
nativeLibc,
···
ln -sf ${cc} $out/nix-support/gprconfig-gnat-unwrapped
''
-
+ optionalString cc.langD or false ''
-
wrap ${targetPrefix}gdc $wrapper $ccPath/${targetPrefix}gdc
-
''
-
+ optionalString cc.langFortran or false ''
wrap ${targetPrefix}gfortran $wrapper $ccPath/${targetPrefix}gfortran
ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}g77
···
propagatedBuildInputs = [
bintools
]
-
++ extraTools
-
++ optionals cc.langD or false [ zlib ];
+
++ extraTools;
depsTargetTargetPropagated = optional (libcxx != null) libcxx ++ extraPackages;
setupHooks = [
···
+ optionalString (!isArocc) ''
echo "-B${libc_lib}${libc.libdir or "/lib/"}" >> $out/nix-support/libc-crt1-cflags
''
-
+ optionalString (!(cc.langD or false)) ''
+
+ ''
echo "-${
if isArocc then "I" else "idirafter"
} ${libc_dev}${libc.incdir or "/include"}" >> $out/nix-support/libc-cflags
''
-
+ optionalString (isGNU && (!(cc.langD or false))) ''
+
+ optionalString isGNU ''
for dir in "${cc}"/lib/gcc/*/*/include-fixed; do
echo '-idirafter' ''${dir} >> $out/nix-support/libc-cflags
done
···
ln -s ${cc.man} $man
ln -s ${cc.info} $info
''
-
+ optionalString (cc.langD or false && !isArocc) ''
-
echo "-B${zlib}${zlib.libdir or "/lib/"}" >> $out/nix-support/libc-cflags
-
''
##
## Hardening support
···
''
+ optionalString cc.langAda or false ''
hardening_unsupported_flags+=" format stackprotector strictoverflow"
-
''
-
+ optionalString cc.langD or false ''
-
hardening_unsupported_flags+=" format"
''
+ optionalString cc.langFortran or false ''
hardening_unsupported_flags+=" format"
-11
pkgs/by-name/gd/gdmd/0001-gdc-store-path.diff
···
-
--- a/dmd-script
-
+++ b/dmd-script
-
@@ -72,7 +72,7 @@ my @run_args;
-
# for the target prefix.
-
basename($0) =~ m/^(.*-)?g?dmd(-.*)?$/;
-
my $target_prefix = $1?$1:"";
-
-my $gdc_dir = abs_path(dirname($0));
-
+my $gdc_dir = "@gdc_dir@";
-
my $gdc = File::Spec->catfile( $gdc_dir, $target_prefix . "gdc" . ($2?$2:""));
-
-
sub osHasEXE() {
-48
pkgs/by-name/gd/gdmd/package.nix
···
-
{
-
lib,
-
stdenvNoCC,
-
fetchFromGitHub,
-
replaceVars,
-
gdc,
-
perl,
-
}:
-
stdenvNoCC.mkDerivation {
-
pname = "gdmd";
-
version = "0.1.0-unstable-2024-05-30";
-
-
src = fetchFromGitHub {
-
owner = "D-Programming-GDC";
-
repo = "gdmd";
-
rev = "dc0ad9f739795f3ce5c69825efcd5d1d586bb013";
-
hash = "sha256-Sw8ExEPDvGqGKcM9VKnOI6MGgXW0tAu51A90Wi4qrRE=";
-
};
-
-
patches = [
-
(replaceVars ./0001-gdc-store-path.diff {
-
gdc_dir = "${gdc}/bin";
-
})
-
];
-
-
buildInputs = [
-
gdc
-
perl
-
];
-
-
installFlags = [
-
"DESTDIR=$(out)"
-
"prefix="
-
];
-
-
preInstall = ''
-
install -d $out/bin $out/share/man/man1
-
'';
-
-
meta = {
-
description = "Wrapper for GDC that emulates DMD's command line";
-
homepage = "https://gdcproject.org";
-
license = lib.licenses.gpl3Plus;
-
platforms = lib.platforms.all;
-
maintainers = with lib.maintainers; [ jtbx ];
-
mainProgram = "gdmd";
-
};
-
}
+1 -1
pkgs/by-name/ru/rund/package.nix
···
buildInputs = [ dcompiler ];
buildPhase = ''
-
for candidate in dmd ldmd2 gdmd; do
+
for candidate in dmd ldmd2; do
echo Checking for DCompiler $candidate ...
dc=$(type -P $candidate || echo "")
if [ ! "$dc" == "" ]; then
-5
pkgs/development/compilers/gcc/common/configure-flags.nix
···
langC,
langCC,
-
langD ? false,
langFortran,
langAda ? false,
langGo,
···
lib.concatStringsSep "," (
lib.optional langC "c"
++ lib.optional langCC "c++"
-
++ lib.optional langD "d"
++ lib.optional langFortran "fortran"
++ lib.optional langAda "ada"
++ lib.optional langGo "go"
···
]
++ lib.optionals langJit [
"--enable-host-shared"
-
]
-
++ lib.optionals (langD) [
-
"--with-target-system-zlib=yes"
]
# On mips64-unknown-linux-gnu libsanitizer defines collide with
# glibc's definitions and fail the build. It was fixed in gcc-13+.
+3 -5
pkgs/development/compilers/gcc/common/extra-target-flags.nix
···
lib,
stdenv,
withoutTargetLibc,
-
langD ? false,
libcCross,
threadsCross,
}:
···
EXTRA_FLAGS_FOR_TARGET =
let
mkFlags =
-
dep: langD:
-
lib.optionals ((!lib.systems.equals targetPlatform hostPlatform) && dep != null && !langD) (
+
dep:
+
lib.optionals ((!lib.systems.equals targetPlatform hostPlatform) && dep != null) (
[
"-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
]
···
]
);
in
-
mkFlags libcCross langD
-
++ lib.optionals (!withoutTargetLibc) (mkFlags (threadsCross.package or null) langD);
+
mkFlags libcCross ++ lib.optionals (!withoutTargetLibc) (mkFlags (threadsCross.package or null));
EXTRA_LDFLAGS_FOR_TARGET =
let
-7
pkgs/development/compilers/gcc/default.nix
···
langAda ? false,
langObjC ? stdenv.targetPlatform.isDarwin,
langObjCpp ? stdenv.targetPlatform.isDarwin,
-
langD ? false,
langGo ? false,
reproducibleBuild ? true,
profiledCompiler ? false,
···
langAda
langC
langCC
-
langD
langFortran
langGo
langJit
···
# The go frontend is written in c++
assert langGo -> langCC;
assert langAda -> gnat-bootstrap != null;
-
-
# TODO: fixup D bootstrapping, probably by using gdc11 (and maybe other changes).
-
# error: GDC is required to build d
-
assert atLeast12 -> !langD;
# threadsCross is just for MinGW
assert threadsCross != { } -> stdenv.targetPlatform.isWindows;
···
langAda
langFortran
langGo
-
langD
version
;
isGNU = true;
-2
pkgs/development/compilers/gcc/ng/common/gcc/default.nix
···
langAda ? false,
langC ? true,
langCC ? true,
-
langD ? false,
langFortran ? false,
langGo ? false,
langJava ? false,
···
lib.intersperse "," (
lib.optional langC "c"
++ lib.optional langCC "c++"
-
++ lib.optional langD "d"
++ lib.optional langFortran "fortran"
++ lib.optional langJava "java"
++ lib.optional langAda "ada"
-6
pkgs/development/compilers/gcc/patches/default.nix
···
langAda,
langObjC,
langObjCpp,
-
langD,
langFortran,
langGo,
reproducibleBuild,
···
# Do not pass a default include dir on PowerPC+Musl
# See https://github.com/NixOS/nixpkgs/pull/45340/commits/d6bb7d45162ac93e017cc9b665ae4836f6410710
++ [ ./ppc-musl.patch ]
-
# Patches for libphobos, the standard library of the D language
-
# - Forces libphobos to be built with -j1, as libtool misbehaves in parallel
-
# - Gets rid of -idirafter flags added by our gcc wrappers, as gdc does not understand them
-
# See https://github.com/NixOS/nixpkgs/pull/69144#issuecomment-535176453
-
++ optional langD ./libphobos.patch
# Moves the .cfi_starproc instruction to after the function label
# Needed to build llvm-18 and later
# See https://github.com/NixOS/nixpkgs/pull/354107/commits/2de1b4b14e17f42ba8b4bf43a29347c91511e008
-119
pkgs/development/compilers/gcc/patches/libphobos.patch
···
-
diff --git a/Makefile.in b/Makefile.in
-
index a375471..83c5ecb 100644
-
--- a/Makefile.in
-
+++ b/Makefile.in
-
@@ -804,7 +804,7 @@ BASE_FLAGS_TO_PASS = \
-
"STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \
-
"GNATBIND=$(GNATBIND)" \
-
"GNATMAKE=$(GNATMAKE)" \
-
- "GDC=$(GDC)" \
-
+ "`echo 'GDC=$(GDC)' | sed -e 's/-idirafter [^ ]*//g'`" \
-
"GDCFLAGS=$(GDCFLAGS)" \
-
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
-
"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
-
@@ -817,7 +817,7 @@ BASE_FLAGS_TO_PASS = \
-
"GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \
-
"GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \
-
"GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \
-
- "GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
-
+ "`echo 'GDC_FOR_TARGET=$(GDC_FOR_TARGET)' | sed -e 's/-idirafter [^ ]*//g'`" \
-
"GDCFLAGS_FOR_TARGET=$(GDCFLAGS_FOR_TARGET)" \
-
"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
-
"LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \
-
@@ -890,7 +890,7 @@ EXTRA_HOST_FLAGS = \
-
'DLLTOOL=$(DLLTOOL)' \
-
'GFORTRAN=$(GFORTRAN)' \
-
'GOC=$(GOC)' \
-
- 'GDC=$(GDC)' \
-
+ "`echo 'GDC=$(GDC)' | sed -e 's/-idirafter [^ ]*//g'`" \
-
'LD=$(LD)' \
-
'LIPO=$(LIPO)' \
-
'NM=$(NM)' \
-
@@ -966,8 +966,11 @@ EXTRA_TARGET_FLAGS = \
-
'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
-
'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
-
"TFLAGS=$$TFLAGS"
-
+EXTRA_TARGET_FLAGS_D = \
-
+ "`echo $(EXTRA_TARGET_FLAGS) | sed -e 's/-idirafter [^ ]*//g'`"
-
-
TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
-
+TARGET_FLAGS_TO_PASS_D = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS_D)
-
-
# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
-
# unfortunately needs the native compiler and the target ar and
-
@@ -47285,7 +47288,7 @@ check-target-libphobos:
-
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-
$(NORMAL_TARGET_EXPORTS) \
-
(cd $(TARGET_SUBDIR)/libphobos && \
-
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
-
+ $(MAKE) $(TARGET_FLAGS_TO_PASS_D) check)
-
-
@endif target-libphobos
-
-
@@ -47300,7 +47303,7 @@ install-target-libphobos: installdirs
-
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-
$(NORMAL_TARGET_EXPORTS) \
-
(cd $(TARGET_SUBDIR)/libphobos && \
-
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
-
+ $(MAKE) $(TARGET_FLAGS_TO_PASS_D) install)
-
-
@endif target-libphobos
-
-
@@ -47315,7 +47318,7 @@ install-strip-target-libphobos: installdirs
-
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-
$(NORMAL_TARGET_EXPORTS) \
-
(cd $(TARGET_SUBDIR)/libphobos && \
-
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip)
-
+ $(MAKE) $(TARGET_FLAGS_TO_PASS_D) install-strip)
-
-
@endif target-libphobos
-
-
diff --git a/Makefile.tpl b/Makefile.tpl
-
index 41cae58..b3d32e7 100644
-
--- a/Makefile.tpl
-
+++ b/Makefile.tpl
-
@@ -721,8 +721,11 @@ EXTRA_TARGET_FLAGS = \
-
'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
-
'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
-
"TFLAGS=$$TFLAGS"
-
+EXTRA_TARGET_FLAGS_D = \
-
+ "`echo $(EXTRA_TARGET_FLAGS) | sed -e 's/-idirafter [^ ]*//g'`"
-
-
TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
-
+TARGET_FLAGS_TO_PASS_D = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS_D)
-
-
# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
-
# unfortunately needs the native compiler and the target ar and
-
diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in
-
index e894417..2d18dcb 100644
-
--- a/libphobos/Makefile.in
-
+++ b/libphobos/Makefile.in
-
@@ -365,6 +365,7 @@ AM_MAKEFLAGS = \
-
"LIBCFLAGS=$(LIBCFLAGS)" \
-
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
-
"MAKE=$(MAKE)" \
-
+ "`echo 'MAKEFLAGS=$(MAKEFLAGS)' | sed -e 's/-j[0-9]+/-j1/'`" \
-
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
-
"PICFLAG=$(PICFLAG)" \
-
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
-
@@ -694,6 +695,8 @@ uninstall-am:
-
-
.PRECIOUS: Makefile
-
-
+.NOTPARALLEL:
-
+
-
# GNU Make needs to see an explicit $(MAKE) variable in the command it
-
# runs to enable its job server during parallel builds. Hence the
-
# comments below.
-
diff --git a/libphobos/configure b/libphobos/configure
-
index b3cb5f3..25adf2b 100755
-
--- a/libphobos/configure
-
+++ b/libphobos/configure
-
@@ -5122,6 +5122,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
+GDC=`$as_echo "$GDC" | sed -e 's/-idirafter [^ ]*//g'`
-
-
ac_ext=d
-
ac_compile='$GDC -c $GDCFLAGS conftest.$ac_ext >&5'
+3
pkgs/top-level/aliases.nix
···
gcj = gcj6; # Added 2024-09-13
gcj6 = throw "gcj6 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13
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
+
gdc = throw "gdc has been removed from Nixpkgs, as recent versions require complex bootstrapping"; # Added 2025-08-08
+
gdc11 = throw "gdc11 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
+
gdmd = throw "gdmd has been removed from Nixpkgs, as it depends on GDC which was removed"; # Added 2025-08-08
gdome2 = throw "'gdome2' has been removed from nixpkgs, as it is umaintained and obsolete"; # Added 2024-12-29
geocode-glib = throw "throw 'geocode-glib' has been removed, as it was unused and used outdated libraries"; # Added 2025-04-16
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
···
gcc-arm-embedded = gcc-arm-embedded-14;
-
# It would be better to match the default gcc so that there are no linking errors
-
# when using C/C++ libraries in D packages, but right now versions >= 12 are broken.
-
gdc = gdc11;
-
gdc11 = wrapCC (
-
gcc11.cc.override {
-
name = "gdc";
-
langCC = false;
-
langC = false;
-
langD = true;
-
profiledCompiler = false;
-
}
-
);
-
# Haskell and GHC
haskell = callPackage ./haskell-packages.nix { };