diff options
author | Fini Jastrow <ulf.fini.jastrow@desy.de> | 2022-03-08 18:41:08 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-04-30 10:06:22 -0400 |
commit | c16fdaeecafe94461d6048b90bd337a04c25ad3c (patch) | |
tree | 7ebffc621f5ad4d75459dff1d5b5f05cc6481993 /mesonbuild/linkers/linkers.py | |
parent | 93ed7531c4a1e08defc5ea3b37427e59f67582db (diff) | |
download | meson-c16fdaeecafe94461d6048b90bd337a04c25ad3c.zip meson-c16fdaeecafe94461d6048b90bd337a04c25ad3c.tar.gz meson-c16fdaeecafe94461d6048b90bd337a04c25ad3c.tar.bz2 |
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 <ulf.fini.jastrow@desy.de>
Diffstat (limited to 'mesonbuild/linkers/linkers.py')
-rw-r--r-- | mesonbuild/linkers/linkers.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index 88b66be..4609652 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.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. @@ -806,6 +806,11 @@ class GnuBFDDynamicLinker(GnuDynamicLinker): id = 'ld.bfd' +class MoldDynamicLinker(GnuDynamicLinker): + + id = 'ld.mold' + + class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker): """Representation of LLVM's ld.lld linker. |