aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoaLitiuM <goalitium@kapsi.fi>2018-09-06 03:57:45 +0300
committerGoaLitiuM <goalitium@kapsi.fi>2018-09-06 03:57:45 +0300
commit6e160995b0e9b1125abc211e17844752f47b650d (patch)
treecb3a03eb9852c672cd661b5c990cd7307e4dbed1
parent289c1bf91992c167e8ec4292f2584a4add7f5485 (diff)
downloadmeson-6e160995b0e9b1125abc211e17844752f47b650d.zip
meson-6e160995b0e9b1125abc211e17844752f47b650d.tar.gz
meson-6e160995b0e9b1125abc211e17844752f47b650d.tar.bz2
Improve D link argument handling
-rw-r--r--mesonbuild/backend/backends.py10
-rw-r--r--mesonbuild/compilers/d.py7
2 files changed, 8 insertions, 9 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index bdc3fad..5232b65 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -591,12 +591,12 @@ class Backend:
for d in deps:
if not (d.is_linkable_target()):
raise RuntimeError('Tried to link with a non-library target "%s".' % d.get_basename())
- d_arg = self.get_target_filename_for_linking(d)
- if not d_arg:
+ arg = self.get_target_filename_for_linking(d)
+ if not arg:
continue
- if isinstance(compiler, (compilers.LLVMDCompiler, compilers.DmdDCompiler)):
- d_arg = '-L' + d_arg
- args.append(d_arg)
+ if compiler.get_language() == 'd':
+ arg = '-Wl,' + arg
+ args.append(arg)
return args
def get_mingw_extra_paths(self, target):
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 5beacbd..9ad0599 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -122,9 +122,8 @@ class DCompiler(Compiler):
def get_linker_search_args(self, dirname):
# -L is recognized as "add this to the search path" by the linker,
- # while the compiler recognizes it as "pass to linker". So, the first
- # -L is for the compiler, telling it to pass the second -L to the linker.
- return ['-L=-L' + dirname]
+ # while the compiler recognizes it as "pass to linker".
+ return ['-Wl,-L' + dirname]
def get_coverage_args(self):
return ['-cov']
@@ -231,7 +230,7 @@ class DCompiler(Compiler):
paths = padding
else:
paths = paths + ':' + padding
- return ['-L=-rpath={}'.format(paths)]
+ return ['-Wl,-rpath={}'.format(paths)]
def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
if extra_args is None: