-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* In use since 3.0.18 fixes bad detection on RISC-V Signed-off-by: Callum Farmer <[email protected]>
- Loading branch information
Showing
1 changed file
with
8 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ efi_ldsdir = get_option('efi-ldsdir') | |
efi_incdir = get_option('efi-includedir') | ||
|
||
if efi_incdir == '' | ||
efi_incdir = join_paths(includedir, 'efi') | ||
efi_incdir = join_paths(gnuefi.get_variable(pkgconfig: 'includedir'), 'efi') | ||
endif | ||
|
||
gnu_efi_path_arch = '' | ||
|
@@ -41,12 +41,7 @@ endif | |
|
||
efi_libdir = get_option('efi-libdir') | ||
if efi_libdir == '' | ||
fs = import('fs') | ||
multi = run_command(cc.cmd_array(), '-print-multi-os-directory', check: true).stdout().strip() | ||
efi_libdir = join_paths('/usr/lib/', multi) | ||
if not fs.is_dir(join_paths(efi_libdir, 'gnuefi')) | ||
efi_libdir = libdir | ||
endif | ||
efi_libdir = gnuefi.get_variable(pkgconfig: 'libdir') | ||
endif | ||
|
||
# The name we need to look for on this arch and OS: elf_x86_64_fbsd_efi.lds | ||
|
@@ -58,31 +53,13 @@ endif | |
arch_lds = 'efi.lds' | ||
arch_crt = 'crt0.o' | ||
if efi_ldsdir == '' | ||
efi_ldsdir = join_paths(efi_libdir, 'gnuefi', gnu_efi_path_arch) | ||
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) | ||
if cmd.returncode() != 0 | ||
arch_lds = 'elf_@0@@1@_efi.lds'.format(gnu_efi_path_arch, lds_os) | ||
arch_crt = 'crt0-efi-@[email protected]'.format(gnu_efi_path_arch) | ||
efi_ldsdir = join_paths(efi_libdir, 'gnuefi') | ||
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) | ||
endif | ||
if cmd.returncode() != 0 | ||
efi_ldsdir = efi_libdir | ||
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) | ||
if cmd.returncode() != 0 | ||
error('Cannot find @0@'.format(arch_lds)) | ||
endif | ||
endif | ||
else | ||
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) | ||
if cmd.returncode() != 0 | ||
arch_lds = 'elf_@0@@1@_efi.lds'.format(gnu_efi_path_arch, lds_os) | ||
arch_crt = 'crt0-efi-@[email protected]'.format(gnu_efi_path_arch) | ||
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) | ||
endif | ||
if cmd.returncode() != 0 | ||
error('Cannot find @0@'.format(arch_lds)) | ||
endif | ||
endif | ||
arch_lds = 'elf_@0@@1@_efi.lds'.format(gnu_efi_path_arch, lds_os) | ||
arch_crt = 'crt0-efi-@[email protected]'.format(gnu_efi_path_arch) | ||
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) | ||
if cmd.returncode() != 0 | ||
error('Cannot find @0@'.format(arch_lds)) | ||
endif | ||
efi_crtdir = efi_ldsdir | ||
|
||
|