From 1d1f35576a137dc36c63a5958a81d6135ab21f25 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 28 Jun 2023 16:54:34 -0400 Subject: [PATCH] build: Try harder to work with nongnu ld Only try to be fast with gnu ld. --- meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 19e0d96fba..b7717e18c9 100644 --- a/meson.build +++ b/meson.build @@ -746,9 +746,13 @@ if objcopy.found() objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol') endif -ld = find_program('ld.bfd', 'ld', required : false) +ld_is_bfd = false +ld = find_program('ld', required : false) +if ld.found() + ld_is_bfd = run_command(ld, '--version', check: false).stdout().contains('GNU ld') +endif -if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() +if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() and ld_is_bfd can_use_objcopy_for_resources = true else can_use_objcopy_for_resources = false -- 2.30.2