Skip to content

Commit 0133631

Browse files
committed
EFI: Search for linker file
Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent aa41413 commit 0133631

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ if get_option('efi').enabled()
264264
efi_crt0_file = '/usr/lib64/crt0-efi-' + host_machine.cpu_family() + '.o'
265265
endif
266266

267+
efi_lds_file = '/usr/lib/elf_' + host_machine.cpu_family() + '_efi.lds'
268+
if (not fs.is_file(efi_lds_file))
269+
efi_lds_file = '/usr/lib64/elf_' + host_machine.cpu_family() + '_efi.lds'
270+
endif
271+
267272
# https://wiki.osdev.org/GNU-EFI
268273
add_global_arguments([
269274
'-fno-stack-protector',
@@ -277,7 +282,7 @@ if get_option('efi').enabled()
277282
add_project_link_arguments([
278283
'-shared',
279284
'-Wl,-Bsymbolic',
280-
'-T/usr/lib64/elf_' + host_machine.cpu_family() + '_efi.lds',
285+
'-T' + efi_lds_file,
281286
efi_crt0_file,
282287
],
283288
language : 'c')

0 commit comments

Comments
 (0)