Skip to content

Commit aa41413

Browse files
committed
EFI: search for crt0-efi.o
Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent aec59ee commit aa41413

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ objcopy = find_program('objcopy', required : false)
257257
################################################################################
258258

259259
if get_option('efi').enabled()
260+
fs = import('fs')
261+
262+
efi_crt0_file = '/usr/lib/crt0-efi-' + host_machine.cpu_family() + '.o'
263+
if (not fs.is_file(efi_crt0_file))
264+
efi_crt0_file = '/usr/lib64/crt0-efi-' + host_machine.cpu_family() + '.o'
265+
endif
266+
260267
# https://wiki.osdev.org/GNU-EFI
261268
add_global_arguments([
262269
'-fno-stack-protector',
@@ -271,7 +278,7 @@ if get_option('efi').enabled()
271278
'-shared',
272279
'-Wl,-Bsymbolic',
273280
'-T/usr/lib64/elf_' + host_machine.cpu_family() + '_efi.lds',
274-
'/usr/lib64/crt0-efi-' + host_machine.cpu_family() + '.o',
281+
efi_crt0_file,
275282
],
276283
language : 'c')
277284

0 commit comments

Comments
 (0)