aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-12-16 10:41:13 -0800
committerDylan Baker <dylan@pnwbakers.com>2020-03-06 12:11:26 -0800
commitc0fd20f164609b8c3be516b5be3d70a4b9ff6f49 (patch)
tree53ca0f6439be8f4f96486bc9118a49f7a1a37087 /mesonbuild
parent6ac40539a3fca9de099d4d2dd348423ec045ff65 (diff)
downloadmeson-c0fd20f164609b8c3be516b5be3d70a4b9ff6f49.zip
meson-c0fd20f164609b8c3be516b5be3d70a4b9ff6f49.tar.gz
meson-c0fd20f164609b8c3be516b5be3d70a4b9ff6f49.tar.bz2
compilers/d: Remove CompilerIsLInkerMixin
This was never really true of the D compilers, it made them more complicated than necessary and was incorrect in many cases. Removing it causes no regressions on Linux, at least in our rather limited test cases).
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/d.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index b974504..99889b0 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -28,7 +28,6 @@ from .compilers import (
CompilerArgs,
)
from .mixins.gnu import GnuCompiler
-from .mixins.islinker import LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin
if T.TYPE_CHECKING:
from ..envconfig import MachineInfo
@@ -69,7 +68,7 @@ dmd_optimization_args = {'0': [],
class DmdLikeCompilerMixin:
- LINKER_PREFIX = '-L'
+ LINKER_PREFIX = '-L='
def get_output_args(self, target):
return ['-of=' + target]
@@ -214,7 +213,7 @@ class DmdLikeCompilerMixin:
return []
def gen_import_library_args(self, implibname):
- return ['-Wl,--out-implib=' + implibname]
+ return self.linker.import_library_args(implibname)
def build_rpath_args(self, env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
if self.info.is_windows():
@@ -392,16 +391,10 @@ class DmdLikeCompilerMixin:
# LDC and DMD actually do use a linker, but they proxy all of that with
# their own arguments
soargs = []
- for arg in Compiler.get_soname_args(self, *args, **kwargs):
+ for arg in super().get_soname_args(*args, **kwargs):
soargs.append('-L=' + arg)
return soargs
- def get_allow_undefined_link_args(self) -> T.List[str]:
- args = []
- for arg in self.linker.get_allow_undefined_args():
- args.append('-L=' + arg)
- return args
-
class DCompiler(Compiler):
mscrt_args = {
@@ -600,7 +593,7 @@ class DCompiler(Compiler):
return []
def thread_link_flags(self, env):
- return ['-pthread']
+ return self.linker.thread_flags(env)
def name_string(self):
return ' '.join(self.exelist)
@@ -658,7 +651,7 @@ class GnuDCompiler(DCompiler, GnuCompiler):
return self.linker.get_allow_undefined_args()
-class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler):
+class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
def __init__(self, exelist, version, for_machine: MachineChoice,
info: 'MachineInfo', arch, **kwargs):
@@ -687,9 +680,6 @@ class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompi
def get_pic_args(self):
return ['-relocation-model=pic']
- def get_std_shared_lib_link_args(self):
- return ['-shared']
-
def get_crt_link_args(self, crt_val, buildtype):
return self.get_crt_args(crt_val, buildtype)
@@ -700,7 +690,7 @@ class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompi
return ldc_optimization_args[optimization_level]
-class DmdDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler):
+class DmdDCompiler(DmdLikeCompilerMixin, DCompiler):
def __init__(self, exelist, version, for_machine: MachineChoice,
info: 'MachineInfo', arch, **kwargs):