build: Look for ld.bfd
authorMatthias Clasen <mclasen@redhat.com>
Wed, 28 Jun 2023 11:12:07 +0000 (07:12 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 28 Jun 2023 11:12:07 +0000 (07:12 -0400)
The objcopy+ld approach to fast resource building
relies on behavior that is specific to the binutils
linker, and does not work with the llvm one.

Therefore, check for ld.bfd. We still fall back
to trying with just ld, since I'm not 100% sure
if binutils unconditionally installs ld.bfd.

Fixes: #5672
meson.build

index c0c605f5ce31180ac9ac94d90880348e29ee29b7..19e0d96fba55c0b83a83dd3cb55eecf4b3444198 100644 (file)
@@ -746,7 +746,7 @@ if objcopy.found()
   objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol')
 endif
 
-ld = find_program('ld', required : false)
+ld = find_program('ld.bfd', 'ld', required : false)
 
 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()
   can_use_objcopy_for_resources = true