Skip to content

Commit

Permalink
Use objcopy to build arm/aarch64 binaries if binutils 2.38 or newer
Browse files Browse the repository at this point in the history
Fixes: #24
  • Loading branch information
superm1 committed Oct 5, 2022
1 parent c60c0b8 commit 8aff27d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions efi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ efi_ldflags = ['-T',
'-L', efi_crtdir,
'-L', efi_libdir,
join_paths(efi_crtdir, arch_crt)]
if host_cpu == 'aarch64' or host_cpu == 'arm'
# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary'
# instead, and add required symbols manually.
if objcopy_version.version_compare ('< 2.38') and (host_cpu == 'aarch64' or host_cpu == 'arm')
# older objcopy for Aarch64 and ARM32 are not EFI capable.
# Use 'binary' instead, and add required symbols manually.
efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa']
efi_format = ['-O', 'binary']
else
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ conf.set_quoted('PACKAGE_VERSION', meson.project_version())

cc = meson.get_compiler('c')
objcopy = find_program('objcopy')
objcopy_version = run_command(objcopy, '--version').stdout().split('\n')[0].split(' ')[-1]

prefix = get_option('prefix')
libdir = join_paths(prefix, get_option('libdir'))
Expand Down

0 comments on commit 8aff27d

Please sign in to comment.