diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-13 11:15:36 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-01-22 23:39:33 +0200 |
commit | 730a7b296fdff8aca58e15829485b3b68262d3c0 (patch) | |
tree | 08d976f1a499520a520c09743904e268f5046d74 /mesonbuild/envconfig.py | |
parent | 958df63dac810246e84c2b8eaa32d22d19ace0ef (diff) | |
download | meson-730a7b296fdff8aca58e15829485b3b68262d3c0.zip meson-730a7b296fdff8aca58e15829485b3b68262d3c0.tar.gz meson-730a7b296fdff8aca58e15829485b3b68262d3c0.tar.bz2 |
environment: Replace LD with <LANG>LD
The rust code is ugly, because rust is annoying. It doesn't invoke a
linker directly (unless that linker is link.exe or lld-link.exe),
instead it invokes the C compiler (gcc or clang usually) to do it's
linking. Meson doesn't have good abstractions for this, though we
probably should because some of the D compilers do the same thing.
Either that or we should just call the c compiler directly, like vala
does.
This changes the public interface for meson, which we don't do unless we
absolutely have to. In this case I think we need to do it. A fair number
of projects have already been using 'ld' in their cross/native files to
get the ld binary and call it directly in custom_targets or generators,
and we broke that. While we could hit this problem again names like
`c_ld` and `cpp_ld` are far less likely to cause collisions than `ld`.
Additionally this gives a way to set the linker on a per-compiler basis,
which is probably in itself very useful.
Fixes #6442
Diffstat (limited to 'mesonbuild/envconfig.py')
-rw-r--r-- | mesonbuild/envconfig.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index c275ef2..1ebf067 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -313,11 +313,19 @@ class BinaryTable(HasEnvVarFallback): 'rust': 'RUSTC', 'vala': 'VALAC', + # Linkers + 'c_ld': 'CC_LD', + 'cpp_ld': 'CXX_LD', + 'd_ld': 'D_LD', + 'fortran_ld': 'F_LD', + 'objc_ld': 'OBJC_LD', + 'objcpp_ld': 'OBJCPP_LD', + 'rust_ld': 'RUST_LD', + # Binutils 'strip': 'STRIP', 'ar': 'AR', 'windres': 'WINDRES', - 'ld': 'LD', # Other tools 'cmake': 'CMAKE', |