mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 08:56:58 +02:00
sys-boot/gnu-efi: Sync with Gentoo
It's from Gentoo commit d25b3f6cfcf28716f030b7a7fea3206a5fc4dffd.
This commit is contained in:
parent
f1be7138dc
commit
c625e742ca
@ -42,6 +42,16 @@ check_and_set_objcopy() {
|
|||||||
# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
|
# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
|
||||||
tc-export OBJCOPY
|
tc-export OBJCOPY
|
||||||
OBJCOPY="${OBJCOPY/llvm-/}"
|
OBJCOPY="${OBJCOPY/llvm-/}"
|
||||||
|
# Test OBJCOPY to see if it supports EFI targets, and return if it does
|
||||||
|
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' && return 0
|
||||||
|
# If OBJCOPY does not support EFI targets, it is possible that the 'objcopy' on our path is
|
||||||
|
# still LLVM if the 'binutils-plugin' USE flag is set. In this case, we check to see if the
|
||||||
|
# '(prefix)/usr/bin/objcopy' binary is available (it should be, it's a dependency), and if
|
||||||
|
# so, we use the absolute path explicitly.
|
||||||
|
local binutils_objcopy="${EPREFIX}"/usr/bin/"${OBJCOPY}"
|
||||||
|
if [[ -e "${binutils_objcopy}" ]]; then
|
||||||
|
OBJCOPY="${binutils_objcopy}"
|
||||||
|
fi
|
||||||
LANG=C LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
|
LANG=C LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,16 @@ check_and_set_objcopy() {
|
|||||||
# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
|
# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
|
||||||
tc-export OBJCOPY
|
tc-export OBJCOPY
|
||||||
OBJCOPY="${OBJCOPY/llvm-/}"
|
OBJCOPY="${OBJCOPY/llvm-/}"
|
||||||
|
# Test OBJCOPY to see if it supports EFI targets, and return if it does
|
||||||
|
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' && return 0
|
||||||
|
# If OBJCOPY does not support EFI targets, it is possible that the 'objcopy' on our path is
|
||||||
|
# still LLVM if the 'binutils-plugin' USE flag is set. In this case, we check to see if the
|
||||||
|
# '(prefix)/usr/bin/objcopy' binary is available (it should be, it's a dependency), and if
|
||||||
|
# so, we use the absolute path explicitly.
|
||||||
|
local binutils_objcopy="${EPREFIX}"/usr/bin/"${OBJCOPY}"
|
||||||
|
if [[ -e "${binutils_objcopy}" ]]; then
|
||||||
|
OBJCOPY="${binutils_objcopy}"
|
||||||
|
fi
|
||||||
if ! use arm && ! use riscv; then
|
if ! use arm && ! use riscv; then
|
||||||
# bug #939338
|
# bug #939338
|
||||||
# objcopy does not understand PE/COFF on these arches: arm32, riscv64 and mips64le
|
# objcopy does not understand PE/COFF on these arches: arm32, riscv64 and mips64le
|
||||||
|
Loading…
Reference in New Issue
Block a user