sys-boot/grub: add grub_platforms_arm64 use flag

Enables the build of efi grub application for arm64 platforms.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
This commit is contained in:
Andrej Rosano 2015-08-09 20:01:01 +02:00
parent 347819617d
commit 3ef27eba2d

View File

@ -42,6 +42,8 @@ GRUB_ALL_PLATFORMS=(
coreboot multiboot efi-32 pc qemu xen
# amd64, ia64:
efi-64
# arm64:
arm64
)
IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
@ -85,6 +87,7 @@ DEPEND="${RDEPEND}
sys-fs/squashfs-tools[lzo,xz]
grub_platforms_efi-64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] )
grub_platforms_pc? ( app-emulation/qemu[qemu_softmmu_targets_i386] )
grub_platforms_arm64? ( app-emulation/qemu[qemu_softmmu_targets_aarch64] )
)
truetype? ( app-arch/unzip )
"
@ -119,6 +122,19 @@ QA_PRESTRIPPED="
"
pkg_pretend() {
if [[ ${GRUB_PLATFORMS} =~ "arm64" ]] ; then
ebegin "Checking for aarch64-cros-linux-gnu-gcc"
if type -p aarch64-cros-linux-gnu-gcc > /dev/null ; then
eend 0
else
eend 1
eerror "Failed to locate 'aarch64-cros-linux-gnu-gcc' in \$PATH."
eerror "You can install an AARCH64 toolchain using:"
eerror " $ crossdev -t aarch64-cros-linux-gnu"
die "AARCH64 toolchain not found"
fi
fi
if [[ ${MERGE_TYPE} != binary ]]; then
# Bug 439082
if ! version_is_at_least 4.8 "$(gcc-version)" &&
@ -180,6 +196,12 @@ grub_configure() {
local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
export TARGET_CFLAGS TARGET_CPPFLAGS
fi ;;
arm64)
# FIXME(andrejro): mixed architecture binaries are generated
# while prepallstrip uses the native strip executable. This
# causes errors trying to strip aarch64 grub modules.
platform=efi
local CTARGET=aarch64-cros-linux-gnu ;;
guessed) ;;
*) platform=${MULTIBUILD_VARIANT} ;;
esac
@ -231,7 +253,6 @@ src_configure() {
fi
tc-export CC NM OBJCOPY STRIP
export TARGET_CC=${TARGET_CC:-${CC}}
tc-export BUILD_CC # Bug 485592
# Portage will take care of cleaning up GRUB_PLATFORMS