Make ld executable configurable

Tools like this should be configurable in a cross or native file. In
particular, if we are cross-compiling (with an executable wrapper like
qemu-arm), the build system ld is not necessarily able to manipulate
host system objects.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2019-11-04 10:24:15 +00:00
parent 6d8836515c
commit 81936ca580
4 changed files with 6 additions and 2 deletions

View File

@@ -586,8 +586,9 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
# (https://reviews.llvm.org/D58234). FIXME: This test could be enabled for
# LLVM once that support is in a stable release.
objcopy = find_program('objcopy', required : false)
ld = find_program('ld', required : false)
if build_machine.system() == 'linux' and cc.get_id() == 'gcc' and objcopy.found()
if build_machine.system() == 'linux' and cc.get_id() == 'gcc' and objcopy.found() and ld.found()
test_gresource_binary = custom_target('test5.gresource',
input : 'test5.gresource.xml',
output : 'test5.gresource',
@@ -616,7 +617,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
test_resources_binary = custom_target('test_resources.o',
input : test_gresource_binary,
output : 'test_resources.o',
command : ['ld',
command : [ld,
'-r',
'-b','binary',
'@INPUT@',