From 5e3eff9d72548a4990dae6bd3d84fbbdfb06bcc2 Mon Sep 17 00:00:00 2001
From: Andrei Alexeyev <akari@taisei-project.org>
Date: Wed, 2 Oct 2019 00:50:08 +0300
Subject: [PATCH] Remove BasicLinkerIsCompilerMixin from LDC and DMD

These compilers invoke external linkers and have the appropriate .linker
property set. Therefore, BasicLinkerIsCompilerMixin appears to be
misplaced.

It used to work by chance, because BasicLinkerIsCompilerMixin failed to
override the get_allow_undefined_link_args method. The D compilers do
not provide their own get_allow_undefined_link_args, because they expect
to inherit it from Compiler, which simply delegates it to the linker.

Now that BasicLinkerIsCompilerMixin correctly overrides that method with
a stub, it broke compilers that relied on the buggy behavior.
---
 mesonbuild/compilers/d.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index f028bd5a4..8f65af618 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -635,7 +635,7 @@ class GnuDCompiler(DCompiler, GnuCompiler):
         return parameter_list
 
 
-class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler):
+class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, DCompiler):
 
     def __init__(self, exelist, version, for_machine: MachineChoice,
                  info: 'MachineInfo', arch, **kwargs):
@@ -674,7 +674,7 @@ class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompi
         return ldc_optimization_args[optimization_level]
 
 
-class DmdDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler):
+class DmdDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, DCompiler):
 
     def __init__(self, exelist, version, for_machine: MachineChoice,
                  info: 'MachineInfo', arch, **kwargs):