From c16fdaeecafe94461d6048b90bd337a04c25ad3c Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Tue, 8 Mar 2022 18:41:08 +0100 Subject: linkers: Add support for mold linker [why] Support for the relatively new mold linker is missing. If someone wants to use mold as linker `LDFLAGS="-B/path/to/mold"` has to be added instead of the usual `CC_LD=mold meson ...` or `CXX_LD=mold meson ...`. [how] Allow `mold' as linker for clang and newer GCC versions (that versions that have support). The error message can be a bit off, because it is generic for all GNU like compilers, but I guess that is ok. (i.e. 'mold' is not listed as possible linker, even if it would be possible for the given compiler.) [note] GCC Version 12.0.1 is not sufficient to say `mold` is supported. The expected release with support will be 12.1.0. On the other hand people that use the un-released 12.0.1 will probably have built it from trunk. Allowing 12.0.1 is helping bleeding edge developers to use mold in Meson already now. Fixes: #9072 Signed-off-by: Fini Jastrow --- mesonbuild/compilers/rust.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/rust.py') diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index a460b78..0967ada 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -1,4 +1,4 @@ -# Copyright 2012-2017 The Meson development team +# Copyright 2012-2022 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -136,7 +136,7 @@ class RustCompiler(Compiler): return ['-o', outputname] @classmethod - def use_linker_args(cls, linker: str) -> T.List[str]: + def use_linker_args(cls, linker: str, version: str) -> T.List[str]: return ['-C', f'linker={linker}'] # Rust does not have a use_linker_args because it dispatches to a gcc-like -- cgit v1.1