mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-25 04:21:54 +01:00
sys-boot/gnu-efi: Sync with Gentoo
It's from Gentoo commit 03de04c23891a42c7e00d00195bc118fd6c4c08b.
This commit is contained in:
parent
990f9b5cdb
commit
06d2c4b8d0
@ -16,7 +16,7 @@ SRC_URI="https://github.com/ncroxon/gnu-efi/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
|||||||
# - GPL-2+ : setjmp_ia32.S
|
# - GPL-2+ : setjmp_ia32.S
|
||||||
LICENSE="GPL-2+ BSD BSD-2"
|
LICENSE="GPL-2+ BSD BSD-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="-* ~amd64 ~arm ~arm64 ~loong ~riscv ~x86"
|
KEYWORDS="-* amd64 arm arm64 ~loong ~riscv x86"
|
||||||
IUSE="abi_x86_32 abi_x86_64 custom-cflags"
|
IUSE="abi_x86_32 abi_x86_64 custom-cflags"
|
||||||
REQUIRED_USE="
|
REQUIRED_USE="
|
||||||
amd64? ( || ( abi_x86_32 abi_x86_64 ) )
|
amd64? ( || ( abi_x86_32 abi_x86_64 ) )
|
||||||
@ -38,26 +38,32 @@ PATCHES=(
|
|||||||
|
|
||||||
check_and_set_objcopy() {
|
check_and_set_objcopy() {
|
||||||
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
||||||
|
|
||||||
|
if use arm || use riscv; then
|
||||||
|
# bug #939338
|
||||||
|
# objcopy does not understand PE/COFF on these arches: arm32, riscv64 and mips64le
|
||||||
|
# gnu-efi containes a workaround
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# bug #931792
|
# bug #931792
|
||||||
# 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-/}"
|
|
||||||
# Test OBJCOPY to see if it supports EFI targets, and return if it does
|
# Test OBJCOPY to see if it supports EFI targets, and return if it does
|
||||||
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' && return 0
|
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
|
# 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
|
# 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
|
# '(prefix)/usr/bin/objcopy' binary is available (it should be, it's a dependency), and if
|
||||||
# so, we use the absolute path explicitly.
|
# so, we use the absolute path explicitly.
|
||||||
local binutils_objcopy="${EPREFIX}"/usr/bin/"${OBJCOPY}"
|
local binutils_objcopy="${EPREFIX}"/usr/bin/objcopy
|
||||||
if [[ -e "${binutils_objcopy}" ]]; then
|
if [[ -e "${binutils_objcopy}" ]]; then
|
||||||
OBJCOPY="${binutils_objcopy}"
|
OBJCOPY="${binutils_objcopy}"
|
||||||
|
einfo "Forcing OBJCOPY=${OBJCOPY}"
|
||||||
fi
|
fi
|
||||||
if ! use arm && ! use riscv; then
|
|
||||||
# bug #939338
|
# Test OBJCOPY again to see if it supports EFI targets, and fail if it doesn't
|
||||||
# objcopy does not understand PE/COFF on these arches: arm32, riscv64 and mips64le
|
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
|
||||||
# gnu-efi containes a workaround
|
|
||||||
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user